Printable Version of Topic
Click here to view this topic in its original format
Unofficial VirtualDub Support Forums > Testing / Bug Reports > Strange Virtualdub Behavior


Posted by: fccHandler Mar 17 2012, 04:30 AM
To phaeron:

I just noticed something today while testing VirtualDub 1.9.11 and later versions with my input plugins. If I select a small subset range and save an AVI with both video and audio set to Direct Stream Copy, my VideoSource::Read() method receives a "frame size query" call for every frame of the movie. The actual dubbing doesn't begin until all of these calls complete.

In most cases it isn't a problem because my plugins cache the frame sizes so they can return them instantly. Unfortunately, when my Matroska, QuickTime, and FLV plugins are delivering AVC, I have to do a transform before I can return the true frame size to VirtualDub. That transform typically increases the size of the frame data.

(The transform is necessary because the way raw AVC is stored in these files is not compatible with what ffdshow-tryouts expects to receive, unfortunately.)

What happens during a "frame size query" is, I have to read in the frame data and do the transform so I can report the true size to VirtualDub. So ultimately I will be reading the entire video stream for every Direct Stream Copy operation, even if only a small portion is wanted. Ouch.

To replicate, open a large .mkv file with AVC video and select a small portion near the end. Save this as an .avi, and you will notice a pause before the dubbing starts, during which time the hard drive is thrashing. (That is me trying to calculate the size of each AVC frame of the movie.)

Why does this happen? And how difficult would it be to eliminate this step on your end? I am looking into ways to work around it on my end, but it's going to be difficult...

Posted by: phaeron Mar 24 2012, 08:42 PM
This is done in order to determine an upper size bound for interleaving prediction. It's only needed when splitting, so I can restrict it to that, but would that information be available on your side if I put in an optional query?

Posted by: fccHandler Mar 25 2012, 05:04 PM
Unfortunately no, for AVC I don't have that information. To produce it I would still have to transform every frame. It could be done during the parsing stage, but that would be especially difficult for MKV and QuickTime. I was just looking for an easy out...

I can live with it for now. Maybe I will implement a workaround on my end someday. Thanks.

Powered by Invision Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)