Method 1: Creating Clips for
Source Footage:
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 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 awful 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 gods 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
- Imports Footage
- (optional but recommended) Removes Interlacing (makes
the footage progressive)
- Corrects any Aspect Ratio issues
- Is generally nice, clean and looking good
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 favour 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.
Note that As you are
creating clips, it can be very useful to clean up the footage before
editing.
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
that
you do a little of this before compression anyway) but cleaning footage
before
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
Lagarith.
OK I tell a lie, there are a number of options available to
you but HuffYUV is without a doubt the most stable of these options and
Lagarith is the second most stable.
However, I will talk about some alternatives.
The main problem with HuffYUV as it is at the moment is that
it does not have the ability to store YV12 data. YV12 is the native
colorspace of DVD and is hence the format that would be most
appropriate to store the colour information in. It also contains
physically less data due to the fewer chroma samples per frame.
Unfortunately we cannot take advantage of this with HuffYUV as
it does not support YV12. This is a major failing that I would like to
see fixed. However, in its wake there are a number of lossless
compression codecs that can store YV12 information.
VBLE - This is a codec by MarcFD but it is unstable.
It works but has lots of bugs (particularly with directshow)
and as there is no source code for these bugs to be fixed unless MarcFD
releases newer versions himself.
HuffYYV YV12 - That's right, there is a version of
HuffYUV that can compress YV12 data. It is part of the VfW code for
FFDShow and be selected amongst the massive amounts of options in the
FFDShow codec configuration pages accessible via VirtualDubMod. The
only problem is that FFDShow is under
heavy development so it is possible that you will install a version in
the future that will break compatibility with old encodes. If a stand
alone version of this codec can be produced then I will recommend it as
the code itself is sound.
ffv1 - This is another codec in FFDShow and very
powerful it is too. This is the best YV12 video compressor there is at
the moment but it is very developmental and undergoes constant changes.
As such, my concerns are the same as with the FFDShow HuffYUV.
CorePNG - A really great codec for anime. However,
it has not been updated in around 5 months and has some
known bugs. Even with this resolved, however, it is very slow both
encoding and decoding so it's not vastly useful for editing.
Loco - Again buggy and this time also slow.
Lagarith Lossless Video Codec - Good compression and
becoming more stable all the time.
DVD clips are YV12 and you will have the smallest encodes with
YV12 compression. For this you will probably want to use Lagarith as
it is the most stable of the YV12-capable compressors available.
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 but the files it produces can be problematic to edit with,
so it is not recommended for stability reasons.
Enable RGBA Compression: This isn't required for YV12
encoding but selecting this will allow you to also store the alpha
channel when compressing RGB32 video (from After Effects etc).
Always Suggest RGB Format for Output: This is a
decoding option which will feed RGB footage to programs instead of the
native colourspace that is stored. This is to accomodate for programs
that do not like YV12 or YUY2 and hopefully you should not need this.
So, for most people, none of these options will need selecting.
Once you have the compressor selected you must make sure that
you select Video -> Fast Recompress which will ensure that
there will be no colourspace 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 colourspace in avisynth somehow) you will compress in YV12 which
will be identical to the dvd source.
For making the clips, see the section
below...
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 colour. 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.
YUY2
Compression Method: HuffYUV
can compress YUY2 colour. Although DVDs use YV12 colour, 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
cases.
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
colourspace 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
this
- 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
this.
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 Colourspace - different commands for
different sources.
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
colourspace you will be compressing to.
So for YUY2 use ConvertToYUY2() and for RGB use
ConvertToRGB24()
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
much larger
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.
AbsoluteDestiny - Nov 2004
|