PDA

View Full Version : XviD B-Frame encoding produces dropped frames


AndiDog
31st August 2005, 14:16
If I encode an AVI file using xvid (not the VFW interface, but the self-compiled library v1.1), VirtualDubMod always
shows a dropped (!!!) frame after the first key frame.

This frame actually has zero length, i.e. xvid_encore(encoder->handle, XVID_ENC_ENCODE, &frame, NULL) returns zero, but why?

The bad thing is, VirtualDubMod doesn't produce this error when encoding using the VFW interface.
So it must be my source code error.

Please help. Thanks in advance!

Leak
1st September 2005, 09:47
If I encode an AVI file using xvid (not the VFW interface, but the self-compiled library v1.1), VirtualDubMod always
shows a dropped (!!!) frame after the first key frame.

This frame actually has zero length, i.e. xvid_encore(encoder->handle, XVID_ENC_ENCODE, &frame, NULL) returns zero, but why?
I'd guess that this is the NVOP that's inserted when creating a file with the "packed bitstream" option set - which is needed for certain standalone players to be able to play AVIs with B-frames correctly.

In the VfW interface, there's an option to turn it on or off - I guess the library should have an option for it as well...

stephanV
1st September 2005, 12:58
An n-vop should not show up as an AVI drop frame. Although, it is probably caused by the delay needed for encoding b-frames.

AndiDog
2nd September 2005, 09:40
My program crashes if I deactivate packed mode (debugger: "Writing to location 00000004").

Of course, if b-vops are deactivated, too, it does not crash!
Furthermore, even old versions of libxvidcore didn't help.

:angry: Thus, I know it is my fault. Do you know any open source programs that use the xvid library for encoding? I could compare it to my encoder source code.

AndiDog
10th September 2005, 19:46
The XviD VFW source code creates frames that contain the byte 0x7F - commented with "VirtualDub skip frame".

I tried to skip those frames, too, in my program, and it works. But of course, there are two or three frames missing at the end of the movie.