High Quality Streaming with NVIDIA® NVENC (in OBS Studio) (2024)

Streaming with more than one PC has been the leader in H.264 encoding for years, but NVIDIAs Turing and Ampere generation has put a significant dent into that lead. The new generation of GPUs with the brand new encoder brought comparable quality x264 medium – if you can find a GPU that is. Let’s take a look at what’s needed to set up your stream for massively improved quality.

Modern OBS Studio has two ways to achieve the expected quality: the built-in NVENC H.264 (new) and the addition from StreamFX called NVIDIA NVENC H.264/AVC (via FFmpeg). Both Options can achieve similar quality to x264 medium, but the latter is able to exceed that and rival x264 medium/slow in various situations. Whichever you pick, both of them support zero-copy encoding, and they’re both valid options for streaming.

Built-In: OBS Studio NVENC H.264 (new)

The simplest option is the built-in NVENC encoders which offer less flexibility, but gets you started on the path of quality quicker. Depending on which GPU generation you own, you will be able to reach different peak quality levels: Kepler may reach up to x264 superfast, Maxwell and Pascal may reach up to x264 veryfast, Volta may reach up to x264 faster, and Turing and Ampere may reach up to x264 fast.

OptionKeplerMaxwellPascalVoltaTuringAmpere
PresetMedium (P4) up to Slowest (P7)
As with all encoders, higher presets have diminishing returns for much harsher performance impact.
TuneHigh Quality or Low Latency or Ultra Low Latency
Choose between focusing Quality or (much) lower encoding Latency.
Multipass ModeTwo Passes (Full Resolution) or Two Passes (Quarter Resolution) or Single PassImproves bitrate distribution and often quality.
Profilehigh or main
High enables additional codec features that improve quality.
Look-aheadEnabled
Enables Look-Ahead as well Adaptive I-Frames and Adaptive B-Frames.
Psycho-Visual TuningDisabled or Enabled
Enables Spatial Adaptive Quantization at Strength 8 and Temporal Adaptive Quantization.
Max B-frames0 to 4
May improve quality or reduce quality, depending on the situation. Most gaming content only uses up to 2, while most real world content can use much more. Look-ahead should always be enabled for more intelligent B-Frame placement.

StreamFX: NVIDIA NVENC H.264/AVC (via FFmpeg)

With StreamFX's NVENC integration it is possible to edge out a lot of additional quality out of NVIDIA NVENC in many situations. This however comes with a hefty cost in complexity, and requires much deeper understanding of both the H.264 specification and NVIDIA NVENC. Most GPU generations can expect to reach a peak quality two x264 presets higher than with the built-in NVIDIA NVENC encoder. As this option is aimed at people with deeper knowledge of both the standard and NVIDIA NVENC, non-critical settings are omitted.

OptionKeplerMaxwellPascalVoltaTuringAmpere
PresetMedium (P4) up to Slowest (P7)
As with all encoders, higher presets have diminishing returns for much harsher performance impact.
TuneHigh Quality or Low Latency or Ultra Low Latency
Choose between focusing Quality or (much) lower encoding Latency.
H264
ProfileHigh or Main
High enables additional codec features that improve quality.
LevelAutomatic
Some problematic Driver versions require you to manually set the H.264 Profile Level.
Rate Control Options
ModeConstant Bitrate
Multi-PassFull Resolution or Quarter Resolution or Single Pass
Improves bitrate distribution and may improve quality.
Look Aheadat least 8 frames
Enables adaptive functionality and may improve temporal quality. Has diminishing returns.
Adaptive I-FramesEnabled or Disabled
Improves quality in many games, but may not work with all streaming services. Requires at least 2 frames of Look Ahead.
Adaptive B-FramesEnabled
Requires at least (1 + Number of B-Frames) frames of Look Ahead.
Adaptive Quantization
Spatial Adaptive QuantizationDisabled or Enabled
May improve perceptual quality by favoring smoother surfaces for bitrate distribution.
Spatial Adaptive Quantization Strength1 (least aggressive) to 15 (most aggressive)
More aggressive behavior means less bitrate available for textured surfaces, resulting in additional noise.
Temporal Adaptive QuantizationEnabled
Other Options
Maximum B-Frames0 to 4
May improve quality or reduce quality, depending on the situation. Most gaming content only uses up to 2, while most real world content can use much more. Adaptive B-Frames should always be enabled for more intelligent B-Frame placement.
B-Frame Reference Mode"Each B-Frame" or "Only B-Frames/2"
Situational, more references may actually reduce quality significantly as more reference slots are used.
Zero LatencyDefault
Weighted PredictionDefault
Non-reference P-FramesEnabled
Reference Frames-1 frames to 16 frames
May improve quality at higher values, but also drastically reduces device compatibility and drastically decreases performance.
Low Delay Key-Frame Scale-1
When Low Latency or Ultra Low Latency tune is used, should either be left at -1 or manually adjusted. Can drastically affect quality and latency.
  • The old presets were deprecated by NVIDIA and now map to the new P1-P7 presets, which come with massive performance or quality boosts. High Quality is now Medium (P4), while High Performance is closer to Faster (P2).

It is no secret that H.264/AVC is now an outdated codec which should have been replaced long ago. Still we can do something to achieve more quality from NVENC, through the careful choice of resolution, framerate and bitrate. Below are quality metrics based on VMAF for a Canvas Resolution of 2560x1440 with 60 FPS scaled to different Output Resolutions:

Output Resolution3.5mbit6.0mbit8.5mbit
640x36077.925884.107887.0414
960x54077.959284.108387.0381
1280x72077.954184.109587.0325
1920x108077.932384.076487.0543

We can made an okay educated guess at the maximum resolution for each bitrate with the above table. For 3.5mbit the maximum resolution is 960x540, for 6.0mbit the maximum resolution is 1280x720, and for 8.5mbit the maximum resolution is 1920x1080. For some more action packed content it is best to reduce the resolution slightly in order to maintain decent quality, while slower or rarely moving content can sometimes increase the resolution slightly.

Final Words

In the past few years NVIDIA has made massive improvements to their encoder, which has evened the playing field far beyond what was expected. With no need to transfer frames from the GPU to the CPU, and quality comparable to x264 medium (or better), NVIDIAs Turing NVENC is pushing the boundaries of what is possible in a single consumer PC.

Whether you use it or not is entirely up to you however. If you already have a working Dual-PC setup that can achieve x264 medium (or better) quality, then you don’t gain much from moving to Turing NVENC. But if you’re currently stuck on anything below x264 medium, or have a Turing GPU ready to test it out – why not give it a shot?

High Quality Streaming with NVIDIA® NVENC (in OBS Studio) (2024)

References

Top Articles
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 6437

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.