PDA

View Full Version : H264 encoding options


Wasser
27th June 2007, 03:22
Well, I'm not too good understanding all the options that are provided with x264, but something I'm sure: when I'm trying to encode something and virtualDUB asks me for the codec that I want to use I select x264 and in the configuration window, I understand that if I lower the bitrate I get a crappier image quality and a smaller file. What is the difference selecting via bitrate the quality and the quantizer option that I can choose in this tab? Is it better to use the quantizer option instead of the bitrate one? and last, what's the difference between a multipass encode and a 1 pass? Is it so much different?

Sorry to ask so many questions, but is the basic that I need to know when I encode something for me :P

Thanks!

Dark Shikari
27th June 2007, 03:59
These options apply for basically all modern codecs.

Constant Bitrate: Bad, bad, bad. High-action scenes require more bitrate to get the same quality as low-action scenes (and so forth), so constant bitrate means that the same number of bits have been allocated for each second, ignoring this fact. Constant bitrate is usually used for internet video streams, and thats about it.

Target Bitrate: Gives you a specific bitrate. However, one-pass mode is very bad at this, as the encoder has little idea how much action and motion the video has! It basically has to guess, and so the results will often be way off-target. This is why you use two-pass mode when using a target bitrate.

Constant Quantizer: Uses a specific quantizer to encode each frame. Ideally this would mean a constant quality, but it isn't really as sometimes the same quantizer can yield different quality levels. What it does do is allow you to do a single-pass encode that doesn't suck, and define an overall quality level that you want the clip at.

Constant Quality (in H.264, CRF [Constant Rate Factor] mode): Tries to actually get a constant quality. In H.264, the number given is between 0 (lossless) and 51 (total crap). 25 is pretty good quality, 35 is mediocre, 15 is almost visually equivalent to the original. Note that this mode does not exist in Xvid and some other popular codecs.

Note that the last two modes don't let you define a bitrate; they let you define a quality level. Based on how much motion and such in your video, this may require more or less bitrate. Both of the last two modes also require only one pass, which is their primary advantage.

The other thing that affects quality are the various encoding options, which sacrifice encoding speed for quality.

foxyshadis
27th June 2007, 05:35
Constant Quality (in H.264, CRF [Constant Rate Factor] mode): Tries to actually get a constant quality. In H.264, the number given is between 0 (lossless) and 51 (total crap). 25 is pretty good quality, 35 is mediocre, 15 is almost visually equivalent to the original. Note that this mode does not exist in Xvid and some other popular codecs.

For reference, this also doesn't exist in the vfw (virtualdub-compatible) x264, which is one of the better reasons to move to avidemux or an encoder gui like megui. Typically CRF offers better overall quality than Constant Quant for the same size, except in places you're very unlikely to notice, because of the way decisions are made.

All of the x264 options are explained in detail in Megui's documentation (http://mewiki.project357.com/wiki/Video_configuration_dialog/X264_Configuration).

Wasser
27th June 2007, 19:16
So, the way to go is Constant Quality? I'm going to try using MeGUI. I will have to test if I'm capable of using it. I'm not a person that understands a lot so if it's easy to do, I will be capable. After I finish my first encode, I will post my results :D

Thanks to both of you! Very, very, grateful