Re: [FFmpeg-user] Failed to generate stream segment video frames
> > Hi, > > I'm trying to generate video and audio stream segments, with below command > I'm able to generate audio segments but not full video segments. Please find > the attached log file. Forgot to mention, I have used -g 45 to set key frame interval as 45. Thanks & Regards, Vijay Rakesh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Failed to generate stream segment video frames
Hi, I'm trying to generate video and audio stream segments, with below command I'm able to generate audio segments but not full video segments. Please find the attached log file. $ffmpeg -f alsa -channels 1 -thread_queue_size 1024 -i hw:1 -f video4linux2 -i /dev/video0 -c:a aac -ar 48k -t 0:30 -segment_time 00:00.08 -segment_start_number 1 -f stream_segment /home/test/samples/aacSampleFrames/sample-%003d.aac -c:v h264 -pix_fmt yuv420p -s:v 640x480 -t 0:30 -r 25 -g 45 -bf 0 -segment_time 00:00.08 -segment_start_number 1 -f stream_segment /home/test/samples/h264SampleFrames/frame-%003d.h264 $ffmpeg -f alsa -channels 1 -thread_queue_size 1024 -i hw:1 -f video4linux2 -i /dev/video0 -c:a aac -ar 48k -t 0:30 -segment_time 00:00.08 -segment_start_number 1 -f stream_segment /home/test/samples/aacSampleFrames/sample-%003d.aac -c:v h264 -pix_fmt yuv420p -s:v 640x480 -t 0:30 -r 25 -g 45 -bf 0 -segment_time 00:00.08 -segment_start_number 1 -f stream_segment /home/test/samples/h264SampleFrames/frame-%003d.h264 ---LOG--- ffmpeg version 4.3.1-0york0~18.04 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --prefix=/usr --extra-version='0york0~18.04' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libzimg --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat58. 45.100 / 58. 45.100 libavdevice58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc55. 7.100 / 55. 7.100 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, alsa, from 'hw:1': Duration: N/A, start: 1612769875.699063, bitrate: 768 kb/s Stream #0:0: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s Input #1, video4linux2,v4l2, from '/dev/video0': Duration: N/A, start: 9430.548807, bitrate: 147456 kb/s Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native)) Stream #1:0 -> #1:0 (rawvideo (native) -> h264 (libx264)) Press [q] to stop, [?] for help [stream_segment,ssegment @ 0x559fbce4f540] Opening '/home/test/samples/aacSampleFrames/sample-001.aac' for writing Output #0, stream_segment,ssegment, to '/home/test/samples/aacSampleFrames/sample-%003d.aac': Metadata: encoder : Lavf58.45.100 Stream #0:0: Audio: aac (LC), 48000 Hz, mono, fltp, 69 kb/s Metadata: encoder : Lavc58.91.100 aac [libx264 @ 0x559fbce5ab80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 [libx264 @ 0x559fbce5ab80] profile High, level 3.0 [stream_segment,ssegment @ 0x559fbce58ec0] Opening '/home/test/samples/h264SampleFrames/frame-001.h264' for writing Output #1, stream_segment,ssegment, to '/home/test/samples/h264SampleFrames/frame-%003d.h264': Metadata: encoder : Lavf58.45.100 Stream #1:0: Video: h264 (libx264), yuv420p, 640x480, q=-1--1, 25 fps, 25 tbn, 25 tbc Metadata: encoder : Lavc58.91.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A [stream_segment,ssegment @ 0x559fbce4f540] Opening '/home/test/samples/aacSampleFrames/sample-002.aac' for writing [stream_segment,ssegment @ 0x559fbce4f540] Opening '/home/test/samples/aacSampleFrames/sample-003.aac' for writing [stream_segment,ssegment @ 0x559fbce4f540] Opening '/home/test/samples/aacSampleFrames/sample-004.aac' for writing [stream_segment,ssegment @ 0x559fbce4f540] Opening '/home/test/samples/aacSampleFrames/sample-005.aac' for writing [stream_segment,ssegment @ 0x559fbce4f540] Opening '/home/test/samples/aacSampleFrames/sample-006.
Re: [FFmpeg-user] Error while playing record audio from webcam
Hi, I just tried to record only audio by running below command. ffmpeg -f alsa -channels 1 -i hw:1 -c:a aac -ar 48k -t 0:10 sample.aac When play sample.aac file using ffplay it started to play which I have recorded then after it continued to play with silent output. How to solve above issue? Thanks & Regards, Vijay Rakesh > On 19-Jan-2021, at 10:27, Vijay Rakesh Munganda > wrote: > > > Hi All, > > I’m using below command to create video and audio files for real time > streaming to the cloud. > > ffmpeg -f alsa -channels 1 -thread_queue_size 1024 -i hw:1 -f video4linux2 -i > /dev/video0 -c:a aac -ar 48k -t 0:10 -segment_time 00:00.08 -f stream_segment > sample-%003d.aac -c:v h264 -force_key_frames "expr:gte(t,n_forced*0.08)" > -pix_fmt yuv420p -s:v 640x480 -t 0:10 -r 25 -g 1 -segment_time 00:00.08 -f > stream_segment frame-%003d.h264 > > When I use ffplay on video clips it is playing, but when I run audio clips I > get different errors for different segmented output as follows, and some > clips play for more than 13s when segment given as 80ms. > > Error: > Error: sample-000.aac: Invalid data found when processing input 0B f=0/0 > > [mpegts @ 0x7f6f3b80] Format mpegts detected only with low score of 2, > misdetection possible! > > [mpegts @ 0x7f6f3b80] Could not detect TS packet size, defaulting to > non-FEC/DVHS sample-001.aac: could not find codec parameters > > Did I miss anything in the command? > > Thanks & Regards, > Vijay Rakesh > > > Thanks & Regards, > Vijay Rakesh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Error while playing record audio from webcam
Hi All, I’m using below command to create video and audio files for real time streaming to the cloud. ffmpeg -f alsa -channels 1 -thread_queue_size 1024 -i hw:1 -f video4linux2 -i /dev/video0 -c:a aac -ar 48k -t 0:10 -segment_time 00:00.08 -f stream_segment sample-%003d.aac -c:v h264 -force_key_frames "expr:gte(t,n_forced*0.08)" -pix_fmt yuv420p -s:v 640x480 -t 0:10 -r 25 -g 1 -segment_time 00:00.08 -f stream_segment frame-%003d.h264 When I use ffplay on video clips it is playing, but when I run audio clips I get different errors for different segmented output as follows, and some clips play for more than 13s when segment given as 80ms. Error: Error: sample-000.aac: Invalid data found when processing input 0B f=0/0 [mpegts @ 0x7f6f3b80] Format mpegts detected only with low score of 2, misdetection possible! [mpegts @ 0x7f6f3b80] Could not detect TS packet size, defaulting to non-FEC/DVHS sample-001.aac: could not find codec parameters Did I miss anything in the command? Thanks & Regards, Vijay Rakesh Thanks & Regards, Vijay Rakesh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Unable to play recorded audio and video from webcam using ffmpeg
Hi All, Kindly please anyone suggest me. Thanks & Regards, Vijay Rakesh > On 11-Jan-2021, at 10:06, Vijay Rakesh Munganda > wrote: > > > Hi Moritz, > >> Assuming ffmpeg actually segments like this (and not on keyframes): >> Individual >> frames cannot normally be played, unless they are keyframes. You should >> play the complete segment "playlist" as a whole. ffplay will have >> trouble identifying the streams and codecs in such a short sample: >> I have add keyframes > > I have added the keyframes option in ffmpeg command as ffmpeg -f alsa > -thread_queue_size 1024 -i hw:0 -f video4linux2 -i /dev/video0 -c:a aac -ar > 48k -t 0:10 -segment_time 00:00.04 -f segment sample-%003d.aac -c:v h264 > -force_key_frames "expr:gte(t,n_forced*0.04)" -pix_fmt yuv420p -s:v 640x480 > -t 0:10 -r 25 -g 1 -segment_time 00:00.04 -f segment frame-%003d.h264. But > still I get an error as frame-001.h264: Invalid data found when processing > input. > > Console Output: > configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened > --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu > --enable-gpl --disable-stripping --enable-avresample --enable-avisynth > --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray > --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite > --enable-libfontconfig --enable-libfreetype --enable-libfribidi > --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa > --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse > --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy > --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora > --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack > --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid > --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl > --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 > --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 > --enable-shared > libavutil 55. 78.100 / 55. 78.100 > libavcodec 57.107.100 / 57.107.100 > libavformat57. 83.100 / 57. 83.100 > libavdevice57. 10.100 / 57. 10.100 > libavfilter 6.107.100 / 6.107.100 > libavresample 3. 7. 0 / 3. 7. 0 > libswscale 4. 8.100 / 4. 8.100 > libswresample 2. 9.100 / 2. 9.100 > libpostproc54. 7.100 / 54. 7.100 > Guessed Channel Layout for Input Stream #0.0 : stereo > Input #0, alsa, from 'hw:0': > Duration: N/A, start: 1610338632.931406, bitrate: 1536 kb/s > Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s > Input #1, video4linux2,v4l2, from '/dev/video0': > Duration: N/A, start: 3405.427360, bitrate: 147456 kb/s > Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, > 147456 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc > Stream mapping: > Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native)) > Stream #1:0 -> #1:0 (rawvideo (native) -> h264 (libx264)) > Press [q] to stop, [?] for help > [alsa @ 0x55777d96fe00] ALSA buffer xrun. > [segment @ 0x55777d983d80] Opening 'sample-000.aac' for writing > Output #0, segment, to 'sample-%003d.aac': > Metadata: > encoder : Lavf57.83.100 > Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s > Metadata: > encoder : Lavc57.107.100 aac > [libx264 @ 0x55777d98fa20] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 > [libx264 @ 0x55777d98fa20] profile High, level 3.0 > [libx264 @ 0x55777d98fa20] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC > codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: > cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 > psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 > deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 > sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 > constrained_intra=0 bframes=0 weightp=0 keyint=1 keyint_min=1 scenecut=40 > intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 > ip_ratio=1.40 aq=1:1.00 > [segment @ 0x55777d98dda0] Opening 'frame-000.h264' for writing > Output #1, segment, to 'frame-%003d.h264': > Metadata: > encoder : Lavf57.83.100 > Stream #1:0: Video: h264 (libx264), yuv420p, 640x480, q=-1--1, 25 fps, 25 > tbn, 25 tbc > Metadata: > encoder : Lavc57.107.100 libx264 > Side data: > cpb: bitrate
Re: [FFmpeg-user] Unable to play recorded audio and video from webcam using ffmpeg
nt @ 0x55777d98dda0] Opening 'frame-018.h264' for writingA dup=5 drop=0 speed=0.714x ... [segment @ 0x55777d98dda0] Opening 'frame-029.h264' for writingA dup=12 drop=0 speed=0.768x ... [segment @ 0x55777d98dda0] Opening 'frame-042.h264' for writingA dup=21 drop=0 speed=0.834x ... [segment @ 0x55777d983d80] Opening 'sample-055.aac' for writingA dup=31 drop=0 speed=0.89x ... [segment @ 0x55777d98dda0] Opening 'frame-067.h264' for writingA dup=39 drop=0 speed=0.887x ... [segment @ 0x55777d98dda0] Opening 'frame-081.h264' for writingA dup=49 drop=0 speed=0.92x ... [segment @ 0x55777d98dda0] Opening 'frame-091.h264' for writingA dup=56 drop=0 speed=0.904x ... [segment @ 0x55777d98dda0] Opening 'frame-105.h264' for writingA dup=66 drop=0 speed=0.927x ... [segment @ 0x55777d98dda0] Opening 'frame-119.h264' for writingA dup=76 drop=0 speed=0.944x ... [segment @ 0x55777d98dda0] Opening 'frame-130.h264' for writingA dup=84 drop=0 speed=0.938x ... [segment @ 0x55777d98dda0] Opening 'frame-144.h264' for writingA dup=94 drop=0 speed=0.952x ... [segment @ 0x55777d983d80] Opening 'sample-154.aac' for writingA dup=103 drop=0 speed=0.958x ... [segment @ 0x55777d98dda0] Opening 'frame-168.h264' for writingA dup=111 drop=0 speed=0.952x ... [segment @ 0x55777d98dda0] Opening 'frame-182.h264' for writingA dup=121 drop=0 speed=0.962x ... [segment @ 0x55777d98dda0] Opening 'frame-193.h264' for writingA dup=129 drop=0 speed=0.956x ... [segment @ 0x55777d98dda0] Opening 'frame-207.h264' for writingA dup=139 drop=0 speed=0.965x ... [segment @ 0x55777d983d80] Opening 'sample-218.aac' for writingA dup=149 drop=0 speed=0.974x ... [segment @ 0x55777d98dda0] Opening 'frame-231.h264' for writingA dup=156 drop=0 speed=0.964x ... [segment @ 0x55777d98dda0] Opening 'frame-249.h264' for writing frame= 250 fps= 24 q=-1.0 Lsize=N/A time=00:00:10.00 bitrate=N/A dup=168 drop=0 speed=0.98x video:2707kB audio:149kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown [aac @ 0x55777d98cf00] Qavg: 260.500 [libx264 @ 0x55777d98fa20] frame I:250 Avg QP:26.77 size: 11085 [libx264 @ 0x55777d98fa20] mb I I16..4: 13.4% 72.3% 14.3% [libx264 @ 0x55777d98fa20] 8x8 transform intra:72.3% [libx264 @ 0x55777d98fa20] coded y,uvDC,uvAC intra: 54.2% 91.6% 64.5% [libx264 @ 0x55777d98fa20] i16 v,h,dc,p: 13% 18% 6% 62% [libx264 @ 0x55777d98fa20] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 19% 18% 16% 6% 7% 6% 12% 5% 10% [libx264 @ 0x55777d98fa20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 18% 11% 6% 8% 8% 10% 5% 6% [libx264 @ 0x55777d98fa20] i8c dc,h,v,p: 58% 20% 15% 7% [libx264 @ 0x55777d98fa20] kb/s:2216.90 Thanks & Regards, Vijay Rakesh. On Sat, Jan 9, 2021 at 8:33 PM Vijay Rakesh Munganda < vijayrakeshmunga...@gmail.com> wrote: > Hi Moritz, > > > "-segment_time 00:00.040"? > Are you trying to create a segment for each single frame? > > No, I’m trying to create h264 video and aac audio of every 40ms > continuously upto 10s. So that I can send these video and audio files as a > fragments to the AWS kinesis video streams, at cloud end it will get > combined for playing. When I use ffplay on these samples it plays video, > but not audio > https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/tree/master/samples. > I want to generate similar video and audio files from webcam. Since I’m new > to ffmpeg I’m unable write correct ffmpeg command, kindly please suggest > me. > > Thanks & Regards, > Vijay Rakesh > > On 09-Jan-2021, at 19:51, Moritz Barsnick wrote: > > Hi Vijay, > > On Sat, Jan 09, 2021 at 14:33:59 +0530, Vijay Rakesh Munganda wrote: > > ffmpeg -f alsa -thread_queue_size 1024 -i hw:0 -f video4linux2 -i > /dev/video0 -c:a aac -t 0:10 -segment_time 00:00.040 > > -f segment sample-%003d.aac -c:v libx264 -s:v 640x480 -t 0:10 -r 25 -g 1 > -segment_time 00:00.040 -f segment frame-%003d.h264 > > > "-segment_time 00:00.040"? > Are you trying to create a segment for each single frame? > > Assuming ffmpeg actually segments like this (and not on keyframes): > Individual > frames cannot normally be played, unless they are keyframes. You should > play the complete segment "playlist" as a whole. ffplay will have > trouble identifying the streams and codecs in such a short sample: > > [h264 @ 0x7f122b80] Format h264 detected only with low score of 1, > misdetection possible! > > [...] > > [aac @ 0x7f0ce8000b80] Format aac detected only with low score of 1, > misdetection possible! > > > The other errors likely also come from missing references. > > [aac @ 0x7f0ce8000b80] Estimating duration from bitrate, this may be > inaccurate > > Input #
Re: [FFmpeg-user] Unable to play recorded audio and video from webcam using ffmpeg
Hi Moritz, > > "-segment_time 00:00.040"? > Are you trying to create a segment for each single frame? > No, I’m trying to create h264 video and aac audio of every 40ms continuously upto 10s. So that I can send these video and audio files as a fragments to the AWS kinesis video streams, at cloud end it will get combined for playing. When I use ffplay on these samples it plays video, but not audio https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/tree/master/samples. I want to generate similar video and audio files from webcam. Since I’m new to ffmpeg I’m unable write correct ffmpeg command, kindly please suggest me. Thanks & Regards, Vijay Rakesh > On 09-Jan-2021, at 19:51, Moritz Barsnick wrote: > > Hi Vijay, > >> On Sat, Jan 09, 2021 at 14:33:59 +0530, Vijay Rakesh Munganda wrote: >> ffmpeg -f alsa -thread_queue_size 1024 -i hw:0 -f video4linux2 -i >> /dev/video0 -c:a aac -t 0:10 -segment_time 00:00.040 >> -f segment sample-%003d.aac -c:v libx264 -s:v 640x480 -t 0:10 -r 25 -g 1 >> -segment_time 00:00.040 -f segment frame-%003d.h264 > > "-segment_time 00:00.040"? > Are you trying to create a segment for each single frame? > > Assuming ffmpeg actually segments like this (and not on keyframes): Individual > frames cannot normally be played, unless they are keyframes. You should > play the complete segment "playlist" as a whole. ffplay will have > trouble identifying the streams and codecs in such a short sample: > >> [h264 @ 0x7f122b80] Format h264 detected only with low score of 1, >> misdetection possible! > [...] >> [aac @ 0x7f0ce8000b80] Format aac detected only with low score of 1, >> misdetection possible! > > The other errors likely also come from missing references. > >> [aac @ 0x7f0ce8000b80] Estimating duration from bitrate, this may be >> inaccurate >> Input #0, aac, from 'sample-000.aac': >> Duration: 00:00:00.04, bitrate: 109 kb/s >>Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 109 kb/s >> 13.16 M-A: 0.000 fd= 0 aq=0KB vq=0KB sq=0B f=0/0 > > Please remember to always post the complete, uncut console output of > the errored command, in this case ffplay. The output of ffmpeg would > also have been helpful, but perhaps, in this case, your edited output > may be enough. > > Regards, > Moritz > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Unable to play recorded audio and video from webcam using ffmpeg
Hi Carl, Just now gone through the documentation, and got know -r used for FPS. So I had made changes and executed the command as follows, but I got the same following errors while playing using ffplay. Kindly please help me in this regard. Command: ffmpeg -f alsa -thread_queue_size 1024 -i hw:0 -f video4linux2 -i /dev/video0 -c:a aac -t 0:10 -segment_time 00:00.040 -f segment sample-%003d.aac -c:v libx264 -s:v 640x480 -t 0:10 -r 25 -g 1 -segment_time 00:00.040 -f segment frame-%003d.h264 Video Error: frame-000.h264: Invalid data found when processing input 0B f=0/0 nan: 0.000 fd= 0 aq=0KB vq=0KB sq=0B f=0/0 frame-001.h264: [h264 @ 0x7f122b80] Format h264 detected only with low score of 1, misdetection possible! [h264 @ 0x7f12200022c0] non-existing PPS 0 referenced0B f=0/0 [h264 @ 0x7f12200022c0] non-existing PPS 0 referenced0B f=0/0 [h264 @ 0x7f12200022c0] decode_slice_header error [h264 @ 0x7f12200022c0] no frame! [h264 @ 0x7f122b80] decoding for stream 0 failed [h264 @ 0x7f122b80] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, h264, from 'frame-001.h264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264, none, 25 tbr, 1200k tbn, 50 tbc [h264 @ 0x7f1220005d20] non-existing PPS 0 referenced [h264 @ 0x7f1220005d20] decode_slice_header error Audio Error: (Audio should play for 40ms, but window pop-up plays for 13.16s) [aac @ 0x7f0ce8000b80] Format aac detected only with low score of 1, misdetection possible! [aac @ 0x7f0ce8000b80] Estimating duration from bitrate, this may be inaccurate Input #0, aac, from 'sample-000.aac': Duration: 00:00:00.04, bitrate: 109 kb/s Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 109 kb/s 13.16 M-A: 0.000 fd= 0 aq=0KB vq=0KB sq=0B f=0/0 Thanks & Regards, Vijay Rakesh. > On 09-Jan-2021, at 10:43, Vijay Rakesh Munganda > wrote: > > Hi Carl, > > Thanks for the reply. -f 25 for encoding the video in 25 FPS (because 1000 > milliseconds / 40 milliseconds = 25 frames) and tell FFmpeg to use every > frame as a key frame (-g 1). > > Thanks & Regards, > Vijay Rakesh > >>> On 09-Jan-2021, at 01:04, Carl Eugen Hoyos wrote: >>> >> >> >>> Am 08.01.2021 um 17:17 schrieb Vijay Rakesh Munganda >>> : >>> >>> ffmpeg -f alsa -thread_queue_size 1024 -i hw:0 -f video4linux2 -i >>> /dev/video0 -c:a aac -t 0:10 -segment_time 00:00.040 -f segment >>> sample-%003d.aac -c:v libx264 -t -f 25 -g 1 0:10 -segment_time 00:00.040 -f >>> segment frame-%003d.h264 >> >> Complete, uncut console output missing. >> -f 25 looks wrong, did you mean -r 25? >> >> Carl Eugen >> ___ >> ffmpeg-user mailing list >> ffmpeg-user@ffmpeg.org >> https://ffmpeg.org/mailman/listinfo/ffmpeg-user >> >> To unsubscribe, visit link above, or email >> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] Unable to play recorded audio and video from webcam using ffmpeg
Hi Carl, Thanks for the reply. -f 25 for encoding the video in 25 FPS (because 1000 milliseconds / 40 milliseconds = 25 frames) and tell FFmpeg to use every frame as a key frame (-g 1). Thanks & Regards, Vijay Rakesh > On 09-Jan-2021, at 01:04, Carl Eugen Hoyos wrote: > > > >> Am 08.01.2021 um 17:17 schrieb Vijay Rakesh Munganda >> : >> >> ffmpeg -f alsa -thread_queue_size 1024 -i hw:0 -f video4linux2 -i >> /dev/video0 -c:a aac -t 0:10 -segment_time 00:00.040 -f segment >> sample-%003d.aac -c:v libx264 -t -f 25 -g 1 0:10 -segment_time 00:00.040 -f >> segment frame-%003d.h264 > > Complete, uncut console output missing. > -f 25 looks wrong, did you mean -r 25? > > Carl Eugen > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] Unable to play recorded audio and video from webcam using ffmpeg
Hi, I’m trying to record audio and video from webcam with ffmpeg using below command, but I’m unable to play all generated files using ffplay. Command: ffmpeg -f alsa -thread_queue_size 1024 -i hw:0 -f video4linux2 -i /dev/video0 -c:a aac -t 0:10 -segment_time 00:00.040 -f segment sample-%003d.aac -c:v libx264 -t -f 25 -g 1 0:10 -segment_time 00:00.040 -f segment frame-%003d.h264 Error: Audio Error:Format mpegts detected only with low score of 2, misdetection possible! Could not detect TS packet size, defaulting to non-FEC/DVHSsample-005.aac: could not find codec parameters Format aac detected only with low score of 1, misdetection possible! Estimating duration from bitrate, this may be inaccurate Video Error: frame-006.h264: Invalid data found when processing input=0/0 Kindly please suggest me. Thanks & Regards, Vijay Rakesh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] How to record video and audio in parallel for every 40ms continuous upto 10s
Hi, I’m new to FFMEPG, how to record video and audio in a separate files for every 40ms continuously upto 10 seconds from webcam using FFMPEG? I used below command, but it is generating 250 audio and only 1 video file. Also it is generating audio then video, I need it parallel, video with respective audio. ffmpeg -f alsa -thread_queue_size 1024 -i hw:0 -f video4linux2 -i /dev/video0 -c:a aac -t 0:10 -segment_time 00:00.040 -f segment audio_%003d.aac -c:v libx264 -t 0:10 -segment_time 00:00.040 -f segment out_%003d.h264 Thanks & Regards, Vijay Rakesh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] How create h264 frames and acc audio frames from a video/webcam
Hi, I’m new to ffmpeg, how create h264 frames and acc audio frames from a video/webcam for streaming to the cloud. I searched online but I couldn’t find. Thanks & Regards, Vijay Rakesh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".