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

Vijay Rakesh Munganda vijayrakeshmunganda at gmail.com
Sat Jan 9 17:03:51 EET 2021

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 <barsnick at gmx.net> 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 @ 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.
> Regards,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".

More information about the ffmpeg-user mailing list