x264enc - changing the quality

Ian Davidson id012c3076 at blueyonder.co.uk
Mon Dec 7 04:39:59 PST 2015


My *real *application records live video and uses x264enc to encode it. 
The compression is 'a bit too aggressive' for my liking.

I have written a program to convert a short video using x264enc to 
encode it so that I can compare the result using different levels of 
compression – (both video quality and file size).

I have read elsewhere that “The range of the quantizer scale is 0-51: 
where 0 is lossless, 23 is default, and 51 is worst possible. A lower 
value is a higher quality and a subjectively sane range is 18-28. 
Consider 18 to be visually lossless or nearly so” and that “increasing 
the CRF value +6 is roughly half the bitrate while -6 is roughly twice 
the bitrate ”.

I notice from gst-inspect that the x264enc plugin has a property 
“quantizer” (Constant quantizer or quality to apply … Unsigned integer. 
Range: 1-50 Default:21)

I converted a 4 minute video using the default settings and the output 
file size was 31.4 MiB.

I then changed the value of the quantizer using this line

g_object_set (G_OBJECT (videnc), "quantizer", 18, NULL);

and ran the program again. This time the file size was 31.4 MiB – so no 
change. I would have expected the file to be somewhat larger.

So,

  *

    did I not actually change the property (I did not see any indication
    that the line had failed)

  *

    should I have changed something else (as well)

  *

    should I have done it differently

  *

    does x264enc ignore that property



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20151207/35532374/attachment.html>


More information about the gstreamer-devel mailing list