Does nvenc_hevc work in OBS?

asebux

New Member
Do you know how to record lossless nvenc_hevc? These settings return a variable frame rate instead of the constant 60 fps.
146627287-779783b0-c18e-43de-9ba7-25556fc81735.png

146627608-51210ea6-6385-4953-983b-1c231a52de86.png
 

koala

Active Member
You set a tiny bitrate of 2500, this is a constraint the encoder will always adhere, and you used the wrong parameter format in the video encoder settings, so you got garbage as output.
You also forgot to set full color space. Without this, it's not really lossless.

With these settings I achieve lossless with nvenc_hevc, as long as the bitrate doesn't exceed 2.2 gbyte/s. The bitrate is dynamically adapted to the content and goes right down to below 100 kbit/s if you just record blank space. The fps is constant according to MediaInfo.
1639959301630.png


I used color format i444 and color range full and compared a direct screenshot with an exported image from the video with an image editor: They are identical.

But more sense will make encoding settings similar to "Indistinguishable quality, large file size" in h.264 simple output mode, which you achieve with video encoder settings like "rc=vbr cq=24" instead of the above. As bitrate, use 100000. The encoder will use constant quality of 24 (VBR-CQ is similar to the CRF rate control of the x264 encoder) with a variable bitrate but not exceed 100000 Kbps. According to my research about hevc, a constant quality parameter of 24 or lower cannot be distinguished from the original material by the human eye.
 

asebux

New Member
I believe that all bitrate settings are ignored when using the lossless preset. Are you sure you have lossless? Can you open this image in MS Paint, capture and post the resulting hevc file here?
 

Attachments

  • color_grad.png
    color_grad.png
    258 bytes · Views: 11

koala

Active Member
Here it is. Zipped, since the forum software doesn't accept plain *.mp4. It's in fact lossless with an occasional +-1 rounding inaccuracy at some pixels. I used my above settings, although a 2.2 Gbyte/s from above isn't actually supported by the encoder - I used a bitrate value of 500000 Kbps.
You seem right with the bitrate. Using just 1000 as bitrate and recording real stuff instead of a static image will use as much bitrate as required, so with preset=lossless the bitrate value seems to be ignored.
Your original issue is probably due to the wrong format of the options. The format is "option=value option2=value2", not "-option value -option2 value2".
 

Attachments

  • 2021-12-20 19-44-26.zip
    129.4 KB · Views: 7

asebux

New Member
It is not lossless. The first is the source file, the second is your result:
 

Attachments

  • out-001.png
    out-001.png
    2.9 KB · Views: 23

koala

Active Member
If you say so, ok. If I take a picture from the video and overlay the color stripe with the original png and let paint.net compute the difference between both, the difference is pitch black with random values between (0,0,0) ... (1,1,1) , i.e. the difference between both is within the definition of "lossless". It's not bit-exact, but it's still lossless.
If you mean the grey border around the color stripe: that border is added by the app I recorded (paint.net). It's not part of the color stripe.
I'm not sure what you're aiming at. Take my settings as starting point for your own research or leave it.
 

DayGeckoArt

Member
As far as I know the only way to get true lossless, as you define it, is to record to uncompressed video. Re-compressing video or photos always changes them in some way. If it's a streaming video you're recording, you could also find a way to capture the actual stream which may be impossible
 
Top