Keeping audio & video in sync when generating an AVI
category: code [glöplog]
I added AVI capture to Oricutron, and basically i just dump the video and audio frames as they are generated to the output file. After a while the audio goes out of sync from the video. How do you keep them in sync?
The (very basic) implementation is here:
http://code.google.com/p/oriculator/source/browse/trunk/avi.c.
BTW, I didn't just use a library because the whole of Oricutron is a programming exercise for me and I wrote it all from scratch.
The (very basic) implementation is here:
http://code.google.com/p/oriculator/source/browse/trunk/avi.c.
BTW, I didn't just use a library because the whole of Oricutron is a programming exercise for me and I wrote it all from scratch.
I'd make sure your audio chunk size matches the frame rate. Check your audio lenght. Maybe try supplying a buffer size... Hope that helps.