Quantcast KVCD: Audio Drift? Begone! - digitalFAQ.com Forums [Archives]
Go Back    digitalFAQ.com Forums [Archives] > Video Production Forums > Video Encoding and Conversion

Reply
 
LinkBack Thread Tools
  #1  
07-04-2002, 03:42 PM
Daagar Daagar is offline
Free Member
 
Join Date: May 2002
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
After way too much time wasted trying to get this to work, the magical solution has finally been found (I hope...try it!). Read on.

Source video was a DivX .AVI movie. It was scanned in VirtualDub for bad frames and for correct a/v sync. The movie was fine - no bad frames, perfect a/v sync. However, each conversion (to VCD in my case) failed to preserve the correct sync! It would slowly drift out until near the end of the movie it was a full half-second out of sync (annoying enough to notice). After reading tons of posts and begging for solutions myself, I combined all the various info and _fixed_ the problem for good!

Step-by-step guide:

1. Scan the .avi for bad frames and correct a/v sync in vdub first. If it is wrong to begin with, this method probably won't help.

2. Extract the audio from the video in VirtualDub. You may be able to go to .WAV directly, but if the audio is AC3 format, you will need to take additional steps to get an uncompressed .WAV file. Use the guides here on vcdhelp or doom9.org. Get an uncompressed .WAV by whatever means necessary. You can downsample to 44.1KHz at this point, or let TMPGEnc do it (via SSRC) in a later step.

3. Load the .avi in VirutalDub. Select Audio->WAV Audio and load the uncompressed .WAV file you created in step 2. Ensure that Audio->Direct Stream Copy is selected.

4. Ensure Video->Direct Stream Copy is enabled. Select Video->Frame Rate and select the option "Change so video and audio durations match".

5. Select File->Save as AVI... You will end up with a very large .avi file (the original video and the uncompressed .WAV file interleaved together _with matching durations_). NOTE: If you play this .avi, you will probably notice that a/v has gone _out_ of sync! Don't panic.

6. Load up this .AVI in TMPGEnc. (You can also prepare a AVISynth script if you need to do resizing and/or TemporalSmoothing.. if you do this, load the .avs script in the 'video' box, and load the AVI created in step 5 for the audio).

7. Set your parameters in TMPGEnc as you prefer. Explaining TMPGEnc options is beyond the scope of this mini-guide.

8. While setting your TMPGEnc paramters, you MUST turn on the "Do not frame rate conversion [sic]" option in the Advanced tab. Ever wonder what this option was for? Notice how many TMPGEnc guides say "Gee, we have no idea why this is here so ignore it and never use it" . THIS is what it is for! In step 6, you created an avi that might not be perfect 23.976 or 29.976 FPS. TMPGEnc sees this and tries to correct for it - causing audio drift even though you supposedly lined things up in VDub.

9. Encode away. The result should be a perfectly aligned a/v MPG. Finally!

Caveat: This process hinges on the fact that we are no longer dealing with perfect frame rates. I've been lucky, and this hasn't seemed to affect playback on my standalone player. This may, however, be out of spec, and some standalone players may not be able to cope.

Caveat #2: In TMPGEnc, I use SSRC for sample rate conversion, and tooLAME for conversion from .wav to .mp2 (Via "External Tools" in TMPGEnc). This is the preferred way to handle audio in TMPGEnc, and I'm not sure if using TMPGEnc internal downsampling and conversion routines would guarantee the same results.

NOTE: It _may_ be possible to do steps 1 and 2, then jump clear to 6 and achieve the same results. I haven't tested this yet, but will eventually. I'll try to remember and update this post with my results. It would save a bit of disc space and time by not having to monkey around with restreaming the avi file. I do know that performing steps 1-7 and 9 (skipping step 8) will not work.

Good luck, and I hope this clears up sync issues for everyone. It is an amazingly common topic, and hopefully this serves as an answer.
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
07-04-2002, 04:18 PM
kwag kwag is offline
Free Member
 
Join Date: Apr 2002
Location: Puerto Rico, USA
Posts: 13,537
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the article Daagar.
Great info!

kwag
Reply With Quote
  #3  
07-05-2002, 04:19 PM
Daagar Daagar is offline
Free Member
 
Join Date: May 2002
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Well, it figures. After all the work monkeying around with additional .avi files and such, guess what? You _can_ cut out all those extra steps and achieve perfect sync. So, modify my above guide as follows:

Turn on 'Do not framerate convertion' in TMPGEnc. End of story I still process the audio file to a separate .wav first, but there is no need to 'restream' the .avi together in VDub, it seems.

UPDATE: While this shorter method seemed to be fine in WinDVD, the results didn't translate as well to the standalong player. While _FAR_ better than before, there was still an ever-so-slight desync. It appears that the longer method outlined originally is 'better'. It may be source dependant, or even hardware dependant. So... experiment, but it appears you want to do the longer method to ensure accuracy.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Audio Codecs: LSAMP (leon's simple audio mastering program) jorel Audio Conversion 0 11-18-2003 11:10 PM
no audio decompressor could be found to decompress the source audio format? royalewitcheez Video Encoding and Conversion 15 10-29-2003 09:31 PM
Audio Codecs: Audacity - cool and free audio editor jorel Audio Conversion 0 10-23-2003 12:19 AM
Audio Codecs: Befa - Time signal removal Band Eliminate Filter for Audio jorel Audio Conversion 0 07-24-2003 06:53 PM
KVCD Audio Issues - audio is out of sync? Jellygoose Video Encoding and Conversion 7 05-26-2003 05:59 PM




 
All times are GMT -5. The time now is 05:31 PM  —  vBulletin © Jelsoft Enterprises Ltd