PDA

View Full Version : where does it keep coming from?


RedDwarf1
26th July 2007, 08:09
I have been trying to do a fast recompress of a XVid using a small range as a test. I expected VirtualDub and VirtualDubMod (I have tried both versions of the latest stable) to make a new XVid and start at the selection start and end at the selection end.

But.........I get frame 3 (the fourth frame) first and then the selection first frame and all remaining frames, repeating frame 3 twice. I have tried this with both versions Dub & Mod and done it a number of times with the same result.

Does anyone know why it is doing this? Is it a bug? I think frame 3 is a keyframe, but I was expecting the re-encode to make it's own keyframe at the start (which is one important reason for the re-encode as I intend joining videos). This is really messing it up as it will not play smoothly.

I have tried the same with AviDemux and that gives a different result but still not correct. It encodes frame 0, 1 & 2 as identical frames and then plays correctly.

foxyshadis
26th July 2007, 10:09
It's called b-frame delay, and it's caused by the inability of VFW to handle b-frames properly. You can use mpeg4modifier to pack the bitstream, but that doesn't work in all cases. In general, if you're ever going to edit an mpeg stream, you should never use b-frames until you have an editor that can properly handle them. (Vegas apparently can, but I have yet to verify personally.) If you have no choice, convert to a lossless or near-lossless format that doesn't include out-of-order frames.

RedDwarf1
26th July 2007, 23:35
Thanks, Mpeg4Modifier has done what I needed. The cut section now begins at the previous Keyframe like I was expecting.

I did not encode the file so there was not much I could of done about it. By B frames, you do mean B-VOP's right? I have found where to disable B-VOP's in the XVid Profile options. I will have to look at it a bit more as I don't really know what they are for and what benefit they are, so I know what disabling them will mean if I ever need to.

LoRd_MuldeR
27th July 2007, 00:31
I-Frames store the complete Image (just like JPEG). P-Frames only store the difference to the previous Reference-Frame (much smaller than I-Frames). And B-Frames only store the difference to the previous and the following Reference-Frame frame (even smaller than P-Fames). So B-Frames allow a more efficient compression. Usually you will get a better quality with B-Frames enabled (assuming you want to compress to a certain filesize).

RedDwarf1
29th July 2007, 06:07
Ah, thanks for explaining that ;)