Latest Movie Trailers


  • Mayhem - Clip: Derek Cho (Steven Yeun) is having a really bad day. After being unjustly fired from his job, he disc (...)

  • Game Night - Trailer: Bateman and McAdams star as Max and Annie, whose weekly couples game night gets kicked up a notch wh (...)

Updated 02/01/2013Home » Guides » Video Edition with VirtualDub

Video Edition with VirtualDub

This guide explains the most common AVI video edition and conversion tasks with VirtualDub and VirtualDubMod.

VirtualDub Controls Reference

Make sure to familiarize yourself with the VirtualDub control buttons in order to use this program easily.

vdplay.gif Playback control, used for playback of the original input file or the processed video.
vdmove.gif Start / End, used to move the slider to the first or last frame of the video.
vdffrw.gif Backward / Forward, used to rewind or advance by one frame.
vdkey.gif
Previous / Next keyframe, skips to the previous or next key frame.
vdscd.gif
Scene Backward / Forward, moves the slider to the previous or next scene change of the video.
vdsel.gif
Selection Start / End, used to select a specific portion of the video so you will be able to work with it.
vdfrm.gif
Current position, shows the time and frames position where the slider is.
vdslid.gif Slider, indicates the current position in the video. To seek faster, hold down SHIFT while moving it to snap to keyframes.

Things to keep in sight

Incomplete video files: VirtualDub can fix the index of an incomplete or corrupted video file. To do this, in the Open Video File dialog, check Popup extended open options and in the next dialog that appears, check Re-derive key frame flags. This process can take long time with large videos.

File extensions: all DivX / XviD videos are Audio-Video Interleaving files and the AVI extension is used for them. The DIVX extension is not used because it's unknown for most players.

Regarding Audio menu in VirtualDubMod; OGM and MKV Files

Since the Matroska Video (MKV) and Ogg Media (OGM) files are container formats, they are only supported by VirtualDubMod and not by VirtualDub.

This is why VirtualDubMod differs from VirtualDub in certain aspects, like the absence of the Audio menu. The audio streams from an OGM/MKV file are managed independently, and they are accessed from the Streams > Stream List menu. In this window you will see the video streams, followed by the audio streams, and last, the optional subtitle files. To access the Audio menu, right-click on the target audio stream from the list. This streams system allows you to edit each stream separately, and add or remove streams as well.

To open these OGM and MKV formats in most players, you should install the DivX Total Pack, which adds support for the most popular formats.

Solving the VBR Audio Issue

When opening media files in VirtualDub you eventually may find this warning:


This message appears when opening video files with variable bitrate (VBR) audio streams. The AVI file format specification does not support VBR audio streams natively, therefore, despite of being able to playback such files properly, the big problem arises when trying to edit these files.

To properly edit such files without problems you must convert the audio stream into a constant bitrate (CBR) format such as MP3.

Common Video Edition Tasks

1. Split a video file in several parts

After opening the movie in VirtualDub, in both Audio and Video menus select Direct Stream Copy. Press the End button. At the Current position field below you will see the total frames number. Divide this number by the total number of segments desired.

Move the slider to the beginning of the video, and mark the selection start. Position the slider in the end of the first segment (this is, the number of frames per segment) and advance to next key frame to avoid problems. Now use the set selection end button.

Now that you have selected the first segment, go to File > Save segmented AVI and save it with name like "Part 1" for example.

Repeat the above process of moving the slider and marking the start and end positions to save the rest of the rest of the video segments in separate AVI files.

2. Join 2 or more video files

Open the first part of the movie. Select Append AVI Segment from the file menu. Make sure to have selected Direct stream copy under both Video and Audio menus. You can only append files with the same video format, frame rate, resolution, audio format and quality.

Go to the File menu and select Save as AVI to save the entire file.

3. Cut / delete a specific portion of a video

Open the movie and move the slider to the beginning of the portion to delete. Snap to the next key frame by pressing the set next keyframe button. Mark the selection start. Advance to the end of the portion desired, and again snap to next or previous key frame. Mark the selection end and select Delete selection from the Edit menu. Make sure you have selected Direct stream copy under both Audio and Video menus.

Go to File > Save as AVI to save the resulting file.

4. Change the file size of a video / video bitrate / keyframe interval

You can re-encode the video and audio of a file to make it match a specific file size, and change the video quality, keyframe interval, audio format and bitrate, and even fix the file if it has corrupted frames or similar problems. To calculate the video bitrate for compressing the video, use DivXLand Bitrate Calculator. Open it and under Movie Length enter the exact length of the movie. Under the Desired File Size section, enter the destination file size, and at Desired Audio Bitrate, select the audio bitrate you want. Take note of the calculated video bitrate.

