While making screencasts I always end up with a file having poorly synced audio and video streams. This is not container specific as this happens with all the formats - ogg, mkv, avi, mp4 etc. I guess this has something to do with ffmpeg.

After searching on Internet, I found that this can be fixed using itsoffset switch in ffmpeg. I also tested it and it works. But the question is how do I find exact lag between audio and video streams in seconds:milliseconds?? I tried ffmpeg -i but it always shows delay to be zero.


Do you know what a clapper is? It's an old device used in movie making and looks like this:

alt text

This is used by the editor to sync the video and audio together. You need this because there is nothing about audio and video streams that really allow a computer to work out how out of sync they are.

Your best course of action is to work out why your recording is going out of sync. It sounds like your computer might be underpowered (conjecture as I don't know how powerful your computer is). If you can't solve the syncing problem, then use a clapper (or make one) and then trial and error your way into syncing it back up.

Of course this only helps with fixed sync issues, if you have progressive sync issues then you can use the time signature to resync the streams and this is something the computer can help you with. Is suspect that's what ffmpeg is trying to do.

  • Ok. I found a solution for this. For accurate trial and error results, I used track synchronisation option in VLC and it turned out that delay is approx. 2.700 seconds. What is strange that the sync problem is only on a laptop powered by ATI card. It does not happen with another machine using weak Intel card and in both cases I installed ffmpeg from Ubuntu 10.10 repositories – user8592 Jan 20 '11 at 11:41
  • The video recording has nothing to do with the video card. It's most likely 2.7 seconds of audio or video that isn't in the other. Basically that they start recording at different times. – Martin Owens -doctormo- Jan 20 '11 at 12:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.