VirtualDub's processing of audio and video during a render-to-disk operation is split into several pipeline stages. Some of these stages are enabled or disabled depending on the current audio/video mode selected.
The video pipeline can be run in one of four different modes:
Direct stream copy: In this mode, video frames are copied directly from input to output. No recompression takes place, and thus no quality loss can occur. This is the fastest possible mode for editing video in VirtualDub.
Because the video is not recompressed, video compression imposes restrictions on how the video can be edited.
Fast recompress: Video is decompressed and then recompressed using the desired output codec. VirtualDub automatically chooses a intermediate video format to use between the codecs for quality and speed.
An output video codec must be chosen in this mode.
Slow recompress: Video is decompressed and then recompressed using the desired output codec. This is similar to Fast Recompress except that the input and output formats can be chosen in the Video color depth dialog, and the two can be different, requiring a conversion in between.
If no output video codec is chosen, the video is written to disk uncompressed in the output format.
Full processing mode: All pipeline stages and features are enabled.
Here's what the video pipeline looks like:
Direct Recompress Full Frame sequencing Read frame Decompress frame Inverse telecine Convert to 32-bit RGB Run video filters Convert to target format Compress frame Write video
Here's what the various stages do:
Video frames are selected from sources and ordered. This is where any edits done to the timeline take place, along with the frame rate options, including rate adjustment, conversion, and decimation.
If Direct mode is selected, there are some restrictions as to how frames can be inserted or dropped. Any edits to the timeline that violate these restrictions are adjusted here to comply.
Video frames are read from disk.
Compressed video frames are run through a video codec to produce uncompressed video frames. The format is selected in the Video color depth dialog.
In Fast Recompress mode, the format is automatically selected based on compatibility between the input and output video codecs.
If inverse telecine (3:2 pulldown removal) is enabled in Video frame rate control, fields are reordered and the video stream frame rate is reduced by 25% at this point.
Video filters in VirtualDub currently only run in 32-bit RGB, so the video frames are converted to 32-bit RGB at this point.
Note | In previous versions of VirtualDub, enabling full processing mode would always force a conversion to 32-bit RGB. This is no longer the case — if no video filters are used, this conversion step is omitted and the video is directly converted to the output format as in Slow Recompress mode. |
All video filters are run at this point.
The video frames are converted from their current format to the output format specified in the Video color depth dialog. If the formats are the same, no conversion takes place.
Conversions between YCbCr formats are done directly in YCbCr space without an RGB intermediate step. Chroma is subsampled or supersampled as necessary using bilinear filtering.
If a video compression codec is selected, it is now used to compress the video frame.
The video frame is now written to disk.
The audio pipeline has three modes: Direct, Full without audio filters, and Full with audio filters. Enabling audio filters replaces other types of audio processing in the pipeline, thus the parallel path.
Direct Full Sequencing Read audio Decompress audio Format conversion Filter graph Resampling Volume adjustment Compression Write audio
Changes in sampling rate requested in the audio conversion dialog now take place. If high quality mode is off, point sampling is used, otherwise linear interpolation is used.
If higher quality resampling is required, the resample audio filter should be used instead, which uses a multi-tap windowed sinc filter.
If volume adjustment is enabled, the audio is now attenuated or amplified using a linear multiplication with clamping.
The audio is now recompressed using the selected output audio codec. If no audio codec is selected, the audio is simply written out using its current format.
The finished audio is written to disk.