Open the movie in VirtualDub and at both Video and Audio menus be sure to select Full Processing Mode. Find out the audio sampling rate of the movie at the File Information dialog under the File menu (for example, 44100 Hz). At Audio > Compression click any working MPEG Layer 3 codec. At the right field, pick a mode that matches your audio bitrate (the one used to calculate video bitrate in DivXLand Bitrate Calculator) and sampling rate.

Finally go to Video > Compression and select the desired video codec. Configure. Accept all and go to File > Save as AVI to begin the conversion process.

5. Convert any AVI video to DivX or XviD format

To convert a certain format AVI video file into the DivX or XviD format you have three options:
  1. Recompress only the video stream, ignoring the output file size:  If you don't consider the audio bitrate when you reencode the video, your output file size will be unpredictable.
  2. Recompress only the video stream, considering the output file size: This way you will have to find out the current audio bitrate of the file in order to make the converted movie match a specific size.
  3. Recompress both video and audio streams: This mode you can make the output video match a specific file size, and it is the more secure and reliable. Recommended.
  • Option 1:
Open the movie in VirtualDub. At the Video menu select Full processing mode, and at the Audio menu select Direct stream copy. Go to Video > Compression and select the desired video codec. Configure. Under File menu click Save as AVI.
  • Option 2:
Open the movie in VDub. At the Video menu select Full processing mode and under Audio select Direct stream copy. Find out the current audio bitrate and sampling rate. Now, when you go to calculate the video bitrate with DivXLand Bitrate Calculator, use the current audio bitrate of the movie. Go to Video > Compression and select the desired video codec.

Save the file by selecting File > Save as AVI.
  • Option 3:
Open the movie in VirtualDub. At both Video and Audio menus select Full processing mode. Go to Video > Compression and select the desired video codec. Configure. Find out the audio sampling rate of the movie at the File Information dialog under the File menu (for example, 44100 Hz). At Audio > Compression click the MPEG Layer 3 codec. At the right field, pick a mode that matches your audio bitrate (the one used to calculate video bitrate in DivXLand Bitrate Calculator) and sampling rate.

Save the file by selecting File > Save as AVI. If you get an error when trying to save the file, you may have to select a different audio sampling rate (for example 44100 Hz) at the Audio Compression dialog.

6. Convert the audio format to MP3

Open the movie in VirtualDub. At the Video menu select Direct stream copy, and at the Audio menu select Full processing mode. Find out the audio sampling rate of the movie at the File Information dialog under the File menu (for example, 44100 Hz). At Audio > Compression select the MPEG Layer 3 codec. At the right field, chose the desired audio bitrate and mode, matching the sampling rate from the original audio stream (44 Khz or whatever). Recommended audio quality values for small file sizes are between 96 and 128 Kbps.

Save the file by selecting File > Save as AVI. If you get an error when trying to save the file, you probably have to select a different audio sampling rate (for example 44100 Hz) at the Audio Compression dialog, or an invalid audio codec or setting.

7. Enlarge / shrink the video size

Open the movie in VirtualDub, and at the Video menu select Full processing mode, and at the Audio menu select Direct stream copy. Go to Video > Compression and select the desired video codec. Configure. Now go to Video > Filters and click the Add... button. Double click the Resize filter and configure it with a new resolution. Note: The DivX codec requires a width number multiplier of 4, and a height multiple of 2. The recommended mode to have a good quality is Bicubic, but you can check out the Preview window to see the result of each mode instantly.

If you are enlarging the video, you may also want to add the Sharpen filter with a value of 20~30 to avoid excessive smoothing.

Go to the File menu and select Save as AVI to save the converted file.

8. Change the audio volume

To increase or decrease the volume level, when the file is opened in VirtualDub go to Audio and select Full processing mode, and under Video select Direct stream copy. Now select Volume from the Audio menu and increase it at least 300%. If the audio volume is very low, change it to 600-700%. Find out the sampling rate at the File Information dialog under the File menu. Select Compression from the Audio menu, and select  the MPEG Layer 3 codec. Make sure to match the sampling rate (e.g. 44100 Hz) and don't use a bitrate lower than 64 kbps.

Accept all and go to File > Save as AVI and wait a couple of minutes while the audio is recompressed, depending on the length of the video.

9. Move the entire audio stream to play earlier / later

Open the movie in VDub. At the Video menu select Direct stream copy, and at the Audio menu select Full processing mode. Find out the audio sampling rate of the movie at the File Information dialog under the File menu (for example, 44100 Hz). At Audio > Compression click the MPEG Layer 3 codec. At the right field, pick a mode that matches the current audio sampling rate of the file. Now go to Audio > Interleaving.  At the Audio Skew Correction field enter the amount of milliseconds you want to move the sound (1000 ms = 1 sec). Negative values will play the audio earlier, and positive ones will make the audio play later. You can preview the result pressing the Preview Output button (button 1C).

