Log in

View Full Version : after demux FLV Video and Audio length doesn't match


may24
24th July 2008, 11:08
Hi everyone,

I got the following problem:

I got this flv movie (VP6) which I'd like to reencode to XVID.
So I got the latest FFDShow tryout + FLV Extract and demuxed the video.
After that I wrote a small avs scrip and opend it in VirtualDubMod.

The total display time of the Video (29,325 fps): 8:11.858 sec.
The total running time of the Audio (cbr 128): 7:59.424 sec.

There is a mismatch of nearly 12 sec !
According to Moitah there can be "an incorrect duration in your audio player. This is because FLV Extract doesn't generate a VBR header". But the mp3 Audio track is CBR.

However, I tried to write a new VBR header using foobar 2k (as suggested by Moita), but without any effect.

If you playback the original Video it's absolutely in sync. I tried FLV Player as well as MPC.
So I changed the FPS to match the running time of the audio track. But the result was that in many scenes the audio and video doesn't match and it's getting more and more worse the longer you watch it.

The next approarch was more successfull. Using Goldwave I stretched the Audio track to the playing time of the Video - remuxed it and everything was fine.

The donwside of this method is:
a) you'll need to convert the audio from mp3 -> wav -> time stretch -> wav -> mp3.
b) due to the timestreching algorithm you significantly loose quality (using FFT + Oscilator Synthesis) or suffer a pitch shift.

But the Video/Audio was perfectly in sync before. Plus I still have the timecodes from FLV extract.

Is there a way to use these codes to resync mp3 to Video again ?
What causes the (huge) difference in the length of the streams ?
Is there another sollution ?

may24
24th July 2008, 12:25
I encoded the vid with x264 now, and multiplexed it with the original mp3 file plus the time codes derived from FLV extract.
But the following error occured:

Warning: 'D:\Video\work\0513.mp3' track 0: The number of external timecodes 13714 is smaller than the number of frames in this track.
The remaining frames of this track might not be timestamped the way you intended them to be. mkvmerge might even crash.

may24
24th July 2008, 13:51
I played back the previously baked video, but as expected it's completely outa sync

shae
7th August 2008, 01:22
29.325fps? Isn't that wrong?

mediator
9th August 2008, 06:31
I think the problem is probably that the file in question has some jitter/drift in the video/audio timestamps. When watching it from the FLV file it looks fine since the FLV player or DirectShow take care that the timestamps get respected, but one the elementary streams are alone, the timing info is lost. Probably there is no way to have it correct without the timing information from the FLV.

mgh
9th August 2008, 07:08
try remuxing to avi with avidemux first (just load into avidemux, save at default settings-which is video and audio copy, format avi) and load avi in virtualdubmod with avisource