Distribution
Making an Mpeg2 That’s Suitable for an AMV Contest Screening
[Archivist note: Most conventions at present want the same mp4 you use for internet distribution (most easily created by using AMVTool).]
After exporting our final huffyuv avi, you probably notice two things. For starters, the video is huge. Like, 2GB+ huge. Secondly, it plays choppy. What we’re now going to do is use a program called TmpegEnc to compress an mpeg2, suitable for submission to any contest that accepts digital entries (such as those run by Otaku Video).
For starters, download tmpegenc from here:
http://www.tmpgenc.net/e_main.html
Install it, and load it up. Since this is a demo version, we only have 14 days in which we can make mpeg2s. After that, we’re limited to mpeg1 until we buy it. No functionality is crippled however. Because there are a lot of settings, I can’t really go into the reasoning behind all of them in this guide, so I’ll let the screenshots do the talking, and explain some of the more questionable decisions.
For starters, load up your footage by clicking the browse button near the bottom, next to “video source”. Find your footage and press OK. The path to your video should appear in the video source box, and the audio source box. If you don’t like the output location, browse for a new one. When you’re ready, click the settings button to the right of these fields.
For starters, set the stream type to MPEG-2 Video. Then go down to “encode mode” and set it to “3:2 pulldown when playback”. This tells the mpeg2 to telecine itself on the fly, when played back. This way it meets NTSC spec and can be displayed properly on televisions and LCD projectors without appearing jerky.
Your size should be already set to 720x480, and your aspect ratio should be 4:3 Display. The aspect flag is very important because it tells mpeg2 decoder cards, DVD players, and even windows media player (when in fullscreen mode) how to stretch your video to be displayed properly. Even if your video is 16:9, if you followed the letterboxing tutorial and added borders yourself, you should still flag your video as 4:3.
For frame rate, change it to 23.976. Because we selected 3:2 Pulldown with Playback, it will also tell us that equates to 29.97fps internal, meaning after telecine, the framerate will be 29.97.
For rate control, select manual VBR, and then hit the setting button. for maximum bitrate, enter 9350 kbits/sec. DVD, and some decoder cards, max out at 9800 kbits/sec, and that in- cludes audio, as well as a little extra overhead for the system stream. 9350 is as close as you can get while still keeping it safe. For minimum bitrate, put 0, meaning if tmpeg can draw the image perfectly without using as much as 9350kbits/sec, it will use as little bitrate as possible, but still take as much as it needs (up to 9350). For P picture spoilage and B picture spoilage, enter 0 for both of the values. Spoil- age is how much you’ll allow tmpeg to degrade the image in the interest of file size. We don’t care about file size, so we tell it not to spoil.
Hit OK, and set the VBV buffer rate to 224. This is the number required if you ever wanted to dump your video to DVD. Setting it to auto could produce a slightly better picture, but it would not be DVD ready.
The other two fields you have to change are DC Component precision (set to 10 for the most accuracy) and Motion Search Precision (set to highest quality: very slow).
The next tab at the top is the advanced tab. The first change we must make, is changing the video source to progressive using the drop down box. Below, we’re asked for the field order, but since our source is progressive, this setting is irrelevant. Leave it at bottom field first. Change the source aspect ratio to simply “4:3 Display”. Technically, since we’re not resizing the video, the video arrange method shouldn’t matter, but I prefer to change it to simply “full screen” just to keep peace of mind.
The last change we make, is to check the box next to the noise reduction filter. Even if our source is clear, some minute compression artifacts may be present. Recompressing these artifacts will yield bigger ones that tend to dance around the screen and look really obvious. Noise reduction at the default settings (double click the filter to change the settings if you’re so inclined) will greatly help combat this. It will double the time it takes for you to make an mpeg, but it is worth it. Render while you sleep if you’re pressed for time.
In the next tab (GOP Structure) we have to make 3 changes for our stream to be DVD compliant. The output interval of sequence header has to be 1, and the max number of frames in a GOP has to be 18. Finally, check off “output bitstream for edit (closed GOP)”. Changing these settings will have no real effect on image quality, but they may bring up the file size just a little bit.
In the next tab (Quantize matrix) there’s very little we need to change. Take note though, in the drop down directly under the matrices, it reads “default”. Leave it as is, do NOT set this to CG/Animation. This will relax the analyzing precision which is fine for encoding whole episodes, but HORRIBLE for AMVs. At the bottom, click the checkbox for “soften block noise” and enter a value of 25 for each field.
The next tab is the audio tab. Here we want to set our stream type to Mpeg-1 Audio Layer II. This stream will not be DVD compliant because audio on an NTSC DVD can only be uncompressed (no room given our large video bitrate) or ac3 (Dolby Digital requires a much heftier licensing fee than our $30 registration for tmpeg). This should not be a problem though because any convention that is mastering a DVD, should have enough sense to know how to extract and re-encode your audio.
Set the sampling frequency to 44100 to match our current sampling frequency. Set the channel mode to “stereo” to ensure maximum stereo separation. Joint stereo tends to blur the left and right channels together in the interest of saving file size. Set the bitrate to 384, which will produce an almost lossless encoding of our audio track. Finally, tick off the “error protection” checkbox to ensure a steady, in-sync stream.
In the system tab there is nothing that we have to change. The program type should have automatically set itself to “MPEG-2 Program (VBR)”. You can check “insert comment” and type in something to hide in the stream if you so desire. Certain media players will be able to display this.
Click OK, and then hit the start button located in the top left corner of the original window. Quality mpeg encoding is VERY slow but in the end, you’ll get a very clear video that takes up very little space compared to the huffyuv avi that we rendered out from Premiere.