Method 1: Creating Clips for
I'm sure you've already read the codec
guide, if not do so now as it's a handy general overview of
different video codecs.
Before I actually get onto the conversion details I would like
to emphasis a few things:
DO NOT USE DIVX OR XVID or any divx variant. They are very
difficult to edit with and the quality, no matter how good it looks to
you when you are editing, will make things look worse than if you used
a lossless compression codec. MPEG4 codecs may well be small but they
are not good things to edit with.
DO NOT USE MPEG1 - lots of people like using mpeg1 for
editing. However, even in Premiere and other programs that have mpeg1
support, the editing will not be frame accurate and you may find that
the cut you thought was spot-on actually pops into the next scene when
editing. This is very bad, not to mention that the quality will be
pretty aweful when it's all done too.
Also, do not use mjpeg unless you really have to - if
you have the space for lossless compression then please use a lossless
codec. If you MUST use
a lossy codec like MJPEG, choose a very high quality. If you want to
make DV files, use
your native software/hardware solution. If you want to use anything
else, for God's sake at least make sure all the frames are keyframes :)
Preparing the Clips
What you should have:
If you have followed the guide so far you should have an
avisynth script that
If you have not being going through this guide sequentially and have
skipped parts to try and hurry your way through these instructions then
do yourself a favor and go back and read them. It's useful
information, will really help you get the most out of your footage and
it's free - it only costs your time in reading it.
- Imports Footage
- (optional but recommended) Removes Interlacing (makes
the footage progressive)
- Corrects any Aspect Ratio issues
- Is generally nice, clean and looking good
Note that as you are
creating clips, it can be very useful to clean up the footage before
This will vastly improve the overall quality of your video. Of course,
you can try and clean it up after you have made it (I always recommend
you do a little of this before compression anyway) but cleaning footage
you make your video has many advantages as explained earlier.
Converting the Avisynth File
At this point, you should have an AVIsynth file (that is
either progressive or interlaced). Load up VirtualDubMod and open the avisynth file.
Choosing a codec
Right now you essentially have two choices. HuffYUV or
Okay I tell a lie, there are a number of options available to
you but HuffYUV and Lagarith are without a doubt the most stable, so those are the two we will talk about.
DVD clips are YV12 and you will have the smallest encodes with
YV12 compression. HuffYUV does not support the YV12 colorspace, so for this you will probably want to use Lagarith.
However, it is not the fastest of codecs so if speed is your primary
concern then you may wish to convert to RGB and compress with HuffYUV.
Both of these codecs come as standard with the AMVapp.
Compressing with Lagarith in YV12 (smaller files)
Open up VirtualDubMod and in the menus go to Video ->
Compressor and in the list choose Lagarith. The
options are very simple:
Enable Null Frames: This option will increase
compression when you have special content that contains completely static scenes, but the output it produces can be problematic to edit with,
so it is not recommended for stability reasons.
Always Suggest RGB Format for Output: This is a decoding option that will cause Lagarith to decode video in RGB unless a program explicitly tells it otherwise. If your video appears black or you get a similarly strange error, it is recommended that you enable this.
Use Multithreading: If you have multiple processors, or if your processor has multiple cores, you should select this. Otherwise, leave it disabled.
Mode: This may be confusing if you don't understand what this setting does. This sets the highest colorspace that Lagarith can encode to, not the colorspace that will be used. This means that if its set to RGB, and you feed YV12 video into Lagarith, it will still be encoded as YV12. However if you set this mode to YV12, and you feed RGB32 footage into lagarith, the video will be down-converted to YV12. What this basically means is this: If you want to encode in YV12 colorspace (as you almost surely will want to do), its fine to set this to YV12, and you will definately get YV12 compressed video.
Once you have the compressor selected you must make sure that
you select Video -> Fast Recompress which will ensure that
there will be no colorspace conversions between your input (from
Avisynth) to your output (Lagarith). Lagarith can compress YV12, YUY2
and RGB but if you are using DVD footage then (unless you have changed
the colorspace in avisynth somehow) you will compress in YV12 which
will be identical to the dvd source.
For making the clips, see the section
Compressing with HuffYUV in RGB (faster files)
As we will not be using a YV12 codec, a colorspace conversion
must take place when we compress DVD MPEG2 clips into HuffYUV. HuffYUV
can store YUY2 and RGB color. RGB is the colorspace used by the
majority of video editing software out there - the advantage of saving
clips in RGB is that you can be certain that what you put into the
video editor is what you will get out. YUY2, however, is naturally
smaller than RGB and will produce smaller clips which is good if you do
not have much room.
Setting up HuffYUV
Open up VirtualDubMod and in the menus go to Video ->
Compressor and in the list choose HuffYUV. 2.1.1
is the current recommended version as 2.2.0 is buggy. If you have 4
versions of HuffYUV displayed, then you have the DirectX 8.1 Yuv
Renderer Fix installed. Don't worry, they are just separate listings of
the same codec. Once HuffYUV is highlighted, click the Configuration
button. HuffYUV has several options which I will explain below.
Compression Method: HuffYUV
can compress YUY2 color. Although DVDs use YV12 color, you can
convert to YUY2 losslessly provided you use the appropriate convertion
command in avisynth (see below). Setting
this to Predict Median (best) will allow it to use the highest
compression when asked to compress YUY2 footage and it is smaller
than RGB. RGB, however, is better for editing compatibility in many
RGB Compression Method: You
should always have this set to Predict Median (best). It is likely that
you will mostly be compressing RGB footage with HuffYUV as that is the
colorspace used by most editing software. Making clips in YUY2 is fine
but if you export from an editing program you should always, without
exception, make sure that the RGB mode has a compression method.
Field Threshold: This is the number of lines before
HuffYUV will consider the file to be interlaced and compress fields
instead of frames. Honestly it doesn't matter much either way except
you will get smaller files if you do have interlaced footage. To always
have HuffYUV always presume the frames are progressive, change this to
a number higher than 576. 'Ignore is-interlaced flag' is a
decoding option that can be helpful if a huffyuv file appears to be
decoding incorrectly as this can sometimes fix it.
Always Suggest RGB mode for Output: Leave this
unchecked unless an editing program is not displaying your encode (such
as After Effects in some cases). It wont affect your encode at all,
it's a decoding option.
Enable RGBA Compression:
Alpha channels can be very useful things if you know what they are and
how to use them. For footage conversion an Alpha Channel will just
waste space but when
rendering After Effects compositions or 3D renders, the Alpha Channel
can be handy. Selecting this compresses the footage as RGB32
instead of RGB24. However, if you leave it on all the time it is
wasteful and unless you have an alpha channel it will make your encodes
bigger than they need to be.
Swap Fields on Decompress: You should not need to use
- it is designed to fix problems with bad capture cards that have
encoded with a field order opposite of what the source was.
Enable Console-window logging: Again, you won't need
YUY2 or RGB
At this point you need to decide whether you want maximum
compatibility or you want better file sizes. If you compress RGB with
huffyuv you can be certain that what you put into a video editor is
what you will get out. With YUY2, this is true most of the time but
some programs can do bad conversions or simply refuse the YUY2 footage.
You can often get around this downfall with the "Always suggest RGB
format for output" but it's not as reliable as having clips in RGB. So,
essentailly, it comes down to space. If you have space to spare, use
RGB but if you are tight on space use YUY2.
Converting the Colorspace - different commands for
If you have used IVTC or Force FILM on your footage, then
setting up your avisynth script for compressing is easy. At the end of
your script you should add a line that converts the footage to the
colorspace you will be compressing to.
So for YUY2 use ConvertToYUY2() and for RGB use
This should be the final line of your avisynth script.
For progrsessive (deinterlaced/IVTC'd) footage:
ConvertToRGB24() or ConvertToYUY2()
For completely interlaced footage:
ConvertToRGB24(interlaced=true) or ConvertToYUY2(interlaced=true)
For Hybrid footage (these are AMVapp-only commands):
ConvertHybridToRGB24() or ConvertHybridToYUY2()
Once you have this footage loaded into VirtualDubMod, you
should Choose Video > Fast Recompress from the menu and choose the
Compressor... as HuffYUV and make sure it is set up as displayed in the
image above. You should now be ready to make your clips.
Making the Clips
Once you've got the codec and the compression method set up,
you can search through your source using the bar at the bottom and then
use the two rightmost buttons (Mark In and Mark Out) to select the area
you want to br converted into a clip. After you have chosen the range,
simply go into the File menu and choose "Save as avi..."
You may remember in the VirtualDubMod
guide that I talked
about the Job Control. Well job control is definitely something
you will want to use here. Instead of saving to disc, add them all your
your job control and then run them in one batch later. It's much quiker
than waiting for each clip to encode.
You will notice that these files will be very large - much
than the DVD source you are taking them from. This is because DVDs use
a lossy compression method, whereas codecs such as Lagarith and HuffYUV
are keeping every bit of
information without losing any quality. To store video like this you
need a lot of space.
Repeat as necessary.
Note: If you are running Windows 9x or have a FAT32
formatted hard drive, then you cannot create clips that are larger than
2 gigabyte (as they can't be read by that drive format). Either make
smaller clips or use virtualdub's "Save as Segmented Avi" option which
will do it automatically for you.
Now that you're done, you should have a look at how you set up
a project in your video editing application.