Save the file by selecting File > Save as AVI. If you get an error when trying to save the file, you may have to select a different audio sampling rate (for example 44100 Hz) at the Audio Compression dialog.

10. Replace the audio stream with a WAV file

After opening the movie in VirtualDub, in both Audio and Video menus select Direct Stream Copy. Go to Audio > WAV Audio and chose the wave file you want to use as audio stream. Save the file by selecting File > Save as AVI.

11. Change the brightness / contrast of a video

Note: This will make the new settings permanent. To change the image settings and quality temporarily during playback, configure the DivX control panel from the Start menu shortcuts.

Open the movie in VDub. At the Video menu select Full processing mode, and at the Audio menu select Direct stream copy. Go to Video > Compression and select the desired video codec. Configure. Now go to Video > Filters and click the Add button. Double click the brightness/contrast filter and configure it as you like most.

Accept all and go to File > Save as AVI.

12. Crop the borders of a video

Open the movie in VDub. At both Audio and Video menu select Direct Stream Copy. Go to Video > Compression to select the desired video codec, and configure.

Now, to be able crop the video we must apply some filter to the video, so go to Video > Filters and click the Add... button. Double click the brightness/contrast filter and leave both values at 100 % (or change them if you want). Click OK and now at the Filters dialog you will be able to click the Cropping button. Click it and use the values at the corners to crop the video. Note: The DivX 5 codec requires a width number multiple of 4, and a height multiple of 2. If you select improper crop values, you won't be able to encode the video.

Save the file by selecting File > Save as AVI.

13. Change the frame rate of a video

After opening the movie in VD, in both Audio and Video menus select Direct Stream Copy. Go to Video > Frame Rate and at the Source Rate adjustment field enter the new frame rate. Common values are 15, 24 and 30. Decimal values are also permitted, but some rounding may occur. Click OK and go to File > Save as AVI.

If this process causes A/V desynchronization, read this answer to avoid the problem.

14. Capture a video frame and save it as an image

After opening the movie in VirtualDub, in both Audio and Video menus select Direct Stream Copy. Move the slider to the position where is the image you want to capture. Hold down Shift to snap to keyframes while moving the slider to seek faster.

When you have found your frame, go to the Video menu and there select Copy source frame to clipboard. Now you can paste the image at your preferred image editing program, and edit and save it in the desired format.

15. Change the AVI file FourCC code

To do so, you will need a small utility called WinX2D. After runing the program, click Browse and select your movie. Then select the desired codec in the drop-down selection box and click Apply.

16. Audio extraction to an uncompressed WAV file

The most secure method to do this is using VirtualDubMod. Open your movie and if a warning message regarding VBR audio appears, answer No.

Go to the Streams > Streams list menu and right click the audio stream to extract. In the popup menu select Full processing mode, and then again right click the stream and select Conversion. Configure the conversion dialog to match the following settings:

If you plan to create a DVD-Video with this audio, chose a sampling rate of 48000 Hz.

The shown settings are compatible with the audio format required for VCD discs.

Click OK and then click Save WAV to extract the selected stream to an uncompressed WAV file. Notice this process will probably require a codec such as the Frahunhofer MP3 codec or the AC3 ACM Decompressor codec.

17. AC3 audio extraction

Open your source AVI in VirtualDubMod, then go to Streams > Stream List. Select the audio stream you wish to extract and click Demux to save it as an AC3 file. This can take a few minutes accordingly to the video length.

18. Extract streams from a Matroska (MKV) file

Audio, video and subtitle streams can be extracted from any MKV file using the command line application mkvextract.exe, included in the MKVToolNix package. Also, there's a GUI for making its usage easier, and it's called MKVExtractGUI. To use the GUI, simply extract the files into the same folder where MKVToolNix is located and run mkextractgui.exe.

To extract the streams from the MKV file, load it in MKVExtractGUI and select the streams to extract, then press the Extract button.

You can later mux the extracted streams and create a AVI file using the MKVMerge application.

Other Common Tasks

A. Check if my system is ready to work with Virtual Dub

In order to use all features from this guide successfully, you need:
  • Have installed the latest VirtualDub or VirtualDubMod version
  • Have the proper audio codecs installed, such as MP3 and AC3 Decompressor.
  • Have the DivX or XviD codecs installed with the original installer programs.
  • Have installed the required audio codecs and video codecs in order to open the file.

B. Find out the audio bit rate and sampling rate of a file

To retrieve all possible information from any video file, open it with the free tool MediaInfo. This program will show everything related to codecs, bitrates, and all info that can be retrieved from the file.

Comments

blog comments powered by Disqus