Table of Contents

Queue

Overview

The objective of ffdshow's Queue feature is to reduce frame drops and delay of video. It is effective if CPU load is high and ffdshow is dropping a few frames/sec or delaying a little. Because the video renderer is executed in another thread, the effect is greater if you have a Pentium 4 HT or a dual core CPU. It is confirmed to work with Media Player Classic's VMR7 and VMR9 mode (both including renderless mode). As this is an advanced option, it may require some testing and configuring.

Settings

Queue output samples

This option enables ffdshow's Queue feature. Disabling it though doesn't affect the other options that are available further below.

Use queue only in

Queue is disabled by default because of stability problems using other video applications than Media Player Classic. If you want to try it with another application, uncheck or add the name of the main executable. Make sure to separate each entry with a semicolon.

Enable queue in VMR9-YV12

This option enables the Queue feature when using the VMR9 video renderer and YV12 colorspace. Please note: With some Intel onboard video chips, Queue does not work in VMR9-YV12 mode.

Additional information

When is the Queue feature likely to be effective?

When will the Queue have no effect?

How does the Queue feature actually work?

ffdshow gets samples from the upper stream filter (usually the splitter), processes and writes them to the buffer that it got allocated by the downstream filter.
If Queue is disabled, the video renderer has only one buffer. Even if ffdshow has finished the work early, it has to wait because the buffer is occupied until the video renderer displays the current frame at the time specified by its time stamp. The CPU wastes time without doing anything during this period. And this is where the Queue feature kicks in:
If Queue is enabled, the downstream filter has multiple buffers. After ffdshow finishes the work, it gets a buffer allocated immediately, writes to it and puts it into the queue. Then ffdshow begins to process the very next frame without waiting and wasting precious CPU cycles. This way ffdshow can get out of a pinch by sending buffers into the queue if it has received several heavy frames.
An example should make things more clear:
In a 30fps movie, every frame must be processed within 33ms. Assuming the time required to process 10 consecutive frames is 20, 20, 20, 20, 20, 20, 50, 50, 50, and 50ms respectively. The first 6 frames are displayed without problems. The total processing time is (20ms + 13ms) * 6 = 198ms. With Queue disabled, ffdshow spends 13ms (33ms - 20ms) after each of the first 6 frames doing nothing. When the 7th frame finally arrives, chances are it will be delayed or even dropped.
With Queue enabled on the other hand, ffdshow processes the first 6 frames in 20ms * 6 = 120ms and can begin working immediately on the following, more intensive frames. This way ffdshow can deliver all the frames in time. Inside the actual implementation, a thread is needed to dispatch buffers in the queue to the video renderer. This thread is implemented inside ffdshow for VMR7 and inside the video renderer for VMR9. The main body of the video renderer is executed inside that thread, which is different from ffdshow's main thread.

How do I know if Queue is really working?

Since it is difficult to measure the effect empirically, it is best to believe your eyes and ears. Watch out for frame drops and/or delay.
If you are not certain enough, it may help to enable both OSD items “Queued samples” and “Video delay”. However, don't forget the OSD itself consumes a few CPU cycles.
Queue is not designed to use multiple cores equally. You won't see CPU graphs inside your performance monitoring tool balancing each other.
Benchmarking the Queue feature with timeCodec.exe is futile because it skips the waiting time that is described above.

Registry settings (for advanced users)

The number of buffers can be changed inside the registry with the queueCount key. It is located at:

HKEY_CURRENT_USER\Software\GNU\ffdshow\default

If you are using presets, then replace default with the preset name. The default value is 10. By increasing the number, the “Queue effect” is increased. If your video playback suffers from sporadic frame drops and/or delays, then 10 is a good value to begin with, but if you want to cover a whole high-bitrate scene, 50 is required. As it uses video memory, a too large value can make the video card unstable. For a video card with 256MB memory, 50 would be the maximum, if you want to play full HD videos.

Compatibility issues

Depending on the video card, the video driver and the application settings, Queue may cause problems. Compatibility issues have been reported with some video cards from ATI's X1300 and X1600 series. There are no known issues with Nvidia video cards. If problems with the Queue feature appear, disable it. Working around individual issues is too difficult.