Constant Quality/CRF Mode on NVENC

Drexel2k

New Member
Hello,

it would be nice if you offer beside constant quantization on NVENC also a constant quality mode for NVENC. For the software renderer you offer CRF as constant quality mode, but for NVENC you don't.

I experimented a little bit with the ffmpeg output to achieve this. The main parameters for this are:

preset=hq profile=high rc=vbr cq=16 b=0 maxrate=960000000 bufsize=960000000

profile high, level should 6.2, b (bitrate) 0, maxrate 960000000 bufsize 960000000 to not limit bitrates. Level 6.2 is set automatically with these setting, if I remmber right I had problems setting this explicitly. maxrate and bufsize are the maximum accepted values.

rc vbr and cq are the settings for a constant quality.

Maybe you could consider this in future updates.

Best regards
 

RealNC

New Member
I second this. Being able to use NVENC's CQ mode would be very neat in order to keep file sizes in check. especially for recordings that are hours long rather than minutes.
 

horiac

New Member
Hello!

I would also wish for this feature to make it in the official user interface, but it's still not there. Thankfully, it works with "Custom Output (FFmpeg)". I've used it for a while with the StreamFX plug-in, but it's not compatible/released for version 28 of OBS at the moment.

As I see it, it would be a matter of exposing the CQ and Bufsize parameter in the current VBR mode configuration. I believe the rest are already available as inputs.

For those interested, these are my parameters of choice, which produce the desired constant quality mode:
Code:
Container Format: 
mp4

Video Bitrate: set to 0 (its set below, in Video Encoder Settings)

Keyframe Interval: 240 (4 seconds at 60 fps), adjust to your liking

Video Encoder: h264_nvenc

Video Encoder Settings:
preset=p6 profile=high rc=vbr cq=26 tune=hq rc-lookahead=8 bf=2 b=0 maxrate=120000000 bufsize=240000000

Audio Bitrate: 160 kbps, aac

The 120M and 240M bitrate limits are set so that the resulting file is in level 5.1 limits which is more compatible with video editors etc.
 
Top