Wednesday, 13 May 2009

Basic editing using VirtualDub

For a fast, easy to use, and free video editor go and download VirtualDub. This superb little program can do many common editing tasks very quickly. The downside is that it can't do everything you might want, and though the interface is simple enough to use it's not very intuitive when you first meet it. Here I'll be explaining how to do three basic tasks:

  • Tidy a clip by snipping off the end
  • Join several clips together
  • Save space by compressing the audio

VirtualDub main interface

Drag the slider along the timeline like any ordinary video player. I've highlighted the most important buttons for selecting parts of the timeline.

  • Start / end selection, or Mark-in / Mark-out simply sets the start and end point of a segment of the timeline. Important: a selection runs from the first frame, up to but not including the last frame. This makes editing easier as long as you bear it in mind when deleting segments.

  • Frame back /forward buttons move the slider back or forward one frame at a time. Going backwards can be slow.

  • Key frame indicator, a very important concept for editing. Key frames are coded as still images, the rest of the frames (deltas) are coded as differences from the keys. Edit out a key and the deltas up to the next key are useless as they cannot be decoded. Hold down the Shift key when dragging the slider with the mouse to keep to key frames (this is faster too). For easy editing always end the selection with a key frame or the end of the clip.

Importance of Direct stream copy

When you start up VirtualDub always go to the Video menu and select Direct stream copy as below. This makes sure the new clip is copied directly from the original video stream without any additional processing. Not only does this not degrade the picture quality at all, it's also very much faster. There's a Direct mode for the sound as well on the Audio menu, and this is selected by default.

Snipping the end off a clip

The sample clip I created earlier runs on a fraction of a second into the next scene, which looks messy. I want to cut this bit off. As a matter of routine it's a good idea to encode about fifteen seconds more than you need and edit off the surplus rather than fiddle around getting the length perfect in the first place.

Move the slider right off end of the clip and click Mark-out. Now move it back until it's on the first frame you don't want and click Mark-in. This frame will probably be a key frame, but always check it's the right one by stepping back to the previous frame. In my example I only have to snip a single frame, but below I've selected more to make things clearer

The part you don't want is now selected in blue so just press Del to delete it. Now save the clip under a new name and you're done. A couple of notes:

  • If part of the clip is selected when you save then just that part will be saved, not the whole thing. If that's not what you want use Edit menu -> Clear selection to clear it.

  • Always have Video menu -> Direct stream copy selected or the clip will be re-encoded and the quality will degrade.

Joining two or more clips together

So you have several short clips you want to merge into one, or perhaps an entire feature film divided into chapters. You can quickly splice them together without loss of quality as long as the picture dimensions, frame rate, and audio sampling rate are the same for all the segments.

Load up the first clip, then go to the File menu and select Append AVI segment.... Just choose a file and it'll be added to the end of what you've already loaded. When you've got all you want save the whole thing under a new name (with Video -> Direct stream copy as usual).

  • Take care when this Audodetect additional segments box is checked! This is very handy when you have files like chap-01, chap-02 etc., but can be very confusing when you're just trying to add one file at a time.

Reduce file size by compressing the audio

AoA DVD Ripper produces AVIs with MP3 audio at 192Kbps. This is a good thing if you enjoy the music, but much more than is needed for most purposes. You can save 1MB of space per minute of video by using a 56Kbps rate. This gives a very useful reduction in file size for a low resolution clip, but may not be worthwhile if you are using higher resolutions.

Go to the Audio menu and select Full processing mode. Then Audio menu -> Compression. You'll see a list of codecs. Click one and choose the bitrate. I always use MPEG Layer-3 at 56Kbps (22050Hz), which is half the standard sampling rate.

Now save the entire clip (with Video -> Direct stream copy selected). Re-encoding just the audio doesn't take long.

  • Beware!, changing the sampling rate means you won't be able to join this clip with other AVIs that still have the old rate.

No comments:

Post a Comment