Question / Help FPS on 100hz monitor | x264 threads, profiles, levels

maxout

New Member
Hi everyone!

I just started streaming on Twitch a few weeks ago and tried a lot of advanced OBS and x264 settings.
I'm quite pleased with the quality of my stream now but I have some more specific questions regarding my setup.

Computer
5960X @ 4.4 Ghz
32 GB RAM
2x GTX 980 Ti
Windows 10
OBS 64 Bit

Stream
1080p @ 33 fps lanczos downscale
cbr
3000 kbps
preset slow
tune animation
x264 settings: ref=4 trellis=2 qpmin=10 qpmax=51 fast-pskip=0 threads=14

Questions
1. FPS on 100 hz monitor
To my knowledge it's best to use a fps number calculated by dividing your monitors max refresh rate by integers. In my case this would mean 100/3 or 33.3333 fps. Is this correct or would I still fare better with the traditional 30 fps?

2. x264 number of threads
Since I'm playing and streaming on the same computer I need some processing power left for CPU intensive games. Right now I'm streaming Guild Wars 2 which is poorly optimized and doesn't profit from multiple cores/threads dropping me to 20-30 fps in very huge fights (up to 100 players) when I'm not streaming. To avoid further fps drops while streaming I set x264 threads to 14 leaving 2 free for other software and games.
If I'm informed correctly the default number of threads would be 24 (1.5 x logical cores) or is it actually 1.5 x physical cores?
Is there any disadvantage of lowering threads although with my current settings OBS logs show dropped/lagged frames < 1%?
If the default number of threads is actually 1.5 x logical cores why does x264 use more threads than cores available?

3. x264 profile main vs high
There is a minor but visible quality difference between main and high profile especially in high motion scenes.
If I do not care about availibility on mobile phones or tablets can I just use high?

4. x264 levels
With my current settings OBS picks x264 level 4.2.
Is there any incompatibility with Twitch at higher x264 levels?
Since 1080p30fps is supported with level 4.1 why does it pick 4.2?


Thanks a lot for any advice and/or help! I know it's a lot of questions ;D
 
Last edited:

Boildown

Active Member
1) I don't think it matters really, you can use 30fps. I haven't seen evidence that you have to have a 1 in the numerator of the fraction of the framerate. 3/10 should be fine. If there is a consideration, its more on the playback, a 30fps stream will play back better on people's 60fps monitor.

2) So its generally a bad idea to use x264 advanced settings like you posted, "tune animation
x264 settings: ref=4 trellis=2 qpmin=10 qpmax=51 fast-pskip=0 threads=14". Get rid of all that* and use the x264 presets to set your CPU usage vs quality, and only set custom commands to go between presets... part-way between medium and slow, for example. For example, having only 4 reference frames but setting trellis 2 is probably a poor CPU to quality tradeoff compared to sticking with the Slow preset's defaults. Handy chart: http://dev.beandog.org/x264_preset_reference.html

*On to the threads command... you have the right idea in my experience... x264 was developed before hyperthreading was much of a thing. They expected every "core" to be a full-fledged core and their rule of thumb of using 1.5 threads per core generates too many threads for many-cored & hyper-threaded CPUs. I've found that using less than the default number of threads actually increases performance slightly. It will take a lot of testing to find the ideal number of threads, but its sure to be less than the default x264 creates on a CPU such as yours.

3) If you don't care about ancient mobile devices that can't handle High profile, then go ahead. I for one do not care about ancient mobile devices either.

4) No incompatibility. OBS (or x264, not sure which)'s level picker is often wrong, especially at higher resolutions and framerates. I've brought this up in the past for 1920x1080p60 streams where it picked a level that was too low. No one really cares it turns out. You can manually set the level if you want with a custom x264 command. The only affect it might have is, again, lower-end mobile devices, who may be able to play back a 4.1 but not a 4.2 level stream.

By the way, OBS Classic doesn't work well with SLI. You'll have to use only one of your Tis, or try to use OBS Studio (this is the OBS Classic forum).
 

sam686

Member
At 1920x1080, FPS must be reduced down to 30 to be compatible with level 4 or 4.1.
https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels
Try level=4 in x264 custom options, the OBS log file will then give warning if something don't meet the level requirements. Without it, the slow preset will use ref=5 which need level 5 at 1920x1080.

Looking at apple's mobile devices, they max out at high profile, level 4.1, with old devices limited to main profile, level 3.1
https://developer.apple.com/library...yAskedQuestions/FrequentlyAskedQuestions.html
Edit: go too high of level and too high of profile, results in incompatible mobile devices showing black screen with working audio.
 
Last edited:

maxout

New Member
Awesome info, thanks a lot.

About the x264 presets: I'm pretty sure quality is better with my custom settings and performance is not really an issue if x264 can handle the encode on 14 threads. However I will test against default settings again since I may be imagining things.

I will reduce FPS to 30 and use high@L4.1 for support of modern mobile devices.
 
Top