[FFmpeg-user] ffmpeg record from usb webcam give huge sync problem

Moritz Barsnick barsnick at gmx.net
Sun Feb 22 20:13:38 CET 2015

On Sun, Feb 22, 2015 at 09:42:40 +0200, Vlăduţ Frăţiman wrote:
> ffmpeg -y -f v4l2 -s 640x360 -framerate 5 -i /dev/video0 -f alsa -ac 1 -i default:CARD=HD3000 -pix_fmt yuv420p -c:v libx264 -q:v 20 -r 5 -preset ultrafast -strict -2 -c:a aac capture.mkv

I believe "-s" should be "-video_size".
I believe "-q:v" has no effect on libx264, but I may be wrong.

That said:

> The main problem is that audio and video are totally out of sync.
> Probably each device (video and audio) will not start simultaneously.
> Is there any parameter to ensure that the two devices are ready
> simultaneously so when recording, video and audio will be in sync?
> In my case, audio start much faster. At begining video is freezing and
> hear audio, then both play obviously out of sync and then audio is
> finishing and video still playing until finish.

Please show us the complete console output from the ffmpeg command.


More information about the ffmpeg-user mailing list