Limit Max Bitrate in CQP Mode

Augur89

New Member
Hi,

i would like to limit the max bitrate to 150000 kbts when using the Nvidia Nvenc H264 Encoder with CQP Mode and CQ Level 25.
I'm recording in 4K and in some scenes, it uses bitrates up to 400000 kbts, which is way too much for me.
On the other hand, if i increase the CQ Level above 25, the quality in dark or slow scenes gets too bad.

I already tried entering "max-bitrate=150000" into the custom muxer line, but it did not change anything.

does anybody have an advice for me?

Thanks
 

Augur89

New Member
that's not the solution, i'm looking for. vbr or cbr both mean massive waste of bitrate.
i'm looking for a way to limit max bitrate in CQP mode
 

Harold

Active Member
CQP is set up specifically to target the bitrate to match the quality. It does not have the ability to cap.
 

Augur89

New Member
hmm, thats bad news.
so, that means:
  • using high CQ Level → slow and dark scenes will look ugly
  • lower CQ Level → very fast scenes will use up to 400000 kbts even with CQ Level 23 (which is a bad joke)
  • using variable bitrate, which orientates on the default bitrate value, i enter → if i enter a value somewhere in between, the very fast scenes will look ugly and the slow scenes would have way too much bitrate
  • CBR: no variation at all → for good quality i would have to enter the maximum need bitrate (150000) for everything → maximum possible waste of resources
i still can't believe, that the encoder doesn't offer such a basic function like limit max bitrate

is there anything, i forgot? anything that helps?

Thank you for your help
 

Looking4help

New Member
I don't know if it's different on NVIDIA hardware but VBR bitrate input field is for max allowed bitrate, not an average, it'll use far fewer bits if the scene does not require it.

You could also try using h.265 or AV1 or downscaling the output canvas 1 or 2 notches, as that is a minimal image quality drop at such a high resolution.
 

Augur89

New Member
no, vbr works with a target bitrate. it differs slightly, bit if you set it to 40000 for example, it doesn't go up over 50000 or far down.
that's not what i need if i have scenes with big variance of required bitrate. for example some scenes are good with 600-1000 kbts, other scenes require 150.000 kbts. that's nothing, vbr can handle if there isn't a command, that allows it to differ a lot from the target bitrate. at least, it would require a min bitrate field. how should the script decide otherwise, on how far it can go down with the bitrate without a cq level or a min bitrate?
 

koala

Active Member
i still can't believe, that the encoder doesn't offer such a basic function like limit max bitrate

is there anything, i forgot? anything that helps?
You didn't forget anything. That's the way encoders works. There might be quality based rate control modes that also limit bitrate, but it's dependent on the implementation within the encoder. OBS is just exposing the encoder parameters of the library it calls. It cannot expose what isn't there.

This "rate control" setting is exactly what it says: it selects the function within the encoder that controls the bitrate of the encoder output. See here for a comprehensive general explanation of many different rate control modes: https://slhck.info/video/2017/03/01/rate-control.html
Keep in mind not every encoder supports every rate control function. CQP is available everywhere, because it is the most simple, the generic operating mode of the encoder, and CBR as well because of streaming requirements, but every other rate control might or might not exist.
 

TryHD

Member
i still can't believe, that the encoder doesn't offer such a basic function like limit max bitrate
nvenc does offer that but not the implementation in OBS because jims nvenc implementation is pretty sucky sucky and lacks many option and VBR is straight up broken there.
You could try to it it via ffmpeg there you can set stuff yourself.
 
Top