Question / Help Where is the bottleneck?

swent

New Member
So I'm another newb to streaming... but I have been reading guides and googles alot about my situation (and also read the forum).

First my hardware:

i5 3570K @ 4.3GHz (ivy)
16GB DDR @ 2400MHz (DC)
GTX 570 @ ~850MHz gpu clock
Intel SSD raid 2x 180GB @ sata 3
Z77 chipset

Internet:
2757244241.png


And my log:
Code:
00:28:48: Open Broadcaster Software v0.522b - 32bit (´・ω・`)
00:28:48: -------------------------------
00:28:48: CPU Name: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
00:28:48: CPU Speed: 3652MHz
00:28:48: Physical Memory:  4095MB Total, 4095MB Free
00:28:48: stepping id: 9, model 10, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 4, total cores 4
00:28:48: monitor 1: pos={0, 0}, size={1920, 1080}
00:28:48: monitor 2: pos={-1920, 0}, size={1920, 1080}
00:28:48: Windows Version: 6.1 Build 7601 S
00:28:48: Aero is Enabled
00:28:48: -------------------------------
00:28:48: OBS Modules:
00:28:48: Base Address     Module
00:28:48: 01300000         OBS.exe
00:28:48: 70BF0000         OBSApi.dll
00:28:48: 71130000         DShowPlugin.dll
00:28:48: 72180000         GraphicsCapture.dll
00:28:48: 71110000         NoiseGate.dll
00:28:48: ------------------------------------------
00:28:48: Adapter 1
00:28:48:   Video Adapter: NVIDIA GeForce GTX 570
00:28:48:   Video Adapter Dedicated Video Memory: 1293352960
00:28:48:   Video Adapter Shared System Memory: 2952343552
00:28:48: =====Stream Start: 2013-06-07, 00:28:48===============================================
00:28:48:   Multithreaded optimizations: On
00:28:48:   Base resolution: 1600x900
00:28:48:   Output resolution: 1600x900
00:28:48: ------------------------------------------
00:28:48: Loading up D3D10...
00:28:48: Playback device Default
00:28:48: ------------------------------------------
00:28:48: Using desktop audio input: Lautsprecher (Creative SB X-Fi)
00:28:48: Using 5.1 speaker setup
00:28:48: ------------------------------------------
00:28:48: Using auxilary audio input: Microphone (Creative SB X-Fi)
00:28:48: ------------------------------------------
00:28:48: Audio Encoding: AAC
00:28:48:     bitrate: 128
00:28:48: Using bitmap image
00:28:48: Using Monitor Capture
00:28:48: ------------------------------------------
00:28:48: Video Encoding: x264
00:28:48:     fps: 30
00:28:48:     width: 1600, height: 900
00:28:48:     preset: veryfast
00:28:48:     CBR: no
00:28:48:     CFR: no
00:28:48:     max bitrate: 2750
00:28:48:     buffer size: 2750
00:28:48:     quality: 10
00:28:48: ------------------------------------------
00:28:50: Using RTMP service: Twitch / Justin.tv
00:28:50:   Server selection: rtmp://live-ams.justin.tv/app
00:28:52: SO_SNDBUF was at 8192
00:28:52: SO_SNDBUF is now 65536
00:30:30: Total frames rendered: 2308, number of frames that lagged: 1793 (77.69%) (it's okay for some frames to lag)
00:30:30: RTMPPublisher::SocketLoop: Aborting due to bStopping
00:30:30: Number of times waited to send: 0, Waited for a total of 0 bytes
00:30:30: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
00:30:30: =====Stream End: 2013-06-07, 00:30:30=================================================
00:30:32: 
00:30:32: Profiler results:
00:30:32: 
00:30:32: ==============================================================
00:30:32: frame - [100%] [avg time: 43.168 ms] [avg calls per frame: 1] [children: 99.1%] [unaccounted: 0.929%]
00:30:32: | scene->Preprocess - [96%] [avg time: 41.448 ms] [avg calls per frame: 1]
00:30:32: | video encoding and uploading - [3.06%] [avg time: 1.319 ms] [avg calls per frame: 1] [children: 3.02%] [unaccounted: 0.0371%]
00:30:32: | | CopyResource - [0.0486%] [avg time: 0.021 ms] [avg calls per frame: 0]
00:30:32: | | conversion to 4:2:0 - [0.0185%] [avg time: 0.008 ms] [avg calls per frame: 0]
00:30:32: | | call to encoder - [2.86%] [avg time: 1.233 ms] [avg calls per frame: 0]
00:30:32: | | sending stuff out - [0.095%] [avg time: 0.041 ms] [avg calls per frame: 0]
00:30:32: ==============================================================
00:30:32:


My problem:

Stream seems to be choppy here and there, also I noticed that the fps (streaming @ 30 fps) in the lower right corner of the obs window struggle to keep up (bounces between 21 and 29 fps). So what did I do wrong or where is the bottleneck of my pc?

Note:
With additional programs (like browser and musicplayer, email, ...) running my CPU bounces between 15 and 30% while playing WoW (1080p, ultra, no AA, windowed). Framerate cap inside of WoW has been significantly reduced by myself to about 42 frames. With that framerate GPU load will not exceed 70%.

While straming:
CPU spikes up to 80% (but I have never seen a single core spike up to nearly 100%) and GPU spikes up to 90%.

So how can I fix that without sacrificing my streams quality (or how to even improve quality? I'd like to stream 1080p but seems to me my pc can't even handle 900p)

Thanks for your help!
swent
 

FerretBomb

Active Member
You're using Monitor Capture, with Aero on. There's the biggest problem, right away, and likely is causing all of your lagged frames (and possibly the high load as well).
Use Game Capture if possible, then Window Capture, and only use Monitor Capture as a last-ditch (with Aero turned OFF).

I'd also strongly recommend setting your base resolution to your monitor resolution, assuming you're using a 16:9 monitor, and use the Downscale option to drop to 900p or 720p.

Speedtest.net is notoriously unreliable in providing 'real world' values for upload (and many ISPs will uncap only that site). Instead, use this: http://testmy.net/upload (run the 6MB test). It'll give you a real idea of what kind of upstream you have available. My ISP (and speedtest) says 5mbps, but I was getting drops and lag and problems. Testmy showed I was only actually getting between 2.8 and 3.2mbps *stable*. Dropping my bitrate slightly fixed the problems almost instantly.
 

swent

New Member
Thanks for your fast reply!

Was reading the same about Aero and Monitor Capture in another thread just when you answered to mine :/
So I switched to Game Capture and it works pretty fine, no bouncing fps anymore, and while running the new 1080p to 864p downscale settings CPU spikes dropped to about 65%-70%.

Testmy.net results are pretty shoking, I got 1.6mbps from the 6MB test. For the last 5-8 minutes I've been running the stream @ 2750 kbps and there were no problems watching it, feels super-smooth (not like before).

I'll post a new log in a moment.

PS: I'm really grateful for your help, thanks!


/EDIT:
New log:
Code:
01:36:46: Open Broadcaster Software v0.522b - 32bit (´・ω・`)
01:36:46: -------------------------------
01:36:46: CPU Name: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
01:36:46: CPU Speed: 3652MHz
01:36:46: Physical Memory:  4095MB Total, 4095MB Free
01:36:46: stepping id: 9, model 10, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 4, total cores 4
01:36:46: monitor 1: pos={0, 0}, size={1920, 1080}
01:36:46: monitor 2: pos={-1920, 0}, size={1920, 1080}
01:36:46: Windows Version: 6.1 Build 7601 S
01:36:46: Aero is Enabled
01:36:46: -------------------------------
01:36:46: OBS Modules:
01:36:46: Base Address     Module
01:36:46: 00340000         OBS.exe
01:36:46: 683D0000         OBSApi.dll
01:36:46: 6E6C0000         DShowPlugin.dll
01:36:46: 683B0000         GraphicsCapture.dll
01:36:46: 6D970000         NoiseGate.dll
01:36:46: ------------------------------------------
01:36:46: Adapter 1
01:36:46:   Video Adapter: NVIDIA GeForce GTX 570
01:36:46:   Video Adapter Dedicated Video Memory: 1293352960
01:36:46:   Video Adapter Shared System Memory: 2952343552
01:36:46: =====Stream Start: 2013-06-07, 01:36:46===============================================
01:36:46:   Multithreaded optimizations: On
01:36:46:   Base resolution: 1920x1080
01:36:46:   Output resolution: 1536x864
01:36:46: ------------------------------------------
01:36:46: Loading up D3D10...
01:36:46: Playback device Default
01:36:46: ------------------------------------------
01:36:46: Using desktop audio input: Lautsprecher (Creative SB X-Fi)
01:36:46: Using 5.1 speaker setup
01:36:46: ------------------------------------------
01:36:46: Using auxilary audio input: Microphone (Creative SB X-Fi)
01:36:46: ------------------------------------------
01:36:46: Audio Encoding: AAC
01:36:46:     bitrate: 128
01:36:46: Using bitmap image
01:36:46: Using graphics capture
01:36:46: ------------------------------------------
01:36:46: Video Encoding: x264
01:36:46:     fps: 30
01:36:46:     width: 1536, height: 864
01:36:46:     preset: veryfast
01:36:46:     CBR: no
01:36:46:     CFR: no
01:36:46:     max bitrate: 2750
01:36:46:     buffer size: 2750
01:36:46:     quality: 10
01:36:46: ------------------------------------------
01:36:47: SharedTexCapture hooked
01:36:48: Using RTMP service: Twitch / Justin.tv
01:36:48:   Server selection: rtmp://live-ams.justin.tv/app
01:36:49: SO_SNDBUF was at 8192
01:36:49: SO_SNDBUF is now 65536
01:38:36: Total frames rendered: 3288, number of frames that lagged: 1 (0.03%) (it's okay for some frames to lag)
01:38:36: RTMPPublisher::SocketLoop: Aborting due to bStopping
01:38:36: Number of times waited to send: 0, Waited for a total of 0 bytes
01:38:36: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
01:38:36: =====Stream End: 2013-06-07, 01:38:36=================================================
01:38:39: 
01:38:39: Profiler results:
01:38:39: 
01:38:39: ==============================================================
01:38:39: frame - [100%] [avg time: 1.686 ms] [avg calls per frame: 1] [children: 77.5%] [unaccounted: 22.5%]
01:38:39: | scene->Preprocess - [0%] [avg time: 0 ms] [avg calls per frame: 1]
01:38:39: | video encoding and uploading - [77.5%] [avg time: 1.307 ms] [avg calls per frame: 1] [children: 73.7%] [unaccounted: 3.86%]
01:38:39: | | CopyResource - [0.89%] [avg time: 0.015 ms] [avg calls per frame: 0]
01:38:39: | | conversion to 4:2:0 - [3.26%] [avg time: 0.055 ms] [avg calls per frame: 0]
01:38:39: | | call to encoder - [68.2%] [avg time: 1.15 ms] [avg calls per frame: 0]
01:38:39: | | sending stuff out - [1.3%] [avg time: 0.022 ms] [avg calls per frame: 0]
01:38:39: ==============================================================
01:38:39:

I have constantly moved to ensure framerate is kept high.

Some more questions if you have time:
#1 Do I need to deactivate Aero even on a Game Capture? (aside from freeing RAM)
#2 Is there anything else you recommend changing?
#3 Can you recommend any site or tutorials for advanced x264 tweaking? If there is a way to improve stream-quality even further without burning my CPU, I'm willing to spend time to learn that.
#4 Are you recommending to lower the bitrate even when not encountering any lagging/dropped frames after hours of streaming?
 

swent

New Member
Correction: selecting the nearest server resulted in 4.9Mbps upload in the 6MB testmy.net test.
 

FerretBomb

Active Member
Looks like the bottleneck got resolved by moving to Game Capture. 0% preprocessing, ONE lagged frame, zero dropped. You're looking golden now. You can probably start raising your bitrate again, but I still wouldn't advise going over 3000kbps, just from a viewer standpoint (with a 3000kbps bitrate set, your viewers will each need a 3mbps downstream to watch your stream without seeing lag/stuttering). One reason I run at 2500kbps, in fact.

#1 Need to disable aero? No. It's just pretty-pretty though; it will apparently slightly speed up Window Capture mode, but otherwise is just unneccessary visual glitz; and if you need to stream a game in Screen Capture mode, will need to remember to turn it off. Pain in the backside, so I just leave it off (and drop the load on my video card slightly at the same time, as it's an older model).
#2 I'd run at either 1920x1080, or 1280x720; the former will give you better visual quality, the latter will probably let you bump to 60fps. It's really a 'test it and see' thing. Hell, you might be able to squeeze 1920x1080@60 even, if you muck with it enough.
#3 I don't know of any. I just leave the advanced x264 settings alone. They're black-box voodoo to me at the moment, and leaving them as-is generally is the best course of action for that stuff.
#4 No, but as we didn't know where your preprocess lag was coming from (Monitor Capture as it turns out), it was something to try. You get to a stable baseline, then add stuff. Don't jump to an endpoint, introducing a ton of variables at once... add them one at a time, to see what each does, and if it causes a problem. Because one will, and knowing which it is saves time and frustration. :) Now that you have a stable stream, you can start adding things one at a time (increased bitrate, increased resolution, increased framerate) until something breaks, then back it off and try another one to see if it breaks too. Basic troubleshooting, applied to configuration tuning.

Try a few testmy.net servers; especially ones near your chosen Twitch server if at all possible. Oh, and don't use the Frankfurt server if you are... it's known to be overloaded and delivers very shoddy performance.


As far as CPU, try using the Task Manager. Go to the Processes tab, right-click OBS, then Set Affinity. Uncheck a few cores (means it can't be assigned to those ones). Then do the same for your game, unchecking the ones you left checked for OBS. So the game and OBS can't run on the same CPU core, and shouldn't affect each other (well, memory bus bandwidth and other system resources aside). It won't stop your spiking, but it should improve the game's performance while streaming. Note that pegging the CPU is not a bad thing, so long as you monitor your temps and the system isn't overheating!
For example, I have a CoolerMaster Hyper 212+ heatsink on my CPU. I regularly peg ALL my cores, but the dissipation capacity of the (frankly awesome) heatsink keeps everything cool and ticking along perfectly. Would I prefer a little margin (~10%) to ensure any peaks are handled? Sure. But I'm on aging hardware, am not overclocking, and keeping everything in-trim. It won't wear anything worse, and I'm at no risk of a silicon-burn (again, awesome heatsink, highly recommended).
If you're only spiking to ~65% and your temps are in-range? I really wouldn't sweat it.
 

WayZHC

Member
Just btw use 64bit OBS instead of 32bit to get better stability since that way OBS can use more memory IF needed.

------------------------------------------------------

Offtopic spoiler about overclocking:
And little note about overclocking while using that fast memory. Many overclockers recommend underclocking fast RAM for better and more stable results. It's cause of the integrated memory controller bottlenecking. For example many people recommend (with 2400MHz sticks):

stock cpu clocks: full 2400MHz memory clock
4,5GHz or up: 1866MHz

These may vary but yeah the point is that by lowering ram clock you can go higher than 4,3GHz easily. When finding the best overclock it's recommend using them at 1333MHz and when highest overclock found, then increasing the RAM clock.

For example my friend has 3570k stable at 4,8GHz with 1866MHz RAM clock. 2400MHz memory causes bsod while loading to Windows.
 

swent

New Member
Thanks again, was gone for two weeks but I am back now and did some more tuning and testing.

I came to realize that the 1.25x downscale option together with a better detail filter seems to hit my CPU pretty good. So I moved to 1080p without downscaling. Worked great! For the moment...

First: Yeah, I am a not too serious overglocker, well I do tend to overclock quite a bit while trying to achieve low tempratures at the same time... not always possible but usually I'm going for a good mix.
That means my hardware is already running on higher clocks: CPU @ 4,3GHz (was 3.4GHz) and GPU @ 870MHz (was 735MHz). RAM, vRAM and buses are also somewhat tweaked but these won't affect streaming performance too much so I'll leave them out here.

Here is what I observerd: High framerates in the game seem to hit the CPU while streaming. So I capped in-game framerate to like 45. And that really wasn't a too good idea. 45 fps seems to be too far off, movement on the screen seems to stutter occasionally (or even periodically)... but it reduced CPU and GPU load which was awesome for streaming without having to pray for enough hardware power. It is however very noticable when watching the stream. I bet there are streams out there with more lags and even dropped frames, so you know... its somewhat enjoyable to watch it... but just doesn't feel smooth and good.

Here is my attemp to fix it:
First I enabled vsync, which made movement look smooth again while playing the game (at least when GPU load does not hit 95-100%). Then I reduced my graphic settings ingame to achieve a max GPU load of about 80% while streaming. CPU seems to keep up with these settings, so now it's all smooth while playing (and streaming ofc) but since I had to reduce graphics settings it just doesn't look that good anymore.
If you have any better solution, I'd love to try things!

Result:
Stream really seems smooth but there still is stuttering and I can't figure out how to get rid of it on my own. When watching other big streamers I can't seem to see any of that stuttering I experience on my own stream, so I clearly have something not set up properly.

This has been streamed with the said settings (1080p@30fps, veryfast, 3750kbps): Klick
While watching look at the trees passing by. You should clearly see what I mean when watching them.

Log to (I hope) that stream:
Code:
03:25:25: Open Broadcaster Software v0.522b - 32bit (´・ω・`)
03:25:25: -------------------------------
03:25:25: CPU Name: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
03:25:25: CPU Speed: 3652MHz
03:25:25: Physical Memory:  4095MB Total, 4095MB Free
03:25:25: stepping id: 9, model 10, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 4, total cores 4
03:25:25: monitor 1: pos={0, 0}, size={1920, 1080}
03:25:25: monitor 2: pos={-1920, 0}, size={1920, 1080}
03:25:25: Windows Version: 6.1 Build 7601 S
03:25:25: Aero is Enabled
03:25:25: -------------------------------
03:25:25: OBS Modules:
03:25:25: Base Address     Module
03:25:25: 01140000         OBS.exe
03:25:25: 637C0000         OBSApi.dll
03:25:25: 6D660000         DShowPlugin.dll
03:25:25: 6F3D0000         GraphicsCapture.dll
03:25:25: 70230000         NoiseGate.dll
03:25:25: ------------------------------------------
03:25:25: Adapter 1
03:25:25:   Video Adapter: NVIDIA GeForce GTX 570
03:25:25:   Video Adapter Dedicated Video Memory: 1293352960
03:25:25:   Video Adapter Shared System Memory: 2952343552
03:25:25: =====Stream Start: 2013-06-21, 03:25:25===============================================
03:25:25:   Multithreaded optimizations: On
03:25:25:   Base resolution: 1920x1080
03:25:25:   Output resolution: 1920x1080
03:25:25: ------------------------------------------
03:25:25: Loading up D3D10...
03:25:25: Playback device Default
03:25:25: ------------------------------------------
03:25:25: Using desktop audio input: Lautsprecher (Creative SB X-Fi)
03:25:25: Using 5.1 speaker setup
03:25:25: ------------------------------------------
03:25:25: Using auxilary audio input: Microphone (Creative SB X-Fi)
03:25:25: ------------------------------------------
03:25:25: Audio Encoding: AAC
03:25:25:     bitrate: 128
03:25:25: Using bitmap image
03:25:25: Using graphics capture
03:25:25: ------------------------------------------
03:25:25: Video Encoding: x264
03:25:25:     fps: 30
03:25:25:     width: 1920, height: 1080
03:25:25:     preset: veryfast
03:25:25:     CBR: no
03:25:25:     CFR: no
03:25:25:     max bitrate: 3750
03:25:25:     buffer size: 3750
03:25:25:     quality: 10
03:25:25: ------------------------------------------
Warning -- SharedTexCapture::Init: Could not open file mapping: 2
03:25:25: SharedTexCapture hooked
03:25:26: Using RTMP service: Twitch / Justin.tv
03:25:26:   Server selection: rtmp://live-ams.justin.tv/app
03:25:28: SO_SNDBUF was at 8192
03:25:28: SO_SNDBUF is now 65536
03:26:52: Total frames rendered: 2635, number of frames that lagged: 0 (0.00%) (it's okay for some frames to lag)
03:26:52: RTMPPublisher::SocketLoop: Aborting due to bStopping
03:26:52: Number of times waited to send: 0, Waited for a total of 0 bytes
03:26:52: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
03:26:53: =====Stream End: 2013-06-21, 03:26:53=================================================
03:26:54: 
03:26:54: Profiler results:
03:26:54: 
03:26:54: ==============================================================
03:26:54: frame - [100%] [avg time: 2.503 ms] [avg calls per frame: 1] [children: 79.3%] [unaccounted: 20.7%]
03:26:54: | scene->Preprocess - [0.04%] [avg time: 0.001 ms] [avg calls per frame: 1]
03:26:54: | video encoding and uploading - [79.3%] [avg time: 1.984 ms] [avg calls per frame: 1] [children: 77.6%] [unaccounted: 1.68%]
03:26:54: | | CopyResource - [2.4%] [avg time: 0.06 ms] [avg calls per frame: 0]
03:26:54: | | conversion to 4:2:0 - [1.96%] [avg time: 0.049 ms] [avg calls per frame: 0]
03:26:54: | | call to encoder - [72%] [avg time: 1.802 ms] [avg calls per frame: 0]
03:26:54: | | sending stuff out - [1.24%] [avg time: 0.031 ms] [avg calls per frame: 0]
03:26:54: ==============================================================
03:26:54:

Thanks for all your time,
swent
 

WayZHC

Member
Downscale is made by the GPU so it doesn't hit CPU at all. Your GPU had no room for the downscaling cause your game was using nearly all the power. Now you can try the downscale again since you have lower GPU usage which means more power for OBS
 
Top