Cleaning up the footage: The Theory of Pre-Processing

You've made some avs files, you've maybe deinterlaced, resized, cropped or whatever. All of these things are about getting your footage to look right before you edit. Of course, there are more things you can do to make your footage look good. 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 the following advantages:

1) Different sources need different amounts of cleaning. You may have a nice clean modern source like Princess Mononoke which doesn't require any real cleaning but if you are making a 'various source' video using both Mononoke and sources that aren't as good looking then applying cleaning to the whole video once it is made runs the risk of making the Mononoke footage look worse.

2) Different sources may require special tweaks. You may have one source that needs a higher saturation of color, or one source that needs Rainbow noise removed and so on.

3) Using clean footage will help your effects. Effects that rely on color keys will be cleaner and any Photoshop-style alterations will be easier with clean footage. If you've sharpened up the image it will be easier to find those edges when doing masking.

4) Video is easier to clean when it has no edits. If you have lots of fades, effects and titles, these will all make cleaning the footage that little bit harder.

So as you can see, I think that cleaning things up before you start is a pretty good idea.

However, adding cleaning funcitons to your avisynth scripts will slow them down, sometimes considerably, so it is important to consider this. If you are making clips, you may not mind the extra encoding time it will take, but if you are using the avs files directly this may become more troublesome.

Pre-processing and editing from AVS

If you plan to edit directly from the AVS files rather than encoding them to avi files, one thing you can do is set up your cleaning functions and then comment them out by putting a # sign at the start of a line. This will mean that avisynth will ignore that line. When you are ready to export your video from your editing program, simply uncomment the lines. Here's an example scripts:
Don't just copy this script! This is only intended to show how you can comment lines out while editing from AVS!

MPEG2Source ("C:\yourfolder\blah.d2v", cpu=4)
deint = TDeint(mode=2, mtnmode=3, blim=100)
TFM(cthresh=4, pp=0, clip2=deint) #pp=0 while editing, change to pp=2 when I export
As you can see, I have a lot of lines that are commented out. These all change the video quality in some way. However, if I tried to edit with these lines included it would have been impossibly slow.

So, by taking them out I could edit and then put them back in later as required.

Of course, you also have to be careful to make sure that any lines you comment out do not change the video too drastically. If I removed TFM and TDecimate then I would have found that many of the frames would be different because they wouldn't have been IVTC'd. Also, if you want to get stills or pre-render any sections you will have to do that from the filtered version of the script.

It's a little complicated, so I only recommend it for people who are comfortable with what they are doing in avisynth, but it's a very useful technique for quality - especially with multiple anime videos.

How to clean up the video

If you want to clean up your video now, I recommend that you take a look at the post-processing cleanup guide. This guide is intended for cleaning up your video after you have edited it, but all of the information it contains works just the same before you edit. One word of warning though: Don't overdo it when pre-processing! You can always clean things up a little more in post-processing, but if you clean it too much now, you might be stuck with it (if you plan to convert your avs scripts to avi files).
If, on the other hand, you just want to use the footage as it is, you must now decide what to do with the avs files you have...

Using the Avisynth Files for Footage