Youtube Upload and Streaming Quality Notes.

I played around with Quicksync today. I hadn’t done that yet, with the new videocard. As I mentioned previously, OBS had trouble interrupting the frames from my old videocard. X.264 and Quicksync both look better now. Yeah, Quicksync really surprised me today. I updated my thoughts on it, in the giant post above.

Suggested Encoder settings in OBS, for streaming.

NVENC:
Select the “New” NVENC encoder.
Rate Controle CBR (its what Twitch wants. VBR and its variations can cause dropped frames, audio desync, etc)
Choose whatever bitrate you want. I think non-partnered streamers are capped somewhere after 6,000kbps.
Keyframe interval 2 (its what Twitch wants)
Preset “Max Quality”
Profile “High”
Ignore both “Look ahead” and “Psycho Visual Tuning”. These are cool options, in theory. But Nvidia’s current implementations need more work. In my testing you experience overall lower quality with either option turned on.
“GPU” Leave this at 0 unless you have more than one graphics card in your system.
Max B frames: You may be familiar with “b frames” in other encoders. But it doesn’t necessarily work the same, here. Set this to “2” for games with a lot of fast motion. Especially 3D games where the entire screen can move and rotate. For slower games with occasional fast motion, you can try 3, to get more overall detail. But lose some solidity and detail during motion. For really slow games (I’m thinking like Shenmue, walking simulators, etc) or practically static, set b frames to 4. (I still need to try these with sidescrollers or an isometric game such as Zelda.)

Try these settings as a local recording, before streaming. If the resulting video file has a lot of pausing in it, it means that the settings you are using to run the game, are nearly maxing out your GPU and its not leaving enough left over for NVENC. You can do a few things to fix this:

  1. lower some game settings
  2. Change the quality preset from “Max Quality” to “Quality”. “Max Quality” uses your shader cores (Cuda) in additon to the NVENC encoder chip. Quality uses less shader power or maybe even none. If you still have pausing, try “Low Latency Quality”.
  3. If you are totally plagued by pausing and hitching with NVENC and you don’t want to drop your game settings further, try the NVENC encoder which is not labeled as “NEW”. Its the old code path, which does not use Shader power at all. Its still pretty good quality.

Quicksync (these settings are based on Intel’s Kaby Lake or newer. Some of these options may be missing, on older CPUs. If they are, feel free to ask about it here. I’d be interested to hear about it.
Also, these settings may change later. I heard about some possibly hidden options for Quicksync, in OBS.

Target Usage “Quality”
Profile “High”
Keyframes 2 (its what Twitch wants)
Async Depth 7 (or whatever your highest available number is) (This is basically a setting which splits up the encoding across the Intel shader cores in an asynchronous fashion, allowing higher quality. Has a lot of effect on overall quality)
Choose your bitrate
Rate Control: Choose “LA”, if you have it. If you don’t have it, select CBR. LA implies CBR, but also activates a “lookahead” feature. And you can choose how many frames ahead. Set it for 11. This basically means the encoder will do 2-pass CBR, 11 frames ahead of real time. Slightly improves overall quality. But has a particular benefit to high motion. However, setting it much higher, can make the combing effect worse during motion. And can cause some other odd behavior to certain visuals. Higher settings are supposedly only meant for really slow paced or static material.

If you are having trouble keeping a smooth recording at 60fps, try changing to the “balanced” preset. And/or try lowering Async Depth until it gets better.

I think “LA” is important to getting the most out of Quicksync in OBS. So, I would leave it on, if you can.

X.264 - X.264 settings are a can of worms. You can mix and match them too much for your own good. I’ve spent a ton of time looking at them. I don’t pretend to know it all. These are my suggestions

Rate Control “CBR” (its what Twitch wants)
choose your bitrate
check the box for “Use custom buffer size” and set the buffer to be the same size as your bitrate.
keyframe interval 2 (its what Twitch wants)
CPU usage preset: If you have a quad core, you probably shouldn’t set this higher than “Faster”, unless you are streaming under 60fps. I would start with “Faster”, because it noticeably cleans up macroblocking, compared to all of the presets underneath it. However, if your game is heavy on CPU usage, you might be forced to go to a lower preset, with a quad core.
Profile “High”
Tune: Personally, I think no tune selected, “Animation”, or SSIM are all good choices to get you started with video games. “animation” is going to be the most resource intensive. But, it should look the best, for most content. SSIM is a small tweak over not selecting any preset. It changes how the bitrate is allocated in each frame. In a way which I think is visually favorable. However, it seems to suffer more under motion. I think it may tweak more options than what I have seen documented. No tune selected uses the default X.264 options, which is a healthy smattering of options and will generally look fine with most anything.

Also, if you are playing a game with a noise filter or a game with a lot of fine details such as fog, rain, or such effects: you can try the “grain” preset, to maybe preserve these subtle details. YMMV with that. I think its a little heavy handed in how it tweaks the settings. But it would take way too much text to explain that and suggest other, custom settings. If you ever have particular trouble with such visuals, of course you can ask about it : )

