Question about H265 and Keyframe Intervall

Librewolf

New Member
What is the difference between those two encoding options: hevc_nvec (nvec_hevc) VS nvec_hevc
Are they both H265? Then what is the difference? Performance? Compatibility?



hevc_nvenc.PNG


nvenc_hevc.PNG


Next question, what does the Setting Keyframe Intervall do?
I have been doing my own research just right now, from my understanding there can be blury frames inbetween the keyframes.
But i could not find any information on what the setting does. 250 was the default setting and i have read setting it to 0 means auto detection.

What happens if i lower or increase the number? Performance, input lag, delay, quality etc, can anyone please provid a depth explenation on this setting, thank you!
Keyframe Intervall.PNG
 

koala

Active Member
hevc_nvenc and nvenc_hevc are one an the same. Just different names.

Keyframes (or "intra coded" frames, abbreviated with I) are anchors in the encoded frame sequence. They contain a full frame, so they are huge in terms of space (bytes) needed. Frames between key frames contain only the difference between one of the last frames and the current frame, so they are quite smaller. These are called predictive coded frames (or P), and these are what makes encoded video data really small.

If you order a media player to seek to some position, the media player locates the nearest keyframe (I) in the data, then decodes all P frames until it reaches the desired location. So you want a key frame once in a while to make seeking not too slow. Too much keyframes bloat the video, and too less makes it unwatchable due to endless seeking.

A sane value is one keyframe every 1, 2 or up to 10 seconds. Youtube recommends 2 seconds. In the ffmpeg output above, you configure the amount of frames (if you have a 60 fps video, enter 120 to have a keyframe interval of 2 seconds). In the simple or advanced output mode, you directly enter the number of seconds, since OBS computes the actual interval internally.

In a constant bitrate rate control video, like the one you configure above, a too small keyframe interval will produce bad quality, because all the bitrate is consumed by the huge key frames, so all frames need to be compressed really high (=detail removed) to fit the bandwidth.

If you want to know more detail, see https://www.google.com/search?q=keyframe+interval
 

Librewolf

New Member
I do not beleve that hevc_nvenc and nvenc_hevc are one an the same simply because if this was the case there would only be one option in the dropdown menu for video encoders and it would be called hevc_nvec or nvec_hevc but the fact is there are two options, so there must be some sort of different, and that cannot be the name because it makes zero sense. If there was absolutly no difference then why would anyone make the effor to create two different options for encoding when they are the exact same, so i cant beleve there is no difference.

So if i want to configure my settings to use keyframes every 1, 2 or up to 10 seconds what value must i set the Keyframeintervall to?
I guess (might be mistaken) if i want to use a keyframe every 2 secconds, i must put the value 2 into the setting?

This are my recording settings before i started experimenting with h265 (see screenshot)
settings.PNG


It would be interesting to know why NVENC H.264(new) does not show the option to edit Keyframe Intervall, but what is more interesting for me is what preset of Keyframe Intervall is coded into the above recording settings (H264)? I cant see the option so its impossible for me to know.
If i would know the Keyframe Intervall from the above settings i could simply use them with H265.

I still have no clue how to determine which keyframeintervall i should use.
 

rockbottom

Active Member
Incorrect, as Koala told you earlier they are the same.

Key Frame Interval = 2

For HEVC you need to go back to the custom FFMPEG output or install the StreamFX plugin.
 

rockbottom

Active Member
Here are the settings I'm currently using for HEVC recording, along with my custom Video Encoder Settings, make adjustments as needed. I'm recording @ 30FPS so I have my Keyframe Interval set at 60 Frames = 2 Seconds.

preset=hq profile=main tier=high rc=constqp rc-lookahead=0 init_qpI=15 init_qpP=18 init_qpB=20 bf=0 b_ref_mode=disabled refs=4

1627062740230.png
 

Attachments

  • 07-23 NVENC Settings.JPG
    07-23 NVENC Settings.JPG
    91.7 KB · Views: 68

koala

Active Member
A more generic config with more defaults and less customization is this: it basically just changes rate control to constqp instead of cbr and leaves the rest at ffmpeg defaults.
1627064124702.png


@Software.exe To get the complete option help for nvenc_hevc/hevc_nvenc, grab an nvenc-enabled ffmpeg binary and call ffmpeg -h nvenc_hevc
 

Librewolf

New Member
Thank you all for sharing your informations.

Now i understand hevc_nvenc and nvenc_hevc are the same thing, even when i do not understand why any software programmer would make the effort to offer two different encoding options when they are the same thing. (It just doesnt make sense to me.)


I do not yet understand the keyframe intervall setting, i do understand now what it does, but i am having a hard time determining which setting i should choose for my specific computer.

I have a high end PC, when recording i dont limi my FPS, i can get around 70 - 140 FPS on graphic intense games while recording with 60 FPS in OBS.

Specs info:
2560x1440p (WQHD - 2k)
165Hz refreshrate
165 FPS cap in control panel

Thanks again for helping!
 

koala

Active Member
To get the number of frames for the keyframe interval, multiply the desired number of seconds with the fps of the video.
So if you want a keyframe interval of 2 seconds, as recommended by Youtube for uploads, and you're creating a 60 fps video, multiply 2 with 60 and get 120 as keyframe interval.
A smaller keyframe interval than that is not useful, a larger keyframe interval is a matter of choice.
 

Librewolf

New Member
To get the number of frames for the keyframe interval, multiply the desired number of seconds with the fps of the video.
So if you want a keyframe interval of 2 seconds, as recommended by Youtube for uploads, and you're creating a 60 fps video, multiply 2 with 60 and get 120 as keyframe interval.
A smaller keyframe interval than that is not useful, a larger keyframe interval is a matter of choice.

Thanks for the very helpfull reply.
Are you aware what keyframe intervall H264 uses?
What is the reason there is no option to edit keyframe intervall with H264?

So as you said, if i want a keyframeinterval of 2 seconds, while recording with OBS at 60 fps i should use 120 as keyframe interval?
Does the monitors refreshrate even matter here? For example if i had a 120 Hz monitor or a 240 Hz monitor but both of them will only record at 60 fps with obs, should i use 120 keyframe interval in both cases?
 

Librewolf

New Member
Also, i did not understand what you ment saying this:
To get the complete option help for nvenc_hevc/hevc_nvenc, grab an nvenc-enabled ffmpeg binary and call ffmpeg -h nvenc_hevc
How/Where do i grab the binary, and where/how to call?

I am really only familiar with the very basics of OBS so far..
 

koala

Active Member
This is now going out of scope for OBS Studio. Please make yourself familiar with how h.264 and h.265 works, and what ffmpeg is and where you get it. Google is your friend, honestly. Appropriate search keywords are ffmpeg, keyframe interval, download, h.264, h.265.

It seems you're struggling with basic video encoding know-how. In this case I really recommend you use simple output mode of OBS, no advanced mode and especially not the custom ffmpeg output mode. In simple mode, OBS applies optimal best practice settings that have evolved with the experience of several years. This will get you a definitely better video quality than any custom output settings you don't know about.
 
Top