julesh
11th April 2007, 14:13
I'm looking for a reiliable way of demuxing an AVI file's audio stream(s) that maintains sync in any condition that a standard player would do so. As an example, I have an AVI file that plays perfectly in Media Player Classic, but if I demux it using classic approaches it fails. The AVI is 21m30s long. I've tried the following approaches to demuxing it:
* VirtualDubMod, which produces a 21m30s mp3 file which is missing the last 3 seconds of audio. I'm not sure what is filling the remaining space; it may be stretched or it may have a number of short gaps filling it in.
* AVIDemux, which produces a 21m27s mp3 file with the same content missing.
I've also tried converting the video to MPEG-2 using Mainconcept MPEG Encoder, which produces an output that drifts out of sync, apparently using the same soundtrack output that VirtualDubMod produced.
In case it's relevant, this AVI has an odd frame rate: 30.036fps. The source was NTSC VHS tape, so it *should* be 29.97; I'm not sure what happened to it to cause the oddness.
I also have other AVIs that are demuxed correctly by VirtualDubMod, but for which Mainconcept produces an out-of-sync result. For these, I could demux using existing code if necessary.
BTW: the project I'm working on is a front end for mainconcept's encoder to automate setting up the size, display and framerate parameters for converting AVI to DVD-compatible MPEGs, automatically keeping the aspect ratio from the AVI, choosing the best output aspect ratio, frame size and frame rate to encode at. I've decided to automatically demux the audio because of the cases where mainconcept drifts out of sync when I don't. But if somebody knows of a better solution, I'd love to hear it...!
* VirtualDubMod, which produces a 21m30s mp3 file which is missing the last 3 seconds of audio. I'm not sure what is filling the remaining space; it may be stretched or it may have a number of short gaps filling it in.
* AVIDemux, which produces a 21m27s mp3 file with the same content missing.
I've also tried converting the video to MPEG-2 using Mainconcept MPEG Encoder, which produces an output that drifts out of sync, apparently using the same soundtrack output that VirtualDubMod produced.
In case it's relevant, this AVI has an odd frame rate: 30.036fps. The source was NTSC VHS tape, so it *should* be 29.97; I'm not sure what happened to it to cause the oddness.
I also have other AVIs that are demuxed correctly by VirtualDubMod, but for which Mainconcept produces an out-of-sync result. For these, I could demux using existing code if necessary.
BTW: the project I'm working on is a front end for mainconcept's encoder to automate setting up the size, display and framerate parameters for converting AVI to DVD-compatible MPEGs, automatically keeping the aspect ratio from the AVI, choosing the best output aspect ratio, frame size and frame rate to encode at. I've decided to automatically demux the audio because of the cases where mainconcept drifts out of sync when I don't. But if somebody knows of a better solution, I'd love to hear it...!