AMV Post Production - Resizing

This is the last stage of the post-production process. With any luck you'll have an avisynth script that imports your exported avi, deinterlaced (if required) and filtered.

Now it's time to choose your resolution. First off, if you edited something that's a movie and was letterboxed, you want to crop out any black bars it has.


I would suggest opening up your script in VirtualDub, going Video->Filters->Add->null transform and then clicking the "Cropping button" to bring up the cropping screen. This will give you a nice GUI with which you can figure out how much you need to crop. Write down the values and then add the following line to your AVISynth script:


where the 4 values there are the number of pixels you're cropping off from each edge. Note that you want to make the last two numbers negative! If you don't, it interprets the last two numbers as being destination resolutions, for instance the following lines performed on a 720x480 clip:


will both produce the same result, however the first syntax is easier to read and corresponds to the values you will see in VirtualDub.


Now you should decide which resizing method to use. There are three different algorithms you can use: BilinearResize, BicubicResize and finally LanczosResize. They differ in how sharp the image is when resized. Sharper is much better quality visually but it is also harder to compress so you need to balance the sharpness with the final file size you want. However, a less sharp resize can hide imperfections in the video.

Bilinear Resize will give you smaller filesizes and on older anime that was shot on Film it is most likely the better choice. It does a little blurring so this makes it the ideal choice if you want to get as small an avi file as possible. If (like me) you find Bilinear to be too blurry, then you'll want to choose something sharper...

Bicubic Resize actually comes in various forms. The most common of these are Soft, Natural and Sharp. If you are going to go for a little extra sharpness then you'll want to do a soft bicubic resize. If you want sharpness, then you might as well do a Lanczos resize :) On newer, digital shows which are much sharper and defined, a Soft Bicubic will most likely produce better looking results than Bilinear without loosing too much compressibility.

Lanczos Resize - excellent detail, but the sharpness comes at a price. However, if you use some filtering on your amv they can nicely balance each other out. Not always recommended for internet file encoding (without filtering at least) but great for other purposes (like resizing for cons etc)

You can perform all of these resizes in Virtualdub but if you are doing any other filtering it is best to do it all in Avisynth. This is especially true if you are working with YUV colourspace avi files.

To perform a Bilinear resize, add the following line to your avisynth script:


For a soft Bicubic, add:


The last two parameters are changing the strength of the algorithm and what give it its "softer" touch. Normal Bicubic is 0.75 and produces a much sharper, difficult to compress picture.

If you're encoding to MPEG1, we recommend a resolution of 352x240, and BilinearResizing because MPEG1 is less sensitive to the differences and also at that resolution it will matter much less. Do this by adding the line:


Never choose sizes that are not multiples of 16 when encoding MPEG1 otherwise your files will be non-standard and may have distortion at the edges.

If you are encoding to an AVI format such as DivX or XviD, here are some recommendations.

Generally, good resolutions for AVI fullscreen encodes (i.e. non-movie, full 4:3 stuff) is 480x352, and a good resolution for widescreen encodes is 512x272.

However, if your framerate is 29.97fps and not 23.976fps, you might want to consider putting widescreen encodes in 480x256, especially if they're very high motion. For instance, the XviD encode of Soul of an Angel is in 480x256 and it's STILL over 80MB. At 512x288 resolution it would have been almost 100MB.

So, to resize your video to 480x352 using the soft bicubic method, add this line:


If you're encoding to DVD-quality MPEG2, you'll want 720x480 resolution so if you are already in that resolution, no resizing is necessary. If you're not, and you're in some resolution like 640x480, add the following line:


Note that we are using the Lanczos algorithm. If you are scaling upwards and are encoding to a high quality medium such as dvd, you want the most accurate resize as possible but when shrinking, softer resizers can help compression as discussed above.

Adding Black Bars?

Sometimes you might be editing with anamorphic footage (widescreen footage that is stretched to 720x480 on the dvd). You might want to actually add black bars to correct the aspect ratio. This is not something you should do with internet distributions of your videos (as you should just resize to the right aspect ratio as shown above) or with correctly authored dvds (as you should keep it anamorphic and choose the appropriate 16:9 options when encoding the mpeg2).

However, if you are submitting a file to a convention and are unsure as to whether they will correctly scale your amv, it can be useful to add the black bars yourself and encode at 4:3. This will stop your utena movie amv containing characters that look like toothpicks. To do this you should resize to 16:9 and then add borders to make the frame 4:3 again. If you are making dvd-size footage it would be like this:


Note you should only do this with progressive footage as resizing interlaced footage will blend your scanlines.