cancel
Showing results for 
Search instead for 
Did you mean: 

General Discussions

ialexusman
Journeyman III

Re: 720p50 3500kbps twitch.tv OBS

I've been playing with the settings in OBS for a better quality on twitch to absolutely no avail. My issue isn't so much game quality, it's the webcam quality. The game usually looks okay no matter what settings I use but when I encode using the hardware AVC/AMF encoder, my webcam is completely and totally pixelated while any slight movement is happening in the game. I've gone through and tried these settings you've given to others and they don't work. I usually stream in 720p 60fps.

0 Kudos
alexusman
Journeyman III

Re: 720p50 3500kbps twitch.tv OBS

This what I get in a medium hard to encode scene:
http://benmanshafen.de/obs/720p60_sFX-webcam.mp4

download: https://github.com/Xaymar/obs-StreamFX (latest beta)
set it to:

alexusman_0-1617806987395.png

 

with custom FFmpeg options:
-usage=2 -quality=2 -profile=100 -level=42 -rc=1 -preanalysis=true -g 0 -coder=1 -qmin=18 -qmax=46 -me_half_pel=true -me_quarter_pel=true -vbaq=true -intra_refresh_mb=255

have in mind:
1. webcam should be set correctly // in my case its:

alexusman_1-1617806987860.png

 

same colorspace as stream and fitting FPS (29.97fps gets smoothest video for MY webcam)
reso of 424x240 is enough when webcam overlay isnt that big.

2. set filtering in OBS for Webcam: point or bilinear or area are ok and dont produce much load

3. IF you have a hard to encode scene (e.g. in games like Witcher 3) than you should use NVencbill or better x264 for encoding - as AMFenc is only 88-95% of x264 while NVenc is 95-98% of x264)
 

PC: R7 2700X @4.1GHz + RX 580 4G (1500MHz/2000MHz CL16) + 32G DDR4-3200CL14 + 144hz 1ms FS P + 75hz 1ms FS
Laptop: R5 2500U @30W + RX 560X (1400MHz/1500MHz) + 16G DDR4-2400CL16 + 120Hz 3ms FS
0 Kudos
benman2785
Big Boss

Re: 720p50 3500kbps twitch.tv OBS

@ialexusman 

you can try to use StreamFX with the settings i provided some posts earlier - this will give 2-5% better quality (depending on the scene) - but it will still look pixely...
AMF is good for high bitrate encoding - but not so good for streaming 😕

if you want best quality use x264 with the settings i provided.

720p60 (or quality-wise better 720p50) should be fine with a Ryzen 5 1600 or better 6C/12T CPU (use NotCPUCores to force game on 6 SMT cores)


PC: R7 2700X @4.1GHz + RX 580 4G (1500MHz/2000MHz CL16) + 32G DDR4-3200CL14 + 144hz 1ms FS P + 75hz 1ms FS
Laptop: R5 2500U @30W + RX 560X (1400MHz/1500MHz) + 16G DDR4-2400CL16 + 120Hz 3ms FS
owl
Journeyman III

Re: 720p50 3500kbps twitch.tv OBS

Hello @benman2785 

I've been researching x264 (and presets) for a while now and came across this forum. I have tested some of your suggestions in the many posts myself, as I prefer to stream to twitch with x264 (10mbit upload).
I fluctuate back and forth between the resolutions as I'm not sure what actually looks better and what is possible with a maximum of 6mbit.
Currently I'm streaming on x264 864p50 with lanczos, CBR 6000 Kbps, buffer 2000, medium, baseline, none as well as the following x264 options: level=4. 1 force-cfr=1 cabac=1 deblock=-3:2 rc-lookahead=10 sync-lookahead=5 aq-mode=1 aq-strength=1.33. (CPU: Ryzen 9 5950x, GPU: NVidia 2080Ti - yes I know I can also stream via Nvenc but I prefer x264).
I had previously tried many resolutions from 720p, 864p on setting "slow", only that is just a decent load and may not be suitable for live streaming.
-> I also use "NotCPUCores" like you recommended in several posts
-> Your hint to add a buffer made my bitrate more stable (6000 bitrate -> 2000 buffer).

The reason I use these x264 options is because a few posts ago, someone with a 3900x asked for your help. I have adopted these settings for now and tested them myself. A few posts earlier, however, you said that all your recommendations are adapted to the respective hardware.

Do you have a recommendation for me? (Games: currently no FPS, rather games like Satisfactory, Anno 1800, Witcher 3). However, I do have one request: can you explain why the settings should be used? I am trying to some extent to understand why certain settings are applied.

