r/Twitch • u/ZeForte • Jan 05 '18
Guide How to use StreamLabs OBS "smart video encoding" with OBS Studio
tl;dr skip to 'The settings'
Intro
First off, the "custom encoders" mentioned in the SLOBS announcement are just modified presets(/settings) for x264, which means they can be easily used with OBS Studio. The downside is that you have to change the settings manually each time you switch games unless someone writes a plugin for that.
It's also not really clear what the benefits really are, as the devs stated that the CPU usage of SLOBS is on par with OBS.
Where is this coming from
The SLOBS x264 settings can be found in the program's source here
It seems support for this "smart video encoding" is limited to x264, and despite what the announcement claimed, is only available to PUBG, League of Legends, Fortnite, and Destiny 2
There are two presets which serve as the base for the settings:
- Medium: 'Optimized profile for average CPUs', based on x264 preset 'veryfast'
- Low: 'Optimized profile for weak CPUs', based on x264 preset 'ultrafast'
The settings
For OBS Studio, navigate to File -> Settings -> Output, set "Output Mode" to "Advanced". The settings can only be used if encoder is set to x264. What you'll modify is "CPU Usage Preset", and "x264 Options"
PUBG
Medium
- CPU Usage Preset: veryfast
- x264 Options:
nal-hrd=cbr trellis=0 me=dia force-cfr=1 rc-lookahead=20 ref=1 chroma-qp-offset=0bframes=3 subme=1 b_adapt=1 mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2 mbtree=1chroma_me=1 psy=1 8x8dct=1 fast_pskip=1 lookahead_threads=6 deblock=1:0
Low
- CPU Usage Preset: ultrafast
- x264 Options:
nal-hrd=cbr trellis=0 me=dia force-cfr=1 rc-lookahead=20 ref=2 chroma-qp-offset=-2bframes=0 subme=0 b_adapt=2 mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2 mbtree=0chroma_me=1 psy=0 8x8dct=0 fast_pskip=1 lookahead_threads=6 deblock=1:0
League of Legends
Medium
- CPU Usage Preset: veryfast
- x264 Options:
nal-hrd=cbr trellis=0 me=dia force-cfr=1 rc-lookahead=20 ref=1 chroma-qp-offset=0bframes=3 subme=1 b_adapt=1 mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2 mbtree=1chroma_me=1 psy=1 8x8dct=1 fast_pskip=1 lookahead_threads=6 deblock=1:0
Low
- CPU Usage Preset: ultrafast
- x264 Options:
nal-hrd=cbr weightp=1 me_range=16 threads=6 intra_refresh=0 qcomp=0.60 qpmax=69analyse='3:275' psy_rd='1.00:0.00' ratetol=1.0 qcomp=0.60 deblock=1:0 trellis=0 me=diaforce-cfr=1 rc-lookahead=20 ref=0 chroma-qp-offset=0 bframes=0 subme=0 b_adapt=0mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2 mbtree=0 chroma_me=1 psy=0 8x8dct=0fast_pskip=1 lookahead_threads=6
Fortnite
Medium
- CPU Usage Preset: veryfast
- x264 Options:
nal-hrd=cbr trellis=0 me=hex force-cfr=1 rc-lookahead=20 ref=1 chroma-qp-offset=0bframes=3 subme=1 b_adapt=1 mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2 mbtree=1chroma_me=1 psy=1 8x8dct=1 fast_pskip=1 lookahead_threads=6 deblock=1:0
Low
- CPU Usage Preset: ultrafast
- x264 Options:
nal-hrd=cbr trellis=0 me=dia force-cfr=1 rc-lookahead=20 ref=0 chroma-qp-offset=-2bframes=0 subme=1 b_adapt=0 mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2mbtree=0 chroma_me=1 psy=1 8x8dct=0 fast_pskip=1 lookahead_threads=6 deblock=1:0
Destiny 2
Medium
- CPU Usage Preset: veryfast
- x264 Options:
nal-hrd=cbr trellis=0 me=dia force-cfr=1 rc-lookahead=20 ref=1 chroma-qp-offset=0bframes=3 subme=1 b_adapt=1 mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2mbtree=1 chroma_me=1 psy=1 8x8dct=1 fast_pskip=1 lookahead_threads=6 deblock=1:0
Low
- CPU Usage Preset: ultrafast
- x264 Options:
nal-hrd=cbr trellis=0 me=dia force-cfr=1 rc-lookahead=20 ref=0 chroma-qp-offset=-2bframes=0 subme=1 b_adapt=0 mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2 mbtree=0chroma_me=1 psy=1 8x8dct=0 fast_pskip=1 lookahead_threads=6 deblock=1:0
Generic (any other game)
Medium
- CPU Usage Preset: veryfast
- x264 Options:
nal-hrd=cbr deblock=1:0 trellis=0 me=dia force-cfr=1 rc-lookahead=20ref=1 chroma-qp-offset=0 bframes=2 subme=1 b_adapt=1 mixed-refs=0 cabac=1qpstep=4 b_pyramid=2 mbtree=1 chroma_me=1 psy=1 8x8dct=1 fast_pskip=1lookahead_threads=6
Low
- CPU Usage Preset: ultrafast
- x264 Options:
nal-hrd=cbr deblock=1:0 trellis=0 me=tesa force-cfr=1 rc-lookahead=10ref=0 chroma-qp-offset=-2 bframes=0 subme=0 b_adapt=0 mixed-refs=0 cabac=1qpstep=4 b_pyramid=2 mbtree=0 chroma_me=1 psy=1 8x8dct=0 fast_pskip=1lookahead_threads=6
CS:GO and Dota 2
There are no special settings for those two.
Fun Facts
The Medium settings for PUBG, LoL, and D2 are exactly the same, and FN as well as Generic only contain one change. FN uses me=hex instead of me=dia. 'me' stands for motion estimation. According to this 'hex' "is considerably more efficient than dia and hardly any slower, and therefore makes a good choice for general-use encoding.". Generic's only change is the decrease of bframes from 3 to 2.
Pretty interesting that StreamLab's "machine learning" determined that there is basically no difference between PUBG, LoL, D2, FN, and any other type of content in terms of how they should be encoded more efficiently/"smarter".
There are more changes in "Low" profiles (especially for LoL), but I'm not qualified to comment on what they affect and by how much.
22
u/boothin twitch.tv/boothin Jan 05 '18
TBH I kind of figured it wouldn't be as good as it sounded when they used the fake pixelated comparison screenshot for it
14
u/JoshTheSquid twitch.tv/dryroastedlemon Jan 05 '18 edited Jan 05 '18
Just looking at the low preset for LoL since it "changes" the most things...
nal-hrd=cbr weightp=1 me_range=16 threads=6 intra_refresh=0 qcomp=0.60 qpmax=69analyse='3:275' psy_rd='1.00:0.00' ratetol=1.0 qcomp=0.60 deblock=1:0 trellis=0 me=diaforce-cfr=1 rc-lookahead=20 ref=0 chroma-qp-offset=0 bframes=0 subme=0 b_adapt=0mixed-refs=0 cabac=1 qpstep=4 b_pyramid=2 mbtree=0 chroma_me=1 psy=0 8x8dct=0fast_pskip=1 lookahead_threads=6Some of these settings are kind of baffling. If it's using
ultrafastit doesn't need to change the motion estimation method sinceme=diais anultrafastdefault. I've got to wonder why they specifyme_range=16even though 16 is the default value and isn't altered by theultrafast. Same goes forintra_refresh,qcomp(which is set twice for some reason),qpmax,psy_rd,ratetol,deblock,trellis,chroma-qp-offset,bframes,subme,b_adapt,mixed-refs,qpstep,mbtree,chroma_me,8x8dctandfast_pskip. All of those are defaults, and all the SLOBS profiles are plagued with these redundant settings.EDIT: Changed settings are
weightp(from 0),threads(usually generated by x264 based on logical core count or vertical resolution),analyse(changed from 0:0 - Can't find it in the documentation),rc_lookahead(from 0),cabac(from 0),lookahead_threads(unclear. Depends on bframes, subme and b_adapt apparently) andpsy(from 1). TL;DR: whereas ultrafast basically kills motion estimation the Streamlabs generated settings keep some of the more essential settings and will raise image quality a little bit. These are the interesting bits.Also, please somebody inform me why you would use
b_pyramid=2when you usebframes=0. That setting doesn't even work when you don't have b-frames (EDIT: I found out. It's a default.). The same goes with setting thepsy_rdvalue. Setting apsy_rdvalue (even though it's the default) and then disabling psy withpsy=0just blows my mind.This all just reminds me of the days where people started using these huge amounts of "custom settings" somebody posted even though they were all defaults (in those cases usually just stolen from some post from 2010, before CPU presets were a thing). Apparently the Streamlabs settings are generated by means of machine learning, but it looks like the machine has to go back to school because it doesn't know how some settings work in tandem with one another. Mind commenting on this, Streamlabs staff (paging /u/Poujie)? Does the machine compare the settings it found against x264/profile defaults? If it doesn't, it should.
I mean, it's not like the machine is wrong. The defaults are generally good. It's just redundant to set defaults to their default values. In the end I just don't want to see a resurgence of uninformed people posting a huge amount of custom settings even though they didn't even bother reading the x264 documentation.
X264 syntax ramble aside...
There's some parts of this that are pretty interesting, though. The settings suggest that
me=diais an interesting option even though it's not that commonly used. In all the documentation you'll read that hex is more efficient, but the truth is that slower methods aren't always better. When encoding things you typically choose settings that fit the material. I doubt thatdiaactually improves image quality but I'm willing to run some tests for myself.Also I think it should be noted that it looks like these profiles are created with single computer streaming rigs with average CPUs in mind (hence the settings being based on the
veryfastpreset). It would be interesting to see what settings the machine comes up with when given the context of a high performance CPU dedicated to encoding video. I do think there's some room for performance improvement because some settings just don't affect the viewing experience all that much, especially since we're bitrate limited first and foremost.EDIT: Just to clarify, I'm just being an angry x264 nerd. I'm not bashing the machine learning thing and saying it's wrong, but I do think it should get rid of redundancies and just clearly point out what it's doing. That way we can possibly all learn something about video encoding. Machine learning is the best and quickest way to learn about this, but not when the results are practically unreadable.
EDIT 2: Cool, the moment I post this Streamlabs has posted a blog post about it: https://blog.streamlabs.com/game-aware-video-encoding-dbf970492f8b.
Time to do some reading!
9
u/[deleted] Jan 05 '18
There’s gotta be a better name than SLOBS.
4
u/[deleted] Jan 05 '18
Does Streamlabs streaming program use LESS cpu yes or no? Everyone seems to be vague about it, i've heard yes and no equally...
6
u/murtiii Jan 05 '18
I work @ Streamlabs.
Just published this blog post. Worth a read if you're interested in learning more and seeing actual results of these optimizations.
https://blog.streamlabs.com/game-aware-video-encoding-dbf970492f8b
2
u/theastropath twitch.tv/TheAstropath Jan 05 '18
I would think that if you wanted to change between these settings easily in regular OBS Studio, you could just set up a Profile for each. I assume the x264 options are saved on a per-profile basis...
2
u/[deleted] Jan 05 '18
Looks cool, going to try it out. Browsing through the available overlays uses up all of my processing power though. https://i.imgur.com/FqfoUlo.png
2
u/Temporal_Enigma Apr 08 '18
I have tried to use this software, but it runs, like, 70% of my CPU when not doing anything. And I'm using NVENC encoding
3
u/gammofly Jan 06 '18
My favorite is that Destiny 2 has a preset. That game is deader than my channel.
2
u/Poujie Streamlabs Staff Jan 05 '18 edited Jan 05 '18
-- I work for Streamlabs.
I would highly recommend to try these new profiles and look at the CPU usage and the video quality produced. From what I have seen so far, the gains are just huge.
The 4 games have customs preset that the machine learning generated. There are also some generic ones that are improving the encoding for games in general.
Bear in mind that the more and more the machine learning system gets train and the more the new profiles will be efficient. It also means that the settings posted here are more likely going to change / evolve in the future.
1
u/LTKVeteran Jan 11 '18
How exactly does one apply this smart encoder for PUBG? I thought there would be a setting somewhere but there isnt....the same as obs studio thus far
1
u/TheManInMyHead Apr 18 '18
What bitrate for medium settings though?
1
u/FeLONe257 Jun 02 '18
So .. If I use those custom settings parameters, can I go better than veryfast preset on the medium one ? (for pubg) Would it be better? And yes.. my CPU can handle it.