[x264-devel] Constant QP with VBV

Rodney Baker rodney.baker at iinet.net.au
Sun Feb 12 17:01:09 CET 2012


On Mon, 13 Feb 2012 01:36:22 Tsahi Gilk wrote:
> Hi,
> 
> I want to encode videos with constant QP and maximum frame size. I don't
> care about average bitrate. CRF does not meet the target QP I requested. I
> tried to use -qp with -vbv-bufsize and -vbv-maxrate, but I get a warning
> "VBV is incompatible with constant QP, ignored."
> 
> I came across xsplit documation who claims to do with x264 exactly what I
> want to do: "XSplit uses quality based encoding and sets a VBV-maxrate and
> VBV-buffer. This basically means that the x264 encoder in XSplit tries to
> maintain a constant quality of the stream and can use less bandwidth in
> less complex or less important scenes. The VBV-maxrate puts a ceiling to
> the bandwidth that encoder can use, but relative to the VBV-buffer. "
> 
> What are the proper parameter to achieve constant QP with VBV?
> 
> Thanks.
> 
> Tsahi.

The x264 devs will soon pipe up if I'm wrong on this, but the "q" in --qp does 
not specify quality, but the quantisation factor. The lower the number, the 
lower the compression (and loss) and the higher the quality (and vice versa). 

--qp 0 says, "don't do quantisation" i.e. do lossless encoding. The feedback 
is right - this is incompatible with variable bit-rate video encoding. I 
suspect XSplit does not set --qp 0, since it speaks of attempting to maintain 
constant quality, not constant quantisation factor. Normall the quantisation 
factor will vary with scene activity in inverse proportion to the % motion in 
the scene.

--crf = constant rate factor. The cli help is not clear which direction it 
works (range 0-51, def 23) but you may want to experiment with different 
values here to see the effect (try, say, 5 and then 45). 

You did say that you're not interested in maximum frame size - therefore I'm a 
bit bemused as to why you would set vbv-maxrate anyway. Just use --qp 0 and do 
lossless encoding - that will guarantee maximum frame size.

HTH.

-- 
===================================================
Rodney Baker VK5ZTV
rodney.baker at iinet.net.au
=================================================== 



More information about the x264-devel mailing list