Then I have two more questions:
1) I also tested your suggestions regarding 720p50 / 720p60 with 4500bitrate and it didn't look good for me. I may have set something wrong there. On Twitch I see many streaming at 6000bitrate on 720p60 and the picture looks fine. By the way, I know the Twitch encode settings, but I wouldn't have guessed that the bitrates given there are to be taken as the exact bitrate for the respective resolution. Am I perhaps misunderstanding something here?

2) I have read that the "true 16:9" resolutions are better for encoding. Do you know anything about this? This is why I don't use 900p as resolution, but 864p/720p.

Thank you in advance and also thank you for taking on the questions here. Sorry for this mile post

 

 

 

 

 

0 Kudos
benman2785
Big Boss

Re: 720p50 3500kbps twitch.tv OBS

@owl 

1. if you stream 720p50/60 twitch.tv only allows 4500kbps - otherwise you will have problems
1b. if you stream 900p50/60 twitch.tv allows 6000kbps
1c. 1080p50/60 is also just 6000kbps - therefore quality of 1080p60 is lower than 900p60 with same bitrate

2. 900p is fine for twitch.tv! actually its "better" than 864p - because on website with open chat the video-window is 1600x900 // so with 864p your browser will upscale your video
2b. qualitywise 864p is "better" than 900p due to its 36x24 vs 37.5x24 && you have same bitrate for 112896 pixels less = higher quality // but given 2. you should still use 900p (and i am not 100% sure if twitch.tv needs 900p to extent bitrate limit 6000kbps or if 864p is enough

3.
level=4.2 - forces 900p/1080p60 compatibility // you can use higher levels too

cabac=1 - forces to use higher compression compared to CALV - but higher load on cpu // higher compression = higher quality

8x8dct=1 - forcing it in baseline and main (because its a option only active in "high" profile) // used for better quality of 8x8 transform

partitions=p8x8,b8x8,i8x8,i4x4 - is actually pretty standard - but i for testing you can use: p8x8,p4x4,b8x8,i8x8,i4x4 (but you have higher load on CPU for minimal quality gain)

ref=4 - 4 ref frames (3 would be standard)

bframes=2 - improve compression

b-adapt=1 - forced faster b-adapt (improves speed of encoder) // you can try "2" but then shouldnt go higher than 2 bframes (and even this can sometimes reduce encoding speed under 60fps)

fast-pskip=0 - disables fast skipping of p-frames // improves compression and quality - but makes encoding slower 

rc-lookahead=25 - 1/2fps as lookahead is good (here for 50fps) // when using 60fps use 30 here // high values doesnt benefit much and make the encoder slow

sync-lookahead=25 - limits lookahead-frames to 1/2fps // use "30" for 60fps // speeds up encoding a little and lowers ressources x264 threads use

me=hex - hexagonal motion estimation // "umh" is overkill and to slow // stick to "hex"

merange=16 - is standard for "hex" and "dia" // you can leave that in as it simply forces the standard

subme=6 - is for subpixel search // min "6" is needed when using psy-rd // Multi-QPel + bi-directional search + RDO on i and p frames // you cant try to use 7 or 8 with your 3900X when you give OBS 12 SMT cores 😉

deblock=-3:2:0 - 95% of games look better with this deblocking options // is more personal preference // you can remove this if you want and check yourself

direct=spatial - forces x264 to be more "streaming friendly" as "auto" includes "temporal" which mostly only benefits for 2pass encoding // speeds up encoding // you can set it to "auto" and test yourself if you have encoding lag

aq-mode=2 - forces "adaptive quantization over several frames" (allocates bits over several frames to specific areas to improve picture quality) // you can try "3" too 😉
trellis=0 - disables trellis // improves encoder performance // some people say use "at least trellis=1" but deadzone-intra and deadzone-inter do mostly the same job for 80% less load compared to "trellis=1"

deadzone-inter=11 - can be set from 0-32 // 0-10 = lower compression but more details - but result in to much bitrate && 11-13 remain high detail with moderate bitrate && 14-22 remain good detail with lower bitrate && 23-28 remain "enough" detail with low resulting bitrate && 29-32 make it "flat" with less detail but low bitrate // works for p and b frames

deadzone-intra=11 - same as inter but for i frames

psy-rd=0.1:0.0  - uses math to make the picture "more pleasing" to the human eye // i only use psy-rd and not psy-trellis (as trellis is "0") // 0.1 pretty low = you can try 0.15 or 0.2 or 0.25 or 0.3 // dont go over 0.3

weightp=1 - enables "blind" motion compensation in p frames // you can try set it to "2"

