[MEncoder-users] Experiences of video encoding

Corey Hickey bugfood-ml at fatooh.org
Tue Mar 27 00:32:55 CEST 2007


Nicolas George wrote:
> Le sextidi 6 germinal, an CCXV, Dominik 'Rathann' Mierzejewski a écrit :
>> Well, using constant quantizer is not a good way to test real-world
>> codec quality IMHO. Most people I know encode at certain target bitrate
>> and so do I, which makes this comparison of less interest to me.
> 
> For the use I have of video encoding, setting the quality seems more
> relevant than setting the bitrate. For example, I do not see any reason to
> have better quality for movies in 2.35 than for movies in 1.85, which would
> be the case if I select the same bitrate for both. Other people have
> certainly other needs.

Some people set a target bitrate in order to end up with a certain file 
size, but that isn't the only reason to do so. Using a target bitrate 
allows the encoder to vary the quantizer in a way that is likely to 
improve overall visual quality. Usually this means that high-motion 
scenes get higher quantizers and low-motion scenes get lower quantizers, 
since artifacts and loss of detail are less noticeable when the scene is 
rapidly changing.

For example, lets say you encoded a video with a constant quantizer of 
5. You look at mencoder's output (or do the math) and find out that the 
average bitrate was 700 kbit/sec. If you then do a 2-pass encode with a 
target bitrate of 700 kbit/sec, the second file will be very nearly the 
same size as the first, but it should look much better because data is 
allocated where it matters more. I say "should" because human perception 
is subjective, but with any encoder that has reasonably well-tuned 
ratecontrol, I expect the difference will look better to nearly everyone.

Be that as it may, a comparison of codecs that only uses numerical 
analysis is probably more fair when working with constant quantizers 
only. Lavc's ratecontrol can be tweaked somewhat (see vrc_eq in the 
mencoder man page), and this can have an effect on both PSNR and 
perceived quality. Depending on your personal preferences, the change in 
PSNR may or may not correspond to the change in quality. Similarly, 
different codecs can use different ratecontrol methods entirely, and 
this can affect both PSNR and quality, though not necessarily in the 
same direction.

That doesn't mean I'm saying constant-quantizer is better for testing, 
however; as I previously mentioned, setting a target bitrate and using 
2-pass encoding should make the video look better, and the different 
codecs' ratecontrol methods will affect the final quality. The only 
really fair way, of course, is to use your eyes (or other people's 
eyes), but I understand that's not practical with more than a few samples.

By the way, nice job with what you're doing so far; I know a large test 
like that takes a substantial amount of work.

-Corey



More information about the MEncoder-users mailing list