Take the 2-minute tour ×
Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It's 100% free, no registration required.

I've got some moderately large, compressed video files (~2+ gigs, over an hour long) from a few Open Broadcaster Software streams to Twitch.tv. All output files (including the twitch archive's export) have the dreaded gradual audio desync.

I have assorted tools to play with audio, but all of them seem to be failing me. Camtassia Studio barely loads the files (sometimes it just plain doesn't), and since the desync is gradual, Camtasia can't really help since I can only shift ALL audio.

I used to be able to fix a similar desync problem in Virtual Dub, which would change the "framerate" or some equivalent timing of the video or audio to make them match up in timing, I did this with small 10 minute AVI files and it worked like a charm. But Virtual Dub doesn't support mp4s with h264, and even after adding a plugin to give VDub support for them it crashes when I load the files in Virtual Dub.

Is there any moderately easy way to correct this audio sync? I have about 6 video files to work with, all over an hour long, so manually adjusting timing with millisecond precision just isn't practical. I have Camtasia Studio and access to any free software for x64/32 bit windows and I'm willing to buy software to fix this as well, I just have no idea what I'm looking for to make this really work.

How can I fix gradually desynced audio in large video files?

share|improve this question
    
moderately large is 2 gigs to you? –  Cole Johnson Sep 17 '13 at 13:00
    
@ColeJohnson for a final file file to upload to youtube it's pretty big, but for a source file for editing I'll often have 5-40GB files for 30 minutes to an hour, over 100 GB with a long Fraps recording (but those get compressed/chopped up quite a bit) –  Ben Brocka Sep 17 '13 at 17:58
add comment

1 Answer

I have no idea if this is optimal for you, but one approach using free software would be to first determine the percentage (and direction) of drift by finding a point near the end where you can tell with some precision what the sync error is, in frames.

Demux the video and audio into separate streams, using a free tool like AVI-Mux. Load the audio into Audacity, and apply the time shift determined above, either as a "new length" or a ratio (frame error / total frames).

Export the audio and remux using the new track.

share|improve this answer
    
I do have audacity and I think I have some software that can rip out the audio stream. Does audacity allow you to edit the length of the audio track too? I know you can shift the whole thing forward, but what's the option to edit how it syncs up? The audio track is the right length but doesn't sync, so just shifting the start position won't fix it. –  Ben Brocka Jun 19 '13 at 12:34
1  
You can squeeze or stretch time in Audacity either as a percentage, or by simply specifying a new length for the track or selected portion. Under Effects, Change Speed / Tempo / Pitch. For a small drift just do a speed change and ignore the slight alteration in pitch. Doing a tempo change while maintaining pitch takes longer and may not sound as good. –  Jim Mack Jun 20 '13 at 18:35
    
Oh, hm. Is there any clever way to know how much of a % to tweak but or will I just have to play them side by side until it's right? –  Ben Brocka Jun 20 '13 at 20:53
    
If it's noticeably out of sync, what is it that you notice? Find a spot near the end of the clip where you can identify a lag or lead, and note the video and audio times where the matching points occur. The difference in time, divided by the total time (either as frames or as decimal seconds) gives the percentage error. Or guess -- if it's a 30.0 vs 29.97 type error, use 0.001 as the factor, either plus or minus as needed. –  Jim Mack Jun 21 '13 at 22:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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