weightb=1 - enables "blind" motion compensation in b frames // you cant try set it to "2"

PC: R7 2700X @4.1GHz + RX 580 4G (1500MHz/2000MHz CL16) + 32G DDR4-3200CL14 + 144hz 1ms FS P + 75hz 1ms FS
Laptop: R5 2500U @30W + RX 560X (1400MHz/1500MHz) + 16G DDR4-2400CL16 + 120Hz 3ms FS
benman2785
Big Boss

Re: 720p50 3500kbps twitch.tv OBS

here a test video with 8 SMT cores for OBS (and other apps) while game runs on 8 physical cores

900p50@6000kbps + 3000kb buffer
"faster" "main" "none"

level=4.2 cabac=1 8x8dct=1 partitions=p8x8,p4x4,b8x8,i8x8,i4x4 ref=4 bframes=2 b-adapt=2 fast-pskip=0 rc-lookahead=25 sync-lookahead=25 me=hex merange=16 subme=6 deblock=-3:2:0 direct=auto aq-mode=3 trellis=0 deadzone-inter=11 deadzone-intra=11 psy-rd=0.1:0.0 weightp=2 weightb=2

22:41:29.124: ==== Streaming Start ===============================================
22:41:31.000: socket_thread_windows: Increasing send buffer to ISB 131072 (buffer: 0 / 780288)
22:41:34.298: socket_thread_windows: Increasing send buffer to ISB 262144 (buffer: 0 / 780288)
22:42:28.262: socket_thread_windows: Increasing send buffer to ISB 524288 (buffer: 0 / 780288)
22:43:09.480: Stopping stream due to hotkey
22:43:10.757: [rtmp stream: 'adv_stream'] User stopped the stream
22:43:10.757: socket_thread_windows: Normal exit
22:43:10.758: Output 'adv_stream': stopping
22:43:10.758: Output 'adv_stream': Total frames output: 5019
22:43:10.758: Output 'adv_stream': Total drawn frames: 5107
22:43:10.761: ==== Streaming Stop ================================================

benman2785_0-1617828512541.png

no big drops or high peaks - good to maintain a "constant" quality

here the orginal video:
http://benmanshafen.de/obs/900p50_07-April-2021.mp4 

PC: R7 2700X @4.1GHz + RX 580 4G (1500MHz/2000MHz CL16) + 32G DDR4-3200CL14 + 144hz 1ms FS P + 75hz 1ms FS
Laptop: R5 2500U @30W + RX 560X (1400MHz/1500MHz) + 16G DDR4-2400CL16 + 120Hz 3ms FS
benman2785
Big Boss

Re: 720p50 3500kbps twitch.tv OBS

maybe this post is now double - but my last post was edited to often so it doesnt show for me 😕

i tested a slightly different version of my settings:

900p50@6000kbps + 3000kb buffer
"faster" "main" "none"
level=4.2 cabac=1 8x8dct=1 partitions=p8x8,p4x4,b8x8,i8x8,i4x4 ref=4 bframes=2 b-adapt=2 fast-pskip=0 rc-lookahead=25 sync-lookahead=25 me=hex merange=16 subme=6 deblock=-3:2:0 direct=auto aq-mode=3 trellis=0 deadzone-inter=11 deadzone-intra=11 psy-rd=0.1:0.0 weightp=2 weightb=2

http://benmanshafen.de/obs/900p50_07-April-2021.mp4 (this is how my stream would look like on twitch.tv)

benman2785_0-1617829631059.png

we see no big drops and no big spikes = constant quality
we also stay in bitrate limits of twitch.tv

