View Full Version : Using B-frames and audiostream delay compensation
HarryM
12th October 2002, 07:40
I see, that 'packed bitstream' not work in XviD still :-(
We must use conventional positioned B-frames. Exist therefore a delay between videostream and audiostream. I use often bframes max=3 (delay -120ms for PAL movies).
How can I compensate this delay? Can I change A/V delay (and how?) for compensation?
Teegedeck
12th October 2002, 08:25
citing -h:
I can't recall how XviD stores "dead" frames in AVI files when DivX 5.x compatibility is disabled. I'd hope they're not N_VOPs (they would have to be dropped by the MPEG-4 muxer) and that they're not included in timecode calculations, but I'll have to check.
With the settings you specified though, you can be pretty certain that it's spec-compliant MPEG-4 video, just in the wrong container.
-h
DivX 5.x compatibility mode outputs an N_VOP frame with a duplicate timecode. That will mean that the muxing program will have to know that detecting duplicate timecodes means the frame to be discarded is the N_VOP. I don't know whether current tools are aware of this, or even the P+B packed AVI frame that this mode creates.
-h
So I'm afraid that XviD stores 'dead' frames as N_vOPs even in non-DX5-compatible mode?! In that case we might lack a decent muxer. I myself have tried AVIMux to no avail.
HarryM
12th October 2002, 10:09
Originally posted by Teegedeck
citing -h:
So I'm afraid that XviD stores 'dead' frames as N_vOPs even in non-DX5-compatible mode?! In that case we might lack a decent muxer. I myself have tried AVIMux to no avail.
???
Teegedeck
12th October 2002, 10:37
I meant to say: If the programs we use to mux just 'drop' the B-frames, how are we going to keep video and audio in sync? Up till now, I've read contrary reports: I think Acaila wrote that he had no sync problems with an AC3-stream using Nandub - I on the other hand just couldn't sync a VBR MP3 with either Nandub or AVIMux.
Anyone with positive reports here?
Koepi
12th October 2002, 10:43
Yupp, XviD bframes (max=5) muxed into OGM woith 2 soundtracks resultet in a perfectly sync movie.
Ok, there were some small sync issues when the codec decided to produce an IPPPPI sequence instead inserting bframes, but it wasn't really bad.
Regards,
Koepi
Teegedeck
12th October 2002, 11:09
I guess I finally must switch to the OGG-format, then...
Acaila
12th October 2002, 11:24
What?? There are still people who are NOT using the Ogg format?? :D
serbersan
24th October 2002, 12:36
Originally posted by Koepi
Yupp, XviD bframes (max=5) muxed into OGM woith 2 soundtracks resultet in a perfectly sync movie.
Ok, there were some small sync issues when the codec decided to produce an IPPPPI sequence instead inserting bframes, but it wasn't really bad.
Regards,
Koepi
Is this a little problem that could be solved quickly or it can't be resolved until there is a tool that allows to produce a direct output to mp4 or ogg or other format instead avi whe you encode????
If is the last option it means we can use a maximum bigger than 2 bframes until this will be solved?
Thanks, Sergio.
OntzA
25th October 2002, 18:29
There's a tool that allows you to output directly to an ogm file: VirtualDubAVS&OGM
You can download it from: http://cyrius.bunkus.org/
Manao
31st October 2002, 01:48
So what about audio delay in ogm. You seem to say there is no delay due to bframe when using max bframe = 2, but in the last encodes I made, the sound seemed to play 80 ms before the video. Or, at least, when I delay audio by 80 ms, the sync seems more 'natural' ( I don't know if it's me or not, I should make a blind test on somebody else ).
If there is actually a delay, must I correct it by delaying audio, or wait for a new version of ffdshow or Xvid DSF that automatically adjust the video ? ( like DivX5 DSF, if I read well on the DivX5 forum )
Is the problem due to ogg DSF ? Or is it due to the DX50-BVOP compatibility ?
spyder
31st October 2002, 21:41
Originally posted by Acaila
What?? There are still people who are NOT using the Ogg format?? :D
I don't use the Ogg format. I use...well, it's still early alpha. :)
MaTTeR
31st October 2002, 21:45
Originally posted by spyder
I don't use the Ogg format. I use...well, it's still early alpha. :)
Well I have a feeling most of us might jump from Ogg as soon as MCF is out of early alpha;)
spyder
31st October 2002, 21:48
MCF is moving rapidly in the past few days my friend. And I must say, this is a marvelous song I have playing right now. :D
neo_sapien
13th November 2002, 23:21
XviD w/ max bframes at 5 and 1 ogg soundtrack results in a desync movie on my end. Setting the delay to 80ms usually solves it. max bframes at 4 also results in a desync movie, and you need a different delay setting; 80ms doesn't sound as "natural" at max bframes 4.
I "only" use the Ogg container in my muxed files, so it's not a matter of a problem that's immediately eliminated by muxing into Ogg.
vinetu
14th November 2002, 00:12
To find the delay needed I just mux the already encoded with B-frames(4 frames at 200%) xvid video
(koepi's 09112002 build) with the AC3 audio using VirtualDubMod v1.4.11 until is OK...
in my case that was 400ms audio delay (Audio->Interleaving).
The audio delay in VOB files was 204ms(reported) so BONUS delay is ~200ms!
Not All the movie - first 10-15 min is enough to find the right values and this take
about a 1 minute per mux ...
You should do Video-direct stream - Audio-direct stream and NOTHING will go wrong with decoded or not
decoded B-Frames (may be it's time for C-frames :) no?)!
I'm an OGM fan,however the file I'm working with is an .avi file ...and it WORK!
Gazza
14th November 2002, 03:04
I am a big fan of ogg & ogm and use it all the time. I use dvd2avi to get the ac3 file. The title of the ac3 files includes the delay information which I use to produce the ogg file with the delay already compensated (oggmachine does this automatically). Oggmux mux's the video & audio with no delay (as the ogg already is delayed).
In playback the video and audio are very much in synch. I have to say that there are playback issues recently (I believe xvid.ax needs an update soon) which causes the video/audio to be out of synch. But I don't think this is because I have encoded it wrong. I don't see how you can be so out of synch unless you didn't process all the vobs together. Taking a single or subset group of vobs will impact on the delays you see.
Note, you can change the delay field in oggmachine to produce other delays if you so wish but this takes lots of time in experimentation.
ChristianHJW
14th November 2002, 10:54
It seems that finally the whole video encoding community is starting to realize that AVI cant be used any longer, especially for modern MPEG4 codecs like XviD.
Interesting that both upcoming alternatives to AVI, OGM and MCF, were started because of audio limitations with the ACM codec interface API ( only CBR is handled correctly ) first, mainly to be able to use Vorbis, but now its getting more and more obvious that next generation's video codecs cant be used porperly through a VfW interface, unless we all accept a lot of bad hacks resulting in questionable future compatibility.
I am looking forward to the time when we will have a modded Vdub being capable of calling audio and video codecs through UCI ( http://uci.sf.net ), using either OGM or MCF as container.
Nic
14th November 2002, 11:01
I think we all know mcf exists chris et al...you dont have to keep reminding us ;) :D
Take care mate,
-Nic
ChristianHJW
14th November 2002, 11:18
Originally posted by Nic
I think we all know mcf exists chris et al...you dont have to keep reminding us ;) :D
Take care mate,
-Nic
:P ... actually i dont really advertise MCF right now ( we silently progress ), but UCI :D !
You've been to UCI homepage already ? What do you think about it ? Unfortunately the existing libuci is only for Linux right now, i hope we find a good win32 developer with a basic understanding of Linux, so that we can port the existing code.
Alex is about to fix some parts of the UCI API until end of this year, so all you genius XviD developers have to hurry to give some input to it ( GomGom and suxendrol did already BTW ). Dont complain afterwards nobody told you about it if something important is missing or hard to use on Windows ;) ...
kilg0r3
19th November 2002, 08:57
@vinetu
how do you determine the proper value for the delay? i never can hear any sound when playing a movie in vDub 1.4.11. so how dop i check the delay before muxing? btw wasn't there a player which could load external soundtracks and assign a delay value to it?
AND will the resynched movies be in synch later on when the decoders can handle the problem themselves.
AND isn't there a way to calculate the additional delay?
...
duartix
31st January 2003, 17:37
My calculations worked like this:
Black Adder - Series 1 - Episode 1 - PAL 25fps.
XVID max bframes = 3
comments between []
1/25[fps]*3[max bframes in XVID]*1000(milisseconds) = Delay
Since I was using bframes=3 I used 120 ms audio delay.
This both in AVI as in OGM.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.