[x264-devel] aqp and bit rate if content is static

Johannes Ebersold johannes.ebersold at dfki.de
Wed Mar 28 13:45:22 CEST 2012


Hi,

I have some questions concerning Adaptive Quantization as well as Intra 
refresh, both used in an low-latency streaming setup.

But, first a few words on the the setup: We use x264 to encode an image 
stream provided by an renderer. The encoded video stream is sent to an 
client using an RTSP stream.

However, we would like to have something like low-latency, high-quality 
and low band width, which is of course nearly impossible :)
Thus, we use adaptive quantization and add aqp modifiers based on the 
rendered image in order to achieve high quality for interesting regions 
and low quality for regions somehow not interesting. We use crf of 
default value 23 and modify the QP in a range from -25 (achieving nearly 
highest quality) to 5 (lowering the quality somewhat). Since the regions 
of interest are rather small we save up band width compared to encoding 
without modifying the QPs.

Since the renderer renders new images only on user interaction, we often 
have long times in which no changes of the streamed image happens (e.g. 
3 minutes and more) and the same image is feed to the encoder until a 
new image appears. We now implemented an iterative process, which 
increases quality (by decreasing QPs to 0) in 10 steps, which means, 
that after 10 consecutive frames without content change we should have a 
"perfect" picture.

In order to achieve low latency, we additionally employed intra-refresh, 
triggering intra refresh every time the image content changes. We also 
using the superfast preset, no tuning.

Thus far, this works well, but we expected that, the band width would 
drop to nearly zero, after an optimal image was encoded and the content 
does not change anymore for the next x frames. Since the encoder could 
now use skip-blocks all over the place. However, the bit rate does not 
drop, instead it is constant and really high, which must be because of 
the high quality.

Now the questions:
- Why is does the band width not drop after reaching an "highest 
quality" image? Did we miss something? Shouldn't the bit rate drop 
towards zero if the content does not change?
- We modify the QP based on the QPs choosen by x264, however, those 
choosen QPs (crf 23) vary somewhat. Is there a way to see the chosen 
QPs, preferably on macroblock base?

And finally the list of options we use:
preset = superfast
threads = 1
i_scenecut_threshold = false
i_keyint_min = 1000
i_keyint_max = 10000
b_intra_refresh = true
rc.i_aq_mode = X264_AQ_VARIANCE
rc.f_aq_strength = 1.0f
i_rc_method = X264_RC_CRF
f_rf_constant = 23
b_repeat_headers = true
b_annexb = true
profile = baseline

Thanks for any answer and help on this topic :)
Johannes


More information about the x264-devel mailing list