Capture: Driver types and driver selection

VirtualDub

VirtualDub help - Capture: Driver types and driver selection

In order to use a video capture hardware device, you need a capture driver to interface VirtualDub to the hardware. This software should come with your hardware device and should be installed in Windows as part of the software package that came with it. If you are missing the driver software, check the vendor's website or contact the vector for a replacement as otherwise you will not be able to use the hardware with VirtualDub.

All capture devices detected by VirtualDub are displayed at the end of the Devices menu. Selecting a driver entry causes the current capture driver to be stopped and the new capture driver to be started.

There are two types of video capture drivers in Windows, which behave differently in their capabilities. It is important to know the type of video capture driver you have installed as the distinction affects which features of VirtualDub's capture mode can be used. VirtualDub can use drivers that are written to either driver model.

Video for Windows (VFW) capture drivers

Video for Windows is the original video API for Windows, and is the older driver type of the two. These drivers can sometimes be found for versions of Windows as old as Windows 95, and it is even possible to use a capture driver written for Windows 3.1 (which is very much not recommended). These drivers have several limitations:

  • Audio capture is always done through the sound card, or a driver that makes the capture device's audio path look like a sound card.
  • VFW-model drivers expose few settings programmatically; settings such as audio control, channel selection, video standard, video image settings, etc. are only exposed through the driver's own dialogs. These are accessible through the Video display, Video format, and Video settings commands in the Video menu. Unfortunately, this means that VirtualDub cannot save or restore these settings, or control them directly.

One advantage of VFW-model drivers is that they are often mature and well-debugged, and thus reliable. Another is that VFW drivers are supported by both the VFW and DirectShow capture APIs in Windows, making them usable across a wide variety of capture applications.

VFW drivers can be found for all versions of Windows, from Windows 95 to Windows XP. However, starting with Windows 2000 more manufacturers have started shipping WDM-model drivers instead. A few video capture devices have support for both.

A VFW-model driver can be identified by the (VFW) tag after the entry in the Device menu.

Windows Driver Model (WDM) capture drivers (DirectShow-based)

The newer type of video capture driver in Windows uses the Windows Driver Model (WDM), which was introduced in Windows 98 and 2000. The Microsoft DirectShow API is the primary API to use these drivers. Because the DirectShow API supports a larger variety of commands and settings than VFW, the functionality set of a WDM driver is significantly improved:

  • WDM devices can expose integrated audio capture directly.
  • Nearly all settings exposed in UI, such as video saturation, are also exposed programmatically for unattended control.
  • If available, VirtualDub can directly control the TV tuner channel, as well as audio/video source selection.

DirectShow is a much more complex API than VFW, however, and WDM-model drivers historically have been a lot less stable than their VFW counterparts. It is not unusual to see problems such as capture applications that cannot be closed, because their program execution is stuck in the capture driver. WDM is the proscribed driver model going forward, however, so the situation should improve over time.

A WDM driver that requires use of DirectShow will have a (DirectShow) tag besides its entry in the Device menu.

The Video display, Video format, and Video settings dialogs will not normally be available when DirectShow is in use. The settings in those dialogs are usually available on the driver's Capture pin and Capture filter dialogs instead. The exception is if a Video for Windows (VFW) driver is being used through DirectShow; these drivers are indicated by (VFW > Directshow) next to their name in the Device menu. Using a driver in this manner piles the limitations of DirectShow on top of the limitations of VFW, so it is usually better to use those drivers directly with VFW instead.

The Microsoft WDM Image Capture (Win32) driver

If you have a Windows Driver Model (WDM) driver installed, you may also have an entry in the device list called Microsoft WDM Image Capture (Win32) (VFW). This entry comes from a Microsoft driver called VFWWDM32 and is a wrapper that allows WDM-model drivers to be used through the older Video for Windows (VFW) API. The WDM driver that is adapted can be selected through the Video Source driver dialog.

There are unfortunately some quirks in the way this adapter works, and some video capture devices will work erratically or not at all through this wrapper. Device settings not accessible through VFW will also still not be available when using it. If possible, use the capture device directly in DirectShow mode rather than using the VFWWDM32 driver.

Custom drivers

A few manufacturers had difficulty migrating their capture drivers from the relatively lenient Windows 95/98/ME versions to the newer, stricter versions of Windows based on the NT kernel. Instead of shipping a proper VFW or WDM driver — both of which are possible on NT/2000/XP — these manufacturers shipped a custom driver along with a custom, hardware-specific capture application. These capture devices are unfortunately not usable with VirtualDub because they use a proprietary programming interface (API).

The video emulation driver

The Video emulation capture driver is not a real capture driver installed in Windows, but rather an internal video capture minidriver in VirtualDub used for testing. It accepts a video file, selected using the Video source menu command, and plays that video, pretending to be a live video source pushing audio and video data from that file. Although primarily useful for VirtualDub program development, it is also sometimes useful for diagnosing compatibility problems and determining if problems lie in VirtualDub or in a video capture driver.

Note that additional load is placed on the hard disk and on the CPU by the video decoding, so this driver isn't necessarily useful for performance testing.