USB audio / video sync question
- Date: Thu, 17 Jun 2010 17:11:12 -0700 (PDT)
- From: David Milici <davemilici@xxxxxxxxxxxxx>
- Subject: USB audio / video sync question
I'm working with Pixart USB camera, using Video4Linux for video capture and ALSA for audio capture. I'm having trouble establishing sync between audio and video streams during capture sessions. Sometimes sync is acceptable, and other times audio leads video.
I tried enabling timestamps on ALSA PCM updates to compare with V4L timestamps, and for 20 FPS camera input see that video frames and audio blocks are typically within 50 msec of each other.
What happens on some sessions is that audio blocks show up sooner than the first video frame, like 3 blocks will be delivered ~150 msec earlier. Some other saved capture sessions are out of sync by even more time.
This makes me wonder if the audio and video input streams could be running at their respective driver's pace, and "sync" happens to be incidental from the streams running concurrently.
What then is the recommended method(s) for capturing audio and video streams in sync? Is there an example available for a USB camera?
Thanks for any help you could offer,
video4linux-list mailing list