Published on by

I am pissed off by people producing junk videos so I want to give some advice here:

  • Do not encode interlaced material without selecting proper encoder option — you will destroy the video quality and compression will suffer as well.
  • Do not use bob and weave deinterlace methods — they suck and you get horrible ghosting with fast moving subjects. If you don't want to deinterlace properly (by using TempGaussMC), then don't deinterlace at all, just tell the encoder to encode as interlaced.
  • Do not use variable bit rate for audio. It is simply not necessary. Leave original AC3 audio if it is multi-channel, and recode to 128 kbps CBR mp3 for stereo sources.
  • For x264 do not use Level higher than 4.1 unless absolutely necessary. Higher levels cause issues with hardware accelerated playback and need either GPU capable of DXVA, or a high-end computer for decoding and playback.
  • Never embed subtitles into video directly. Even if you are making MKV file, leave them out — that way people can use their own subtitles.
  • Do not use bitmapped subtitles — use UTF8 encoded text files in .SUB or .SRT format.
  • Do not use default keyframe interval — it is way too sparse. One keyframe every 10 seconds makes it hard to seek precisely, and with higher x264 levels and a lot of bi-directional reference frames it makes seeking extremely slow. Use keyframe interval of 1 second (30 frames for 30 FPS video, 25 frames for 25 FPS video and so on).
  • Use constant bitrate or constant quality for encoding.
  • Never resize or crop interlaced video.
  • Do not use MKV container format just to be able to create chapters — split the original video to chapters, encode them separately, and make a playlist instead.
  • Aspect Ratio — instead of boring you with details (it is terribly complicated anyway) I will just tell you that you either need to mark the proper aspect ratio in the output mp4 video stream (many players can read that even if you put mp4 into AVI container), or to resize the video so you have proper aspect ratio when the player uses 1:1 scaling. For example, if you have 720 x 480 NTSC video which isn't letterboxed it should be 16:9 but 720 / 480 gives 3:2. To get undistorted picture you will need to resize to 720 x 405. Since 405 is not divisible by 4 (encoder requirement) you will use 404. If you have non-letterboxed 640 x 480 NTSC, you will resize to 640 x 360. For PAL, 720 x 576 gives 5:4 while we need 4:3. Resize to 720 x 540. Remember to resize and/or crop AFTER deinterlacing.
  • Someone will ask, why not resize 720 x 576 to 768 x 576? It's simple, never upsize video when correcting aspect ratio — you cannot restore detail which isn't there to begin with, and you are just making the picture bigger thus needing more bits to encode it with the same quality. If you do not allocate more bits (by using higher bitrate or higher quality setting) you will end up with worse video quality.

There, that should be enough to get you on a right track. I will update the article if I remember anything else that might be usefull or important to know.