[FFmpeg-user] Unable to play recorded audio and video from webcam using ffmpeg

Moritz Barsnick barsnick at gmx.net
Sat Jan 9 16:21:20 EET 2021

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 @ 0x7f1220000b80] 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.


More information about the ffmpeg-user mailing list