If you have some extra CPU resources (less than 60fps stream and/or more than 4 cores), You can also try the “fast” and “Medium” presets. Anything higher than that is not recommened for streaming. And is sort of antiquated in terms of what it changes under the hood. At least, in context of a real time stream.

Regarding the spot for “X.264 options”:

Its spot to put in custom commands to tweak things. Each option is separated by a colon. If you put one option by itself, no colon.

Here are a couple of options which may be redundant with “High” profile selected, but if you have good performance with high profile and at least “faster" preset, go ahead and put these in. Or you can try adding them to lower presets, for a small boost in quality:

8x8dct=1:cabac=1:weightp=2 (the first two are options for small gains in compression efficiency. The last option helps keep lighting fades and changes from macroblocking too much).

More stuff

dct-decimate=0 Setting dct-decimate to zero, is another thing which can help with subtle details like grain, rain, fog, etc.

me=umh (you can add this to noticeably improve solidity during motion. Combines especially well with “faster” preset or higher. umh noticeably cleans up blocking and noise, during high motion.)

aq-mode=2:aq-strength=1.0 This changes how the bitrate is allocted in each frame. In a way which is visually positive, in my opinion. Similar to the SSIM preset, distilled into a couple of settings and without the negatives. However, aq-mode=2 is slower than 1. You can set 1 and still use aq-strength for very positive results, with better speed than aq-mode 2.

Trellis=2 (or 1) This is something else you can try, to keep subtle details like grain, fog, rain, etc. Pretty resource intensive for a single option, when set to 2.

Everything below this line are suggestions for gaining some speed with X.264 via your CPU

you can set “profile” to medium, for a possible small performance boost, but also a small visual hit. I don’t recommend “low” profile. But, its there if you need the performance.

try the “low latency” tune. It usually increases macroblocking and can introduce some tearing. But, it can be a pretty dramatic boost and will help you keep your stream framerate high. You can mix the low latency tune with any of the other options for…interesting results!

or you can try these custom options:
subme= “0” or “3” These will greatly increase your X.264 speed. At the cost of overall sharpness and overall fine details. 3 still looks pretty good on detail, but may be a bit noisy. 0 will soften the image, but its fast. and it often doesn’t look as bad as you might think, if you know what these options really mean. You could even try “5”, for a smaller boost, but smaller quality loss.

you can also try
me=dia as a sort of last effort. Will make motion look worse.

And finally, analyse=none or some. “analyse” dictates how X.264 makes choices. The options are none, some, most, all. “Some” will give you a speed boost in “faster” or higher presets, while still partially leveraging any special options. “none” will skip many things, for a large speed boost. But, a large hit to visual quality.

So, a sensible, fairly large speed boost would be:

set profile to “medium” and then add these three options

subme=3:analyse=some:rc-lookahead=1

and/or try the “low latency” tune

1 Like