View Full Version : VirtualDubMod always creates gradual a/v out of sync
MDesigner
23rd December 2003, 23:55
I'm using VirtualDubMod to take an MPEG-2 movie dumped from a ReplayTV unit and convert it to DivX. The audio in the beginning is fine, but as the movie progresses, it becomes out of sync. I've tried dumping the audio to WAV and making sure it's the same length of the video. I'm not sure what else to try.
Any suggestions? I've searched the forum and haven't found much. I got the idea from another thread to extract the audio and time compress it in CoolEdit to make sure it fits the video..but it was already the proper length.
Thanks for any help..
jggimi
24th December 2003, 01:10
What format is the sound in? MP2? Are you transcoding it to another format, such as MP3? If so, is the sampling frequency changing?
MDesigner
24th December 2003, 01:20
The original audio format is simply "MPEG". I can't get any more details other than that from within VDubMod.
But even if I dump the audio to WAV, disable the original audio stream and add the WAV stream in (or even MP3), the same results occur.
No transcoding, doing a "direct stream copy" for audio. Video is being encoded to DivX.
jggimi
24th December 2003, 02:12
If it says "MPEG Audio stream (MPEG)" in the Streams list, take a look in the File....File Information window. It will probably give you the sampling frequency, bitrate, and MPEG layer. For example, it might have "48KHz 256Kbps Layer II" -- Layer II is also known as MP2.
I have been playing with a sample .mpg file with and MP2 soundtrack using VdubMod 1.5.4.1.
I have discovered that neither "Save WAV" nor "Demux" will produce a proper MP2 file. (You can test this yourself by adding a soundtrack you've just saved with either method.)
At this point I do not know if this is a bug, and if so, if it is known or not. Nor do I know if there is a feature that needs setting properly for MP2 audio. I use MPEG-2 streams with VdubMod, but via frameserving through AviSynth rather than directly, as you wish to do.
I'll keep playing with this, and try to find out if there is a solution or not. Perhaps a more knowledgable VdubMod person will have a quick answer for us in the meantime.
While you wait, should you have other tools that can properly demux the .mpg file for you (such as TMPGEnc), you can get a clean soundtrack by demuxing outside of VdubMod.
jggimi
24th December 2003, 02:23
I haven't found any discussion of the phenomenom searching through the Vdub/VdubMod forum.
If you don't have TMPGEnc, commercial software for MPEG-2, DVD2AVI (http://www.doom9.org/Soft21/Decoders/decodefix100.zip) can demux MP2 audio (as an .mpa file) when you "Save a Project." The link is for the latest "dg" version of DVD2AVI, for more versions, see Doom9's full software page.
jggimi
24th December 2003, 02:31
I found a thread that seem to say there is only limited MPEG-2 decoding and MP2 audio streams.
See Belgabor's comments in http://forum.doom9.org/showthread.php?s=&threadid=65680&highlight=mp2
I'll PM Belgabor, asking him to take a look at this thread, and to add any clarifying comments as necessary.
MDesigner
24th December 2003, 03:34
Thanks for your help.
I'm trying to encode it to DivX, which I suppose is MPEG-4.
At any rate, I tried to open the .mpg file in TMPGEnc but it won't even open it. It might be some kind of non-standard MPEG-2 format.
echooff
24th December 2003, 05:28
Load you mpeg2 file into Vdubmod and save the audio as a wav. Encode your video sererately. Then and only then compare your wav file lenght to your avi file lenght. I think you'll find there is a difference at that point. Use time stretching filter in cool edit then.
jggimi
24th December 2003, 21:27
Or, as I recommended earlier, you should be able to demux the MPEG-2 .mpg file with DVD2AVI, and end up with an .mpa file that you can transcode to MP3 for use in AVI, likely without any sync trouble.
Do let us know if either of these methods work for you.
MDesigner
24th December 2003, 21:56
Thanks, guys..I'll let you know what happens.
MDesigner
24th December 2003, 23:34
OK, both the video and audio are 1:59:57 long. I have them separated, the video being a DivX avi, and the audio as WAV (so I don't think I have to go through the whole DVD2AVI process just to end up with an MP3 file). What should I do at this point?
jggimi
25th December 2003, 01:10
Test the sync while it's still in wav format.
You can test by either playing the .avi in a player that supports the use of external soundtrack files (such as BSPlayer), or mux them together into another .avi file and test.
MDesigner
29th December 2003, 05:11
OK, I opened up VirtualDubMod and opened the .avi file, and then added the .wav stream, and set the delay to -500 ms (it's just the magic number in this case for some reason) :) The beginning is perfect.. but if I skip towards the end and play, it's out of sync.
jggimi
29th December 2003, 05:15
Then try the other methodology, that demuxes the MP2 (.mpa) soundtrack without the WAV conversion. The one you hesitate to try. DVD2AVI.
MDesigner
29th December 2003, 05:28
OK, I've got an .mpa file generated by DVD2AVI dg. Now do I open up VirtualDubMod, load the audio-less .avi file, and then add in the .mpa as an audio stream? I did this, and oddly, when I play the file, I get no sound. Should I dub this anyway, to DivX format? You mentioned encoding the .mpa to .mp3.. how would I do that? I have SoundForge 7, but very oddly, it refuses to open the .mpa file.
Any tips? Thanks again..
jggimi
29th December 2003, 05:46
As I've learned through the research I did on your behalf, it's fairly clear that MP2 is not a "legal" format for avi audio soundtracks, nor is it managed well by VdubMod. I recommend transcoding to MP3, which is a simple procedure with BeSweetGUI.
Before doing anything with the MP2 soundtrack, you might want to test it with BSPlayer or another .avi player that supports external soundtrack files, as I recommended earlier.
MDesigner
30th December 2003, 02:24
You guys are gonna kill me. :) Remember I mentioned i was grabbing these MPEG-2 files from the ReplayTV unit? I found some utilities to convert them into a more standard MPEG-2 file. I think that fixes the out of sync problem. I'll report back soon
jeremymacmull
30th December 2003, 10:25
Being that its from a replay tv unit makes me believe it is not standard mpeg but rather mpeg ts look at the DVB/HDTV/TIVO forum for how to use a program called pvastrumento or ds.jar (project x) itll convert your mpeg2 ts file to a standard mpeg 2 compliant file
and fix all sync errors if that is the case
if you are still in doubt over why this is what u need think of what replay tv is and then think of what TIVO is they do the same thing do they not ??!!!
JEREMY
MDesigner
30th December 2003, 15:27
Yeah, I already located some tools for ReplayTV that fix the MPEG-2 file. It works like a charm.. the final DivX file is perfectly in sync.
Thanks, everyone.. I appreciate the help!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.