OBS log
22:41:28.609: Starting stream due to hotkey
22:41:28.617: ---------------------------------
22:41:28.617: [x264 encoder: 'streaming_h264'] preset: faster
22:41:28.617: [x264 encoder: 'streaming_h264'] profile: main
22:41:28.617: [x264 encoder: 'streaming_h264'] x264 param: weightb=2 failed
22:41:28.617: [x264 encoder: 'streaming_h264'] settings:
22:41:28.617: rate_control: CBR
22:41:28.617: bitrate: 6000
22:41:28.617: buffer size: 3000
22:41:28.617: crf: 0
22:41:28.617: fps_num: 50
22:41:28.617: fps_den: 1
22:41:28.617: width: 1600
22:41:28.617: height: 900
22:41:28.617: keyint: 100
22:41:28.617:
22:41:28.618: [x264 encoder: 'streaming_h264'] custom settings:
22:41:28.618: level = 4.2
22:41:28.618: cabac = 1
22:41:28.618: 8x8dct = 1
22:41:28.618: partitions = p8x8,p4x4,b8x8,i8x8,i4x4
22:41:28.618: ref = 4
22:41:28.618: bframes = 2
22:41:28.618: b-adapt = 2
22:41:28.618: fast-pskip = 0
22:41:28.618: rc-lookahead = 25
22:41:28.618: sync-lookahead = 25
22:41:28.618: me = hex
22:41:28.618: merange = 16
22:41:28.618: subme = 6
22:41:28.618: deblock = -3:2:0
22:41:28.618: direct = auto
22:41:28.618: aq-mode = 3
22:41:28.618: trellis = 0
22:41:28.618: deadzone-inter = 11
22:41:28.618: deadzone-intra = 11
22:41:28.618: psy-rd = 0.1:0.0
22:41:28.618: weightp = 2
22:41:28.618: weightb = 2
22:41:28.630: ---------------------------------
22:41:29.124: ==== Streaming Start ===============================================
22:41:31.000: socket_thread_windows: Increasing send buffer to ISB 131072 (buffer: 0 / 780288)
22:41:34.298: socket_thread_windows: Increasing send buffer to ISB 262144 (buffer: 0 / 780288)
22:42:28.262: socket_thread_windows: Increasing send buffer to ISB 524288 (buffer: 0 / 780288)
22:43:09.480: Stopping stream due to hotkey
22:43:10.757: [rtmp stream: 'adv_stream'] User stopped the stream
22:43:10.757: socket_thread_windows: Normal exit
22:43:10.758: Output 'adv_stream': stopping
22:43:10.758: Output 'adv_stream': Total frames output: 5019
22:43:10.758: Output 'adv_stream': Total drawn frames: 5107
22:43:10.761: ==== Streaming Stop ================================================

we see "weightb=2 failed" = we use weightb=1 instead now 😉

PC: R7 2700X @4.1GHz + RX 580 4G (1500MHz/2000MHz CL16) + 32G DDR4-3200CL14 + 144hz 1ms FS P + 75hz 1ms FS
Laptop: R5 2500U @30W + RX 560X (1400MHz/1500MHz) + 16G DDR4-2400CL16 + 120Hz 3ms FS
benman2785
Big Boss

Re: 720p50 3500kbps twitch.tv OBS

http://benmanshafen.de/obs/900p50_07-April-2021_2.flv

900p50@6000kbps + 3000kb buffer
"faster" "main" "none"
level=4.2 cabac=1 8x8dct=1 partitions=p8x8,p4x4,b8x8,i8x8,i4x4 ref=4 bframes=2 b-adapt=2 fast-pskip=0 rc-lookahead=25 sync-lookahead=25 me=hex merange=16 subme=6 deblock=-3:2:0 direct=auto aq-mode=3 trellis=0 deadzone-inter=11 deadzone-intra=11 psy-rd=0.1:0.0 weightp=2 weightb=1
PC: R7 2700X @4.1GHz + RX 580 4G (1500MHz/2000MHz CL16) + 32G DDR4-3200CL14 + 144hz 1ms FS P + 75hz 1ms FS
Laptop: R5 2500U @30W + RX 560X (1400MHz/1500MHz) + 16G DDR4-2400CL16 + 120Hz 3ms FS
owl
Journeyman III

Re: 720p50 3500kbps twitch.tv OBS

@benman2785 

first and foremost, thank you very much for all your answers and detailed explaination on the x264 options.

I noticed that although I mentioned that I use notCPUcores, I did not specify the settings.
Game: CPU cores : 1,3,5,7,9,11,13,15 (I hope these are the 8 physical cores) (Priority: normal)
OBS: Custom, 18,20,22,24,26,28,30,32 (Prio: above normal)  other processes on remaining cores.

I have used your information on CPU cores from previous posts as a guide.

Are these settings for notCPUcores correct?

Again, thank you very much in advance.

0 Kudos
benman2785
Big Boss

Re: 720p50 3500kbps twitch.tv OBS

@owl 

with a Ryen 9 3900X i would use THIS settings for NotCPUCores:

benman2785_0-1617896961320.pngbenman2785_1-1617897093677.png

or maybe:

benman2785_2-1617897118447.png

 



PC: R7 2700X @4.1GHz + RX 580 4G (1500MHz/2000MHz CL16) + 32G DDR4-3200CL14 + 144hz 1ms FS P + 75hz 1ms FS
Laptop: R5 2500U @30W + RX 560X (1400MHz/1500MHz) + 16G DDR4-2400CL16 + 120Hz 3ms FS