Audio delay using VFW x264, really just a B-Frame issue? I record mortal kombat game footage from my xbox, using a pci capture card using s-video and a recording program called Dscaler, in which i dump into uncompressed frames with uncompressed audio.
i load this into virtual dub, and encode using 2pass x264 according to DeathTheSheep's guide (loved that guide, thanks!).
the resulting files look great, but the audio is exactly 150 ms off, all i have to do is delay the audio track in virtual dub to 150 ms, and it synchs fine. the audio is always left uncompressed.
now, if i encode the same uncompressed file with xvid, there is no audio synch problem at all.
im guessing this is because of the B-frame settings on x264, but i have done encodings with megui and the audio delay is seemingly fine or far less noticable.
if i append multiple x264 .avi's together, and all of them are offsynch on thier own, if i simply delay the new single .avi by 150 ms, then all the audio becomes directly on synch.
i hate useing megui mainly because there is seemingly no way to append .mp4 files without re-encoding, the only program i have found so far that claims to do it is AviDemux, but when i do it, i get garbled output.
so why exactly is the VFW x264 producing a 150 ms audio delay?
is it really just a B-frame issue?
is delaying the audio the best way to handle this?
would encoding to another format like flash video, such as uploading the x264 .avi to youtube, ignore the audio synch?
i am leaving the audio uncomressed so it cant be a codec delay.
thank you very much for reading this, and thanks for this great guide and site!
DeathTheSheep- 03-07-2007
Yes, it is a B-frame issue...in part. The B-frames themselves are certainly not causing the D-sync, but it is because they are being used at all that the VfW has to append "deleted frames" (noticeable in virtualdub by tag) at the beginning of the stream so that the codec can put the B-frames in proper sequence.
The problem isn't cumulative for multiple files--VirtualDub knows to throw out frames (and their subframes) anywhere else except the beginning of the file, where the off-sync occurs.
Yes, setting an audio delay would essentially get rid of the problem, as would avoiding B-frames. Avoiding "Use as references" would also impact the amount of delay if using B-frames, as would the framerate of the video itself. Higher framerates (like 60fps) would have far less noticeable a delay than, say, a 5fps camera capture.
You could expect the frames to be observed by pratically any player. Try erasing them (hitting delete) on all D frames and frames leading up to the first real keyframe in your AVI and telling me the results of an upload to, say, YouTube. Might be interesting, if youtube decodes AVC at all :)
Die Kuh macht Muh- 04-10-2007
Does this problem occur if I save to MKV instead of AVI?
DeathTheSheep- 04-13-2007
Since it involves the same VFW framework packaged into the mkv container, I'd expect yes. However, I don't often use VdubMOD's mkv, so I'm not entirely sure. Sorry.
Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.