PDA

View Full Version : vbr/cbr for audio causes sync problems on playback


stormy1777
26th December 2002, 19:08
Recently upgraded to 0.27 of GKnot, and still have the same problem, maybe I'm doing something wrong. Using different players all the AVI's that have VBR in them play OK, but the sound "drifts" from the video back and forth +/- 80ms or so, it's hardly noticable unless you pay attention. A few seconds it's going to be OK, then drift by 40ms or so then back to OK, etc...

When I open such an AVI (DL from net, or created w/0.27 Gknot) in VirtualDub I get the standard VBR warning as follows:

"VirtualDub has detected an improper VBR audio encoding in the source AVI file and will rewrite the audio header with standard CBR values during processing for better compatibility.. This may introduce up to 24 ms of skew from the video stream..."

When using Gknot in the main bitrate tab there's only vbr mp3, so I'm using that for the calculation, but in the final codec stage I use the following LAME flags:

azid: "-L -3db -c normal"
lame: "-b 128 -m j -h -q 2"

This does create 128CBR mp3 file, but for some reason when it gets appended to the final AVI it becomes VBR.. Probably because a VBR header is added to it.

My standard solution for this is to extract the mp3 stream, use LAME to convert it to CBR, then use WaveMP3 to put a WAV header on the CBR mp3 and remux it using virtual Dub to the video stream.
After doing this, on playback the lips match the video all the time, no drifting whatsoever...

When I extracted the mp3 stream of the Gknot made AVI I noticed that it is in fact CBR like I told Lame to do, so where does the VBR warning come from? I suspect that somewhere along the process GKont is forcing a VBR stream no matter what flags are passed to LAME...

GSpot on the generated file shows: mpeglayer3 128kb/s CBR 48000hz... so where does the VBR come from???


Two questions:

1. Do other people have problems with VBR playback?
2. How can I tell GKnot that I want CBR only and open the final AVI in VirtualDUB without that VBR warning?

Thanks very very much...

appreciate any input...

Stormy.

Adrian
27th December 2002, 00:02
I have an underpowered CPU (Celeron 433), so VBR playback through Windows MediaPlayer is always out of sync (and DivX Playa won't seek properly if the video has VBR audio). I therefore always use CBR audio. In Gordian Knot, I use the following LAME switches:

--alt-preset cbr 112 --resample 48 (you can drop the --resample 48 for bitrates of 128 and up)

I combine the audio and video manually in VirtualDub. Download "Wavemp3 1.2" from this site and use it to add a wave header to your mp3, so that VD can handle the audio.

stormy1777
27th December 2002, 03:28
My CPU is 800Mhz P3. Thanks for confirming my observation and solution using wavemp3. I was hoping someone with more experience using GKnot can tell us why it can't do the right thing by allowing to mux cbr audio...

thanks..