[FFmpeg-user] Bad A/V Sync Using ffmpeg on V4L2 Input Device

LANGLOIS Olivier PIS -EXT olivier.pis.langlois at transport.alstom.com
Tue Mar 25 00:28:47 CET 2014


I am working on a similar issue. I'll probably add details on my experience latter to this thread but in the meantime, I can point to you some details:

>   Duration: N/A, start: 1394670862.629223, 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: 575244.424820, bitrate: 165722 kb/s
>     Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 720x480,
> 165722 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 1000k tbc No pixel format

Notice the start times of each input. For alsa, it uses abs time and by default, webcam uses monotonic time. Something that I was about to try and perhaps you try it out to see if it helps is to use ts abs for the v4l2 input.

However, it might not be enough. Check if your webcam is using the uvcvideo driver. If yes, you might configure it to use abs ts as well to avoid ffmpeg having to do the conversion.

Several ways to do it.


# rmmode uvcvideo
# modprobe uvcvideo clock=realtime


Add a uvcvideo.conf in /etc/modprobe.d directory with

uvcvideo option clock=realtime



CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.

More information about the ffmpeg-user mailing list