Editing in VirtualDub
From SDA Knowledge Base
Contents
GETTING STARTED (EDITING)
Create your .avs file as instructed on the Smart Bob page. Make sure that the .avs file references the video you just captured exactly, or VirtualDub won't be able to open it (and will tell you so).
Go to "Open video file..." in the File menu and open the .avs file you just made, or else find it using Windows Explorer and drag it into the VirtualDub window. avisynth processes the video you captured as the .avs file instructs it to and shows it to you in the VirtualDub displays.
The left display shows the original file, while the right display shows what you will be exporting. You will probably notice that the video is "squished" or half as tall as it should be. This is normal; you will restore the full vertical resolution in the next step.
FULL FRAMERATE VIDEO
Avisynth will help you restore the full range of motion to your video. Capturing at 320 x 240 without Avisynth, as most people do, would cause you to lose half of your motion information. Now you will need to use one of two VirtualDub filters to resize the field-split video so that it appears at a proper size. To determine which filter to use, perform the following test.
Start by dragging the slider at the bottom of the VirtualDub window until you can see yourself playing. Now, carefully move one frame at a time through your run (using the left and right arrow keys). You are looking for a change in the vertical hold of the picture every other frame, i.e. the picture will appear to "jiggle" about a half pixel up and down every frame. It helps to look at a supposedly static object (like your energy meter) to see the "jiggle" or "bob." Keep in mind that you may need to reverse the polarity of the fields (i.e. add "ComplementParity" to your .avs file) to eliminate this as explained at the Smart Bob page. Reversing the field polarity may not help; if this is the case, leave the field polarity the way it looks the best (with the least amount of "jittering").
If you see this "jittering" or "bobbing" effect regardless of whether the fields are reversed or not, then you know you need to apply the Smart Bob filter. Usually only the most recent game systems (such as the GameCube) have this problem, though, so if your video seems to stay in place pretty well, then you should skip the next step. In fact, if you apply the Smart Bob filter to a video that is not "bobbing," then you will end up with very bad quality video. Videos taken of NES and SNES games are known not to bob, while video taken of GameCube games do bob. (Note that the Game Boy Player is an important exception to this rule: no Game Boy games of any type ever bob. See below for more information about how to correct Game Boy Advance video played through a Game Boy Player.)
To apply the Smart Bob filter, select Filters from the Video menu. Then click the "Add..." button and select Smart Bob. Change the Threshold to 18, then click "OK". Click "OK" again to leave the Video Filters window. You should see your output display double its vertical resolution and return to a proper aspect ratio. You're now done restoring full motion to your video; you can safely skip the next two paragraphs.
If you do not need to use the Smart Bob filter (because your video is not "bobbing"), you will need to apply a filter that comes with VirtualDub instead to restore the video to a proper aspect ratio. But first, if you've captured Game Boy Advance video via a Game Boy Player, you will need to do something special to correct this video before you resize it. Select Filters from the Video menu, then click the "Add..." button and select Field Bob. You want to select "Quarter scanline up" for the Even fields and "Quarter scanline down" for the Odd fields. Then hit OK, then OK again to exit the Filters window. This will correct the "pseudobobbing" introduced by the Game Boy Player to make Game Boy Advance video look better on interlaced TV screens. This step is not needed for any type of video other than Game Boy Advance video.
Now, regardless of whether you've captured Game Boy Advance video, select Filters from the Video menu, then click the "Add..." button and select Resize, then click "OK." The default values will probably be okay if you've captured NTSC video (for PAL and SECAM video, use 352 for the width and 288 for the height). Click "OK," then "OK" again to leave the Video Filters window. You should see the output (on the right side of the VirtualDub window) return to a normal size.
With the video restored to a good size at full framerate, use the slider at the bottom of the VirtualDub window to scroll through your video and check out what the output looks like now. If you want, you can even play the output (assuming your computer is fast enough) by clicking on the Play Output button (the button with an O next to the Play symbol).
A side note to those capturing runs done with a Game Boy Player: you may wish to crop the large border off of the video before you export. To do this, select Filters from the Video menu, then click the "Add..." button and select Null Transform. This is a filter that does essentially nothing; it is used only to crop the video that passes through it. To set the cropping, click the "Cropping" button and play with the four values shown in the window that appears. You will probably want to advance the video to an area that is particularly bright, so that you can clearly see where you should set the cropping boundary. For Game Boy Advance video, a good amount is usually around 40 pixels off of each side (assuming you resized the video as instructed above).
The height of the resulting video will almost invariably be 160 pixels (the vertical resolution of the Game Boy Advance), while the width is not so certain. It will probably be somewhere in the neighborhood of 240 pixels, but you won't know the exact number until you carefully set the cropping boundary and check the resulting dimensions in the Filters window. Unfortunately, due to the nature of an analog television signal, there will be distortion (blurring) on the left and right edges of the Game Boy Advance image.
Complicating things even further, you will need to make sure before you finish setting the cropping boundary that the resulting dimensions (the width and the height) of the video are both divisible by 4. If they are not, you might have trouble exporting your run to DivX, which requires that both the width and the height of input video be divisible by 4. To check the dimensions of your video, hit OK in the Cropping window and check the bottommost filter's final dimensions (the set of two numbers on the right). If those two numbers aren't divisible by 4, you will need to change the cropping boundary so that they are.
EDITING
You will need to decide which part of the video you want to export. To make a selection, press the Home key on the keyboard to select the first frame of your video to export and press the End key to select the first frame to be cut off of the end (the frame you can see when you press End will not be included in the export). You can easily cut off leading and trailing video you do not care about in this way.
COMPRESSING
Before you save the output, you should set the output video and audio compression. Select Compression from the Video menu, then select DivX from the list that appears. Click the "Configure" button that appears at the right to configure your DivX settings.
First of all, you will want to turn off the pesky "Profiles" turned on by default in DivX 6.x. To do this, select "none" from the Certification Profile menu near the top of the main DivX configuration window. This will allow you to export full framerate video or video with irregular dimensions.
Next, you'll want to set the bitrate, further down in the same window, to the left of "kbit/s". I typically use the maximum 4000 Kbps when I export "Insane Quality" video, or 2048 Kbps for its "High Quality" little brother (both full framerate video). For "Medium" or "Normal Quality" (not full framerate video), I use 512 Kbps. For "Low Quality" you only need 128 Kbps.
If you want to use multipass encoding for superior quality, choose "Multipass, 1st pass" from the Encode Mode dropdown menu to the left of the bitrate box. Otherwise, for encoding with only a single pass, leave it at "1-pass".
Click "OK" twice to close out of the two windows and return to the main VirtualDub window.
Next, you should set the audio compression. Select Full Processing Mode from the Audio menu. Then, select Compression from the Audio menu. You should be able to select "LAME MP3" from the list that appears. Again, you will need to select a bitrate next. I use the maximum 160 Kbps for the 22.05 KHz 16-bit Stereo audio I instructed you to capture for high quality exports. For medium quality the setting is usually 64 Kbps (for stereo) or 32 Kbps (for mono). For low quality this setting is the same (because it can't go any lower). Click OK to close out of the Audio Compression window.
EXPORTING
When you are ready to export your compressed video, press F7 and give the new file a name. Depending on the speed of your hard drive(s) and processor(s), the final export could take a long time. If you want to delay the operation until later, click the "Don't run this job now; add it to job control so I can run it in batch mode" option. Later, when you have queued all of your export jobs, you can press F4 to open the Jobs list and then press the Start button there to process all of the jobs automatically.
Note that if you selected DivX's multipass encoding under the earlier COMPRESSING step, you must click the "add it to job control" option and use the Jobs list to export your first and additional passes (or else immediately run your additional passes after you run your first pass). You must do each pass immediately after the previous one because DivX does not remember for which videos you've done which passes. To export your second or later passes, go back into the DivX settings as explained under COMPRESSION and change the option in the Encode Mode dropdown from "Multipass, 1st pass" to "Multipass, Nth pass". Then you can add the second pass of the encoding to the Jobs list (or else run it immediately if you've just run the first pass). It's thought that two passes produces the best ratio of video quality to processing time.
By the way, with multipass encoding, two passes is the minimum number you can do. The first pass produces only a blank AVI file; the second pass or higher makes your video.
While VirtualDub is exporting your video, you can optionally press F9 to display the input video as VirtualDub sees it and F10 to display the output video (uncompressed) as VirtualDub sees it. You can also select Show Status Window from the Display menu if you want to see a progress bar associated with your dub operation. (These things will already be done for you if you're not using Job Control.) Otherwise, simply minimizing VirtualDub will allow you to see a percent complete indicator in VirtualDub's icon on the Windows Taskbar.
When the dub operation completes, go find your exported video and watch it. If you see that you need to make changes (to the area selected to export, or to the video or audio compression, or to something else entirely), you can always make them in VirtualDub and export your run again.
SAVING YOUR SETTINGS
Once you have your settings the way you want them, you can optionally save them to a special .vcf file, which you can use to restore them during future uses of VirtualDub. To do this, select Save Processing Settings from the File menu (or just press Ctrl+S). If you want to restore those settings later, select Load Processing Settings from the File menu (or press Ctrl+L) and select the .vcf file you saved earlier.
Return to the front page.