Technical explanation of OBS settings

Status
Not open for further replies.

R1CH

Forum Admin
Developer
This post contains technical explanations of some of the OBS settings.

General
This section should be self explanatory.

Encoding

Video
Quality Balance
This controls the CRF parameter in x264. Combined with the VBV system, this generally controls the CRF with which static scenes are encoded at. If you specify quality 10, static scenes will look better, but leave less buffer space available if there is sudden motion, resulting in pixelation. Using a quality of 5 or 6 will make static scenes slightly worse, but in the case of motion, quality will be improved. Experiment with this depending on your input, for FPS games and other high activity scenes you probably want this lower than 10. For fairly static games like MTG, FTL, turn based strategy, etc, you can stick with 10 without a problem.

Recommended: Varies, 5-10 depending on source.

Max Bitrate
Basically tells x264 to target this bitrate in kbps. The actual bitrate will vary depending on the complexity of the scene. Set this to around 80% of your upload speed. If you have high upload speed, keep in mind that your viewers will require an equivalent download speed to be able to view your stream, so you probably don't want to go over 3500kbps or so. Keep in mind if you stream at lower resolutions you will not need as high of a bitrate.

Recommended: 80% of your upload speed or 3500kbps (whichever is lower)

Buffer Size
This ties in closely with the bitrate. x264 will encode everything into a fixed size buffer of this size. If there is a sudden scene change and high motion, it can fill up this buffer at a rate faster than the average max bitrate. Eg if you have a bitrate of 3000 and a buffer of 6000, x264 could decide that if a scene is complex enough, to use 5000 of the 6000 buffer at once. This makes your actual network bitrate quite spiky, which can lead to latency issues if queuing occurs on your modem or router. Raising this makes the stream bitrate more spiky but improves quality, reducing this makes the bitrate more tightly controlled and closer to the max bitrate setting. Don't set this too high as the client-side decode buffer will also need to be this big, and you have no control over that.

Recommended: Same as bitrate

Use CBR
This will set x264 into CBR mode. The "quality" setting will have no effect as the quality will be determined entirely by your bitrate, and x264 will try to ensure your stream goes out at close to the bitrate specified. This results in a less spiky (bandwidth wise). It will also cause both you and your viewers to consume more bandwidth as scenes with no motion at all will still use the specified bitrate unless "CBR Padding" is disabled.

CBR can help with viewer lag issues caused by variable bitrate as TCP is not well designed for variable bandwidth. The quality cost of CBR is very low and the issues it can fix make this very appealing, and it also eliminates the process of picking an appropriate quality value.

Recommended: On
Audio
Codec
AAC is higher quality at a lower bitrate. MP3 is marginally faster but lower quality.

Recommended: AAC

Bitrate
Controls the bitrate (and thus quality) of audio. Don't set this lower than 96kbps unless you're really constrained for bandwidth.

Recommended: 96 - 128kbps

Broadcast Settings
Everything here should be fairly self-explanatory. One thing to keep in mind, if you're using Twitch or Own3D, make sure to select the closest server to you to minimize latency. If you're using Twitch, try JTVPing from http://www.teamliquid.net/forum/viewmes ... _id=326034 to find your best server.

Minimize Network Impact
If you experience high ping / latency issues when you are streaming, try enabling this option to reduce how often OBS outputs data to the network. This comes at the risk of increased frame drops if the connection to the streaming server is poor.

Video
Base Resolution
This is the main resolution of your scene. This should generally by the same as your monitor resolution, so you can select a monitor to make it match. If you want to stream at a lower resolution, the Resolution Downscale option will provide the best quality. If you really want to stream at a certain resolution, eg 1280x720, you can type it in directly under "Custom". Please keep in mind that if your desktop is 16:10, you should enter a 16:10 custom resolution too (eg 1152x720), or your sources will not scale correctly and you will have black bars on your stream.

Recommended: Match your monitor resolution.

Resolution Downscale
This allows you to reduce the resolution that the stream is encoded at in a high quality way. If you want to stream at 1280x720 (720p) and your monitor is 1920x1080 (1080p), it is best to use a Base Resolution of 1920x1080 and select 1280x720 from this list. Using the downscale option is like using anti-aliasing - it will make things like text and sharp lines look a lot nicer than if you just set your base resolution to 1280x720.

Keep in mind that the resolution of your stream directly impacts how much CPU time and bitrate is required, so if you have a slow CPU or a low upload speed, reducing resolution is one of the best ways to improve things.

Recommended: Depends on your CPU and upload speed.

FPS
How many frames per second to target. If you have a high end system, 60 fps looks very fluid and is preferred for fast action games like FPS / fighting games. A higher frame rate is directly tied to an increase in CPU requirements, eg 60 fps will require twice as much CPU power as 30 fps. However, 60 fps may not require twice the bitrate, since the improvement in fluidity from 30 fps to 60 fps means there is less time for the eye to notice a quality loss. If you find you have a great CPU but low upload, increasing FPS is one of the best ways to improve quality.

Recommended: 30 fps for most configurations, 60 fps if you have the CPU and bandwidth to support it.

Disable Aero
This will turn off Aero (desktop compositing) on Windows Vista or Windows 7. If you are using Software Capture and using monitor capture, disabling Aero will result in higher performance capture. Conversely, if you are using window capture, you want to keep Aero on, as then OBS can copy directly from the individual window surface that Aero maintains, which is higher performance and also works even when the window is obscured.

Recommended: Disable Aero if using monitor capture, leave enabled if using window capture. If using neither, disabling Aero can have a very minor performance improvement for games.

Audio
Most of this should be self explanatory. If you do not use a mic or other auxiliary input, set this to Disabled to conserve some resources.

Advanced
Changing advanced options should never be done unless you fully understand what you are doing. You can very easily end up with a bad quality stream, throughput problems or excessive CPU usage by changing these settings.

Use Multithreaded Optimizations
This will use multiple threads for color space conversion, maximizing benefit from multi-core CPUs. There's almost no need to ever turn this off.

Recommended: On

Process Priority Class
Set the windows priority for the OBS process. If you are streaming high CPU games and you want your stream to be the best quality regardless of how laggy your game gets, you can set the process class to Above Normal, which will guarantee OBS gets any CPU it needs before any other apps. This can very easily cause your games and other apps to lag.

Recommended: Normal

x264 CPU Preset
This is an internal quality / time tradeoff scale in x264. A faster preset means less time will be spent encoding, but the image quality will be worse. A slower preset will increase CPU usage, but the image quality will be slightly better. You will almost always get better quality improvements from either a higher FPS, higher resolution or an increased bitrate. Changing this setting to improve quality is not recommended as the improvements are very minor and come at a great CPU cost. Going faster than veryfast will also disable many x264 optimizations and your stream quality will suffer. If you have constant CPU usage (eg a capture card) and know for certain you have spare CPU resources, you can set a slower preset for a very minor quality improvement. If you notice you have low FPS or lagged frames, you may have set your preset too slow.

Recommended: veryfast

Use CFR
This will force OBS to output at a constant frame rate, duplicating frames if necessary to achieve this. This is intended to make the video file compatible with editors that cannot handle VFR, and to maintain constant keyframe interval for streaming services that require keyframe interval to be set.

Recommended: On

Custom x264 Encoding Settings
If you understand x264 internals, you can override any of the internal x264 parameters here. Do not paste anything that you may have found in any guides, you should never need to specify anything here. This is mainly for developers or users who understand the x264 internals to be able to experiment with x264.

Recommended: None

Force Audio Time to Sync To Video Time
This will construct audio timestamps from the video source, usually you would do this if experiencing A/V sync issues with a bad audio device.

Recommended: Off, unless you are having sync issues.

Allow 61-120 FPS Entry
Allows you go go above 60 FPS on the Video settings. Most people only have 60 Hz screens, so going higher FPS is almost never needed. This is an advanced option for people looking to experiment only.

Recommended: Off

Bind To Interface
If you have multiple network interfaces, select the one which you wish OBS to use.

Recommended: Default

Latency Tuning Factor
Automatic Low Latency Mode
These are advanced options used to fine tune the "Minimize network impact" option. The effect varies depending on the network conditions. You should not touch these unless instructed to do so by a developer.
 

ndrwlmd

New Member
Question: Are Max Bitrate and Buffer Size in the encoding section the vbv-maxrate and vbv-bufsize parameters in x264?
 

anhdvu

Member
ndrwlmd said:
Question: Are Max Bitrate and Buffer Size in the encoding section the vbv-maxrate and vbv-bufsize parameters in x264?

Yes, they are. You can try local recording and use software like mediainfo to see for yourself.
 

lFakel

New Member
Very interesting read, alot of theories flying around about what "Quality Balance" is, some people just say that you should mindlessly put it on 10 and don't worry about it, after reading this ill try tinkering with it little more.This guide should definitely be highlighed or even put into OBS help section
 

DAOWAce

Member
R1CH said:
Use Higher Quality Audio Resampling
If your audio source is not 44,100 KHz, OBS will resample it. This setting enables sinc interpolation instead of linear interpolation, which results in slightly higher quality at the expense of a small increase in CPU usage.
Does this apply only to what your recording interface is set to (ie. Windows settings) or does it have an effect if your speaker playback is set to something else as well?

ie. If I have 48kHz playback and 44.1kHz recording set in Windows, do I need to enable this? I'm assuming no, but a concrete yes/no would be great.

Also, does bit depth matter at all? 16bit vs 24bit.
 

DAOWAce

Member
Alright, I'll leave the higher quality resampling option selected.

Would set everything to 44.1KHz (I'd like to normally use 96KHz, but that causes issues with certain things), but I don't like any loss in fidelity, no matter how miniscule (even if I can't hear it!).
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
I'll have to try to get 48000 support in the future, apparently RTMP does support it
 

ZeroTalent

New Member
This is a great guide, thanks as always R1CH!

R1CH said:
Use CBR
This will set x264 into CBR mode. Your quality setting will have no effect, and x264 will try to ensure your stream goes out at exactly the bitrate specified in the Encoding settings. This results in a less spiky (bandwidth wise) stream at the cost of quality, as x264 cannot allocate more bits to high motion without violating the CBR restriction. You should not need to enable this unless you have very specific network requirements.

Recommended: Off

I've been doing some experiments and I wonder if it's worth re-thinking this recommendation, especially if the broadcaster combines "use CBR" with the ratetol custom setting (yes, I know what I'm doing, my day job is with a company that transcodes video back catalogs...). I think bitrate+ratetol gives the broadcaster more confidence that the stream will show up smoothly for viewers. The TL/DR version is "game streaming is going almost always highly limited by bitrate" + "in a VoD it's the average bitrate matters, but when streaming a huge bitrate spike is bad news".

When I turn this setting on and observe the bitrate in OBS, it's not constant. It's just less spikey. See here for a writeup of what's going on underneath the hood. When you combine CBR with ratetol, the encoder is allowed to have some flexibility with the bitrate as the scene complexity changes, but the range of bitrates is still smaller than when using crf. If I set my VBV at 3200 Kbps, crf ratecontrol can give me instantaneous bitrates anywhere between 500 Kbps and 6000 Kbps, but bitrate ratecontrol with ratetol=30 I never go above 4200 Kbps (and rarely go below 2000 Kbps).

To see if this would affect quality, I ran some tests using a 120-120 TvT battle (8000 Kbps at crf 18 w/ no VBV settings) and a 200 vs 200 PvZ (30000 Kbps under the same settings). Using a ratetol of 30 and VBV-buffer of 3200 Kbps, the SSIM scores for the bitrate/ratetol videos where .0033 worse than for videos that use CRF ratecontrol (.9076 vs .9043 in the TvT test footage). According to the formula in this thread from one of the x264 developers, this is equal to a 4-5% loss in picture quality. So CRF is giving better quality, at the expense of less predictable bitrates.

Like I said I'm not 100% what the right answer is here. I welcome input, criticism, counterarguments, suggestions for additional tests (<3 running encoding tests), etc. Obviously purely constant bitrate is dumb, but I think "CBR" with ratetol might give broadcasters a better compromise between quality & predictible bitrate than CRF does.

EDIT: using CBR instead of CRF would have the added bonus of simplifying stream setup & troubleshooting. Only one knob for users to turn (bitrate -- presumably you just set vbv-bufsize to always equal bitrate) instead of two (VBV-bufsize & CRF). "My CPU can't keep up with gaming & streaming" is fixed just by lowering the bitrate, rather than some alchemy-based combination of bitrate & quality.
 

dodgepong

Administrator
Forum Admin
I know Twitch prefers if people use CBR, and I agree that having one "knob" is easier to understand than two. Furthermore, I think calling CRF "Quality" is perhaps an oversimplification (I still have a few question as to how it works...it's pretty confusing when you get into the details).

I assume the concern with bitrate spikes is that some viewers won't be able to watch smoothly in case the bit rate momentarily goes above their download speed? If that's the case, then the tradeoff would be slightly better quality with fewer users able to watch smoothly (CRF) vs. more users with smoother streams but slightly lower quality (CBR).
 

ZeroTalent

New Member
dodgepong said:
If that's the case, then the tradeoff would be slightly better quality with fewer users able to watch smoothly (CRF) vs. more users with smoother streams but slightly lower quality (CBR).

Right, what I'm trying to say is that the quality-vs-smooth bitrate tradeoff here might mean CBR is a better choice than CRF. Overall bitrate (aka upstream bandwidth) is still the dominant factor in picture for video game content. A 5% drop in quality is something you might notice, but only if your looking for it. It's about 2x worse than the quality drop if you disable trellis.

Once I started using CBR+ratetol, the number of viewers in my chat complaining about stream choppiness dropped to zero. There are a million variables in play so I don't want to give CBR full credit. But I think it deserves partial credit.
 

R1CH

Forum Admin
Developer
One of the other major downsides to CBR is that it drains a lot more download (and upload) bandwidth for the streamer and the viewers. People with limited data will probably not appreciate having to download 3mbps while the streamer is sitting at a menu or something.
 

dodgepong

Administrator
Forum Admin
Wait, really? I thought it was a fundamental thing between CBR and CFR that made them not work with each other, and had nothing to do with the first keyframe problem...? That's the impression I got from Jim, but I'd be happy if I was wrong.
 

BhaluBear

New Member
I have a question regarding true 60fps streams. I read somewhere that the only way to get true 60fps is to set my base resolution to the same resolution as my output resolution. Ex: Base resolution set to 1280 x 720 and then no downscaling so stream in 1280 x 720. Is what I read true? Or is it possible to set my OBS base resolution setting to 1920 x 1080, and then downscale 1.5x and get true 60fps? Hopefully that all makes sense.

For reference,check out these two vods because it seems that you can definitely tell a difference. The first vod I had my base set to 1920 x 1080 at 60fps and downscaled 1.5 x to 720p.
http://www.twitch.tv/bhalubear/b/399281941

This second vod I had my base set to 1280 x 720 at 60fps and downscaled none to 720p.
http://www.twitch.tv/bhalubear/b/399284463

I could be crazy but it looks like the first vod isn't in full 60fps while the second vod looks more fluid, despite only the base resolution setting being changed. Please take a look and tell me what you think or if I'm just crazy.
 
Status
Not open for further replies.
Top