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

Vijay Rakesh Munganda vijayrakeshmunganda at gmail.com
Sat Jan 9 11:03:59 EET 2021


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 @ 0x7f1220000b80] Format h264 detected only with low score of 1, misdetection possible!
[h264 @ 0x7f12200022c0] non-existing PPS 0 referenced    0B f=0/0   
[h264 @ 0x7f12200022c0] non-existing PPS 0 referenced    0B f=0/0   
[h264 @ 0x7f12200022c0] decode_slice_header error
[h264 @ 0x7f12200022c0] no frame!
[h264 @ 0x7f1220000b80] decoding for stream 0 failed
[h264 @ 0x7f1220000b80] 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 <vijayrakeshmunganda at gmail.com> 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 <ceffmpeg at gmail.com> wrote:
>>> 
>> 
>> 
>>> Am 08.01.2021 um 17:17 schrieb Vijay Rakesh Munganda <vijayrakeshmunganda at gmail.com>:
>>> 
>>> 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 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