Video Edition with VirtualDub

 

 

Welcome to the video editing guide provided by DivXLand.org. The programs used to edit AVI video files are either VirtualDub or VirtualDubMod, both available at the software section, they provide all the needed features for basic video edition and conversion. This section is organized with the most typical tasks than can be done with VirtualDub.

Remember that codec packs install decoders only, this means they are unable to encode or recompress media. Please install the required codecs separately for audio and video edition.

 

  VirtualDub Controls

 

  A    B    C

1

Playback control, used for playback and stopping of the original input file or the processed video output.

2

Start / End, used to move the slider to the first or last frame of the video.

3

Backward / Forward, used to rewind or advance by one frame.

4

Previous / Next keyframe, skips to the previous or next key frame.

5

Scene Backward / Forward, moves the slider to the previous or next scene change of the video.

6

Selection Start / End, used to select a specific portion of the video so you will be able to work with it.

 

Current position, shows the time and frames position where the slider is.

 

Slider, indicates the current position in the video. To seek faster, hold down SHIFT while moving it to snap to keyframes.

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.

 

  Audio menu in VirtualDubMod; OGM and MKV Files

Since the Ogg Media (OGM) and Matroska Video (MKV) 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. This procedure is explained here.

 

  Video Edition Tasks

 procedure explanation

  1.  Split a video file in several parts

  2.  Join 2 or more video files

  3.  Cut / delete a specific portion of a video

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

  5.  Convert any AVI file using DivX or XviD compression

  6.  Convert the audio format to MPEG Layer 3

  7.  Change the video size (resolution)

  8.  Change the audio volume level

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

10.  Replace the audio stream with a WAV file

11.  Change the brightness / contrast of a video

12.  Crop the borders of a video

13.  Change the frame rate of a video

14.  Capture a video frame and save it as JPG or other format

15.  Change the AVI file FourCC code

16.  Extract the audio stream to a WAV file (uncompressed)

17.  Extract an AC3 audio stream to an AC3 audio file

18.  Extract audio or video streams from an MKV file

  If you have a question not answered here, please ask at the forum.

 

  Other Tasks

 procedure explanation

 A. Check if my system is ready to work with VirtualDub

 B. Configure the DivX or XviD codec for video encoding

 C. Find out the current format, audio bitrate and sampling rate of a movie

Did you know that you can use DivX technology to compress the video captured from your surveillance camera system?  It's true, DivX works with all electronic surveillance products like security video cameras Digital video taken with surveillance cameras is not only fun to edit, but will help keep you safe too.

 

  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 (button 2B). 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 with button 6A. Position the slider in the end of the first segment (this is, the number of frames per segment) and advance to next key frame pressing button 4B to avoid problems. Mark the selection end with button 6B.

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 button 4B. Mark the selection start (6A). Advance to the end of the portion desired, and again snap to next or previous key frame by pressing button 4A or 4B. Mark the selection end (6B) 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 or the Web BitCalc. Open either of those, 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 it as explained here. 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:

  • 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.

  • 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.

  • 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 it as explained here. 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 as explained here. Now, when you go to calculate the video bitrate with DivXLand Bitrate Calculator or the Web BitCalc, use the current audio bitrate of the movie. Go to Video > Compression and select the desired video codec. Configure it as explained here.

Save the file by selecting File > Save as AVI.

      Option 3:

Open the movie in VDub. At both Video and Audio menus select Full processing mode. Go to Video > Compression and select the desired video codec. Configure it as explained here. 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 it as explained here. 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 5 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 it as explained here 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 it as explained here.

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.

 

  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 version (or VirtualDubMod, better)

  • Have the proper audio codecs installed, such as MP3 and AC3 Decompressor.

  • Have the DivX or XviD codecs installed with the original installer programs.

  • If you have movies that require other audio or video codec, of course you must install it.

  • Recommended players: Media Player Classic, RadLight

All this software and more is available at the Software selection provided by DivXLand.org.

 

  Video Codec Configuration

Select the codec you are using to see a detailed configuration procedure.

The video bitrate can be obtained using either DivXLand Bitrate Calculator or the Web BitCalc, in order to control the output video quality and file size.

 

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

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

 

  Questions? Comments?

 

If you have any questions or need support regarding this guide or article, don't hesitate to ask at the DivXLand.org forum personally.

 

  Related Topics

 description

link site
 Aspect Ratios explained DivXLand
 DVD and VCD compatible MPEG formats specifications DivXLand
 Video playback troubleshooting guide DivXLand
 AVI to DVD-Video conversion guide DivXLand

 

Featured Movie Trailers

QuickTime 7 or QTAlternative required

View trailer

Monsters Vs. Aliens - TV Spot

When California girl Susan Murphy is unwittingly clobbered by a meteor full of outer space gunk on her wedding day, she mysteriously grows to 49-feet-11-inches tall. Alerted to the threat of this new monster, the military jumps into action and Susan is captured and secreted away to a covert government compound. There, she is renamed Ginormica and placed in c [...]

View trailer

Year One - TV Spot

No synopsis provided by the studio.

 

To locate another guide or software, please type the keywords below.

Tools

Google
 
Web DivXLand.org

  Email to friend

  Bookmark

  Print

 

©2002-2009 DivXLand.org. All rights reserved. Unauthorized copy of contents is prohibited.