6

I’m aware of techniques to give the encoder freedom to ramp up bitrate for relatively complex sequences, but this has the consequence of inflating the overall bitrate compared to whatever was desired for the more typical scenes.

Is it possible to loosen the bounds on the encoder, to give it more degrees of freedom with bitrate, over predefined intervals?

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
Louis Waweru
  • 23,945
  • 39
  • 132
  • 198
  • Do you mean to imply variable bitrate (VBR) inflates the size of an x264 video when compared to constant bitrate (CBR)? Or something else? Like does the concept of VBR [as explained in this post](http://superuser.com/questions/536001/variable-bit-rates-with-vb-and-minrate-maxrate-settings-in-ffmpeg) help you? – Giacomo1968 Feb 18 '15 at 06:06
  • @JakeGould I meant that VBR can have a target bitrate, but there are rate control settings that let it fluctuate to give more complex scenes more bits... So for parameters like bitrate variance or quantizer compression, can we apply more liberal ones for certain parts of the encode? Kind of like how there is a specific quantizer setting for end credits. (Giving the encoder more breathing room gives better results for otherwise bit starved scenes, but bumps up the bitrate across the board) – Louis Waweru Feb 18 '15 at 06:20
  • Ahhh… Okay… This is definitely a good question, but out of my skillset. What would you be using to encode? FFmpeg? If so I would make that a bit clearer in your question; you know there are tons of video encoding experts here. Good luck! – Giacomo1968 Feb 18 '15 at 06:22
  • 1
    @JakeGould Me too, I'm kind of expecting an answer about splicing different encodes together... – Louis Waweru Feb 18 '15 at 06:36
  • Good question. It's not possible to define specific intervals in which the constraints are loosened. I'm curious.. When you say increasing the "freedom" results in overall higher bitrate, can you give a specific example? Are you doing one pass or two pass CBR? Or VBV encoding? – slhck Feb 18 '15 at 06:57
  • out of my skillset too, but doesn't 2-pass attempt to do that? – Tetsujin Feb 18 '15 at 08:05
  • 1
    @slhck Okay, thanks... had to ask. I was talking about 2-pass VBR and CRF mode. The case is when most of the movie only needs a bitrate around x kbps, but the complex scenes need 4x or so: say there's a long scene with a fixed camera of someone laying in bed and thinking out loud. Then suddenly there's a car chase through the apocalypse. I can see how the constraints on sudden variance turn into blocky parts of the encode in cases like this. I feel I should tell the encoder things like, use a bigger `qpstep`, use a high `ratetol`, maybe disable mbtree. But doing trends bitrate upwards allover. – Louis Waweru Feb 18 '15 at 19:10
  • All of that sounds reasonable. Not sure what else you could try, really. I suppose a low enough CRF does that anyway, implicitly, by saving bits where psychovisually not needed. But it depends on the application and end goal. – slhck Feb 18 '15 at 22:04
  • @slhck Heheh, yes, CRF is good enough so it's not so noticeable during playback. – Louis Waweru Feb 18 '15 at 23:50

1 Answers1

3

There is the x264 Zones parameter:

x264 --fullhelp
...
    --zones <zone0>/<zone1>/...  Tweak the bitrate of regions of the video
                            Each zone is of the form
                                <start frame>,<end frame>,<option>
                                where <option> is either
                                    q=<integer> (force QP)
                                or  b=<float> (bitrate multiplier)

Use it like so: --zones 400,500,crf=10

I think this describes it best.

Mathias
  • 196
  • 5