Processing: The pipeline

VirtualDub

VirtualDub help - Processing: The pipeline

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.

Video pipeline

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.

  • Normal 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:

Frame sequencing

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.

Read frame

Video frames are read from disk.

Decompress frame

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.

By default, any empty ("dropped") frames in the input are simply duplicated here. This behavior can be changed through the Video > Preserve empty frames option, which causes each empty frame to be copied straight to the output, regardless of the video filter chain or output codec. This can be useful if the video stream has been upsampled to a higher frame rate using empty frames.

Inverse telecine

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.

Convert to 32-bit RGB

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 Normal Recompress mode.
Run video filters

All video filters are run at this point.

Convert to output format

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.

Compress frame

If a video compression codec is selected, it is now used to compress the video frame.

Write video

The video frame is now written to disk.

Audio pipeline

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
Sequencing
Any audio edits take place here. These are basically the same in time as the video edits.
Read audio
Source audio is read from disk.
Decompress audio
Audio is decompressed using an audio codec, if necessary, producing uncompressed PCM audio. This is usually in 16-bit mono or 16-bit stereo format.
Format conversion
Precision and channel changes requested under audio conversion now take place, including switching between 8-bit and 16-bit samples, as well as mixing down to mono or cloning channels to produce stereo.
Resampling

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.

Volume adjustment

If volume adjustment is enabled, the audio is now attenuated or amplified using a linear multiplication with clamping.

Compression

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.

Write audio

The finished audio is written to disk.