Question / Help Extreme lag despite high-end rig and 10mb upload

Xerces

New Member
So, I'd like to stream. I would very much like to stream. I have a pretty good computer with an i7-2600k, a GTX580, plenty of RAM, and so on. I am also running on a decent connection, with 10mb download and 10mb upload, which should be more than enough to stream. The platform is Twitch.tv.

However, if I put my bitrate higher than 2000, my stream becomes utterly unwatchable. While I don't lose frames, both me and my viewers experience lag in the form of the video pausing to load every five to ten seconds. If I do keep my frame rate at 2000, the stream looks like garbage and becomes very pixelated. I've tried nearly every possible setting in OBS. Downscaling to 720, messed with CBR, quality balance, CPU presets, nearly everything. The game in question is DayZ, for the record.

I sincerely don't understand how this can occur when I have a fairly good rig and 10mb upload speed. I'd just like to be able to stream at a somewhat decent quality. Someone, for the love of god, help me end this nightmare. How is it that I (and anyone else, for that matter) can watch streams in glorious 1080p without experiencing any lag while mine goes apeshit when downscaled to 720 with a 3000 bitrate?

In this log I played with 3000 bitrate, and the stream stopped to load every 10-15 seconds.

Code:
18:11:54: Open Broadcaster Software v0.553b - 32bit (´・ω・`)
18:11:54: -------------------------------
18:11:54: CPU Name: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
18:11:54: CPU Speed: 3392MHz
18:11:54: Physical Memory:  4095MB Total, 3064MB Free
18:11:54: stepping id: 7, model 10, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
18:11:54: monitor 1: pos={0, 0}, size={1920, 1080}
18:11:54: monitor 2: pos={1920, 0}, size={1280, 1024}
18:11:54: Windows Version: 6.1 Build 7601 S
18:11:54: Aero is Enabled
18:11:54: -------------------------------
18:11:54: OBS Modules:
18:11:54: Base Address     Module
18:11:54: 00B70000         OBS.exe
18:11:54: 5A9B0000         OBSApi.dll
18:11:54: 5ED50000         DShowPlugin.dll
18:11:54: 6BCE0000         GraphicsCapture.dll
18:11:54: 70A70000         NoiseGate.dll
18:11:54: 66520000         PSVPlugin.dll
18:11:54: ------------------------------------------
18:11:54: Adapter 1
18:11:54:   Video Adapter: NVIDIA GeForce GTX 580
18:11:54:   Video Adapter Dedicated Video Memory: 1560739840
18:11:54:   Video Adapter Shared System Memory: 2684235776
18:11:54: =====Stream Start: 2014-01-03, 18:11:54===============================================
18:11:54:   Multithreaded optimizations: On
18:11:54:   Base resolution: 1280x720
18:11:54:   Output resolution: 1280x720
18:11:54: ------------------------------------------
18:11:54: Loading up D3D10 on NVIDIA GeForce GTX 580...
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/DrawTexture.pShader.blob
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/DrawSolid.pShader.blob
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/DrawYUVTexture.pShader.blob
18:11:54: Playback device {0.0.0.00000000}.{894e87c4-a1ca-4f5a-927c-c3c0078ae5ac}
18:11:54: ------------------------------------------
18:11:54: Using desktop audio input: Line (Steinberg CI1)
18:11:54: ------------------------------------------
18:11:54: Using auxilary audio input: Line (Steinberg CI1)
18:11:54: ------------------------------------------
18:11:54: Audio Encoding: AAC
18:11:54:     bitrate: 128
18:11:54: Using text output
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/ColorKey_RGB.pShader.blob
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/AlphaIgnore.pShader.blob
18:11:54: Using Window Capture
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/ColorKey_RGB.pShader.blob
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/AlphaIgnore.pShader.blob
18:11:54: Using bitmap image
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/ColorKey_RGB.pShader.blob
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/AlphaIgnore.pShader.blob
18:11:54: Using bitmap image
18:11:54: Using graphics capture
18:11:54: C:/Users/Magnus/AppData/Roaming/OBS/shaderCache/shaders/DrawTexture_ColorAdjust.pShader.blob
18:11:54: ------------------------------------------
18:11:54: Video Encoding: x264
18:11:54:     fps: 45
18:11:54:     width: 1280, height: 720
18:11:54:     preset: veryfast
18:11:54:     CBR: yes
18:11:54:     CFR: no
18:11:54:     max bitrate: 3000
18:11:54:     buffer size: 3000
18:11:54: ------------------------------------------
18:11:54: MMDeviceAudioSource: Frequency for device 'Line (Steinberg CI1)' is 352800, samples per sec is 44100
18:11:54: MMDeviceAudioSource: Frequency for device 'Line (Steinberg CI1)' is 352800, samples per sec is 44100
18:11:54: 
18:11:54: Profiler result for the last frame:
18:11:54: ==============================================================
18:11:54: frame - [time: 25.991 ms (cpu time: 0 ms)]
18:11:54: | frame preprocessing and rendering - [time: 25.894 ms (cpu time: 0 ms)]
18:11:54: | | scene->Preprocess - [time: 25.274 ms (cpu time: 0 ms)]
18:11:54: | video encoding and uploading - [time: 0.093 ms (cpu time: 0 ms)]
18:11:54: | | flush - [time: 0.088 ms (cpu time: 0 ms)]
18:11:54: ==============================================================
18:11:54: 
18:11:56: Using RTMP service: Twitch / Justin.tv
18:11:56:   Server selection: rtmp://live-lhr.justin.tv/app
18:11:56:   Interface: Realtek PCIe GBE Family Controller (ethernet, 100 mbps)
18:11:57: SO_SNDBUF was at 8192
18:11:57: SO_SNDBUF is now 65536
18:11:59: RTMPPublisher::Socketloop: Increasing send buffer to ISB 131072 (buffer: 0 / 400384)
18:12:02: SharedTexCapture hooked
18:12:25: RTMPPublisher::Socketloop: Increasing send buffer to ISB 262144 (buffer: 0 / 400384)
18:12:32: RTMPPublisher::Socketloop: Increasing send buffer to ISB 524288 (buffer: 0 / 400384)
18:19:37: Total frames rendered: 20756, number of late frames: 110 (0.53%) (it's okay for some frames to be late)
18:19:37: RTMPPublisher::SocketLoop: Graceful loop exit
18:19:38: Number of times waited to send: 0, Waited for a total of 0 bytes
18:19:38: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
18:19:38: 
18:19:38: Profiler results:
18:19:38: 
18:19:38: ==============================================================
18:19:38: frame - [100%] [avg time: 2.437 ms (cpu time: avg 1.719 ms, total 35693 ms)] [avg calls per frame: 1] [children: 99.8%] [unaccounted: 0.246%]
18:19:38: | frame preprocessing and rendering - [26.4%] [avg time: 0.643 ms (cpu time: avg 0.43 ms, total 8938.86 ms)] [avg calls per frame: 1] [children: 8.17%] [unaccounted: 18.2%]
18:19:38: | | scene->Preprocess - [8.17%] [avg time: 0.199 ms (cpu time: avg 0.052 ms, total 1092.01 ms)] [avg calls per frame: 1]
18:19:38: | video encoding and uploading - [73.4%] [avg time: 1.788 ms (cpu time: avg 1.286 ms, total 26707.4 ms)] [avg calls per frame: 1] [children: 63.4%] [unaccounted: 10%]
18:19:38: | | flush - [11.9%] [avg time: 0.289 ms (cpu time: avg 0.053 ms, total 1107.61 ms)] [avg calls per frame: 1]
18:19:38: | | CopyResource - [0.657%] [avg time: 0.016 ms (cpu time: avg 0.009 ms, total 187.201 ms)] [avg calls per frame: 0]
18:19:38: | | conversion to 4:2:0 - [0.246%] [avg time: 0.006 ms (cpu time: avg 0.009 ms, total 202.801 ms)] [avg calls per frame: 0]
18:19:38: | | call to encoder - [49.8%] [avg time: 1.213 ms (cpu time: avg 1.178 ms, total 24461 ms)] [avg calls per frame: 0]
18:19:38: | | sending stuff out - [0.821%] [avg time: 0.02 ms (cpu time: avg 0.018 ms, total 390.003 ms)] [avg calls per frame: 0]
18:19:38: | Convert444Threads - [1.83e+003%] [avg time: 44.521 ms (cpu time: avg 1.241 ms, total 25771.4 ms)] [avg calls per frame: 1]
18:19:38: ==============================================================
18:19:38: 
18:19:38: =====Stream End: 2014-01-03, 18:19:38=================================================


Last game capture log:
2014-01-03, 18:11:54: we're booting up: 
18:11:54: D3D9 Present
18:11:54: (half life scientist) everything..  seems to be in order
18:12:02: D3D9EndScene called
18:12:02: D3DPRESENT_PARAMETERS {
18:12:02: 	BackBufferWidth: 1920
18:12:02: 	BackBufferHeight: 1080
18:12:02: 	BackBufferFormat: D3DFMT_X8R8G8B8
18:12:02: 	BackBufferCount: 1
18:12:02: 	MultiSampleType: D3DMULTISAMPLE_NONE
18:12:02: 	MultiSampleQuality: 0
18:12:02: 	SwapEffect: D3DSWAPEFFECT_DISCARD
18:12:02: 	hDeviceWindow: 329110
18:12:02: 	Windowed: false
18:12:02: 	EnableAutoDepthStencil: true
18:12:02: 	AutoDepthStencilFormat: D3DFMT_D24S8
18:12:02: 	Flags: D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 
18:12:02: 	FullScreen_RefreshRateInHz: 60
18:12:02: 	PresentationInterval: 1
18:12:02: };
18:12:02: successfully set up d3d9 hooks
18:12:02: D3D9Present called
18:12:02: DoD3D9GPUHook: success - d3d9ex
18:12:02: D3DSURFACE_DESC {
18:12:02: 	Format: D3DFMT_X8R8G8B8
18:12:02: 	Type: D3DRTYPE_SURFACE
18:12:02: 	Usage: D3DUSAGE_RENDERTARGET 
18:12:02: 	Pool: D3DPOOL_DEFAULT
18:12:02: 	MultiSampleType: D3DMULTISAMPLE_NONE
18:12:02: 	MultiSampleQuality: 0
18:12:02: 	Width: 1920
18:12:02: 	Height: 1080
18:12:02: };
18:12:02: successfully capturing d3d9 frames via GPU
 

dodgepong

Administrator
Community Helper
You're on a very old version of OBS (the auto-updater was accidentally disabled in the version you have). Can you update to the latest, try again, and post an updated log file?
 

Xerces

New Member
dodgepong said:
You're on a very old version of OBS (the auto-updater was accidentally disabled in the version you have). Can you update to the latest, try again, and post an updated log file?

First of all, let me thank you for your very fast response.

I did ask you asked. Here is a new logfile with the newest version, again with a 3000 bitrate (which looks very nice, might I add).

Code:
18:44:31: Open Broadcaster Software v0.592b - 32bit (´・ω・`)
18:44:31: -------------------------------
18:44:31: CPU Name: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz
18:44:31: CPU Speed: 3392MHz
18:44:31: Physical Memory:  4095MB Total, 3322MB Free
18:44:31: stepping id: 7, model 42, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
18:44:31: monitor 1: pos={0, 0}, size={1920, 1080}
18:44:31: monitor 2: pos={1920, 0}, size={1280, 1024}
18:44:31: Windows Version: 6.1 Build 7601 S
18:44:31: Aero is Enabled
18:44:31: -------------------------------
18:44:31: OBS Modules:
18:44:31: Base Address     Module
18:44:31: 011E0000         OBS.exe
18:44:31: 5E0A0000         OBSApi.dll
18:44:31: 6AAC0000         DShowPlugin.dll
18:44:31: 6F430000         GraphicsCapture.dll
18:44:31: 733C0000         NoiseGate.dll
18:44:31: 6AB40000         PSVPlugin.dll
18:44:31: ------------------------------------------
18:44:31: Adapter 1
18:44:31:   Video Adapter: NVIDIA GeForce GTX 580
18:44:31:   Video Adapter Dedicated Video Memory: 1560739840
18:44:31:   Video Adapter Shared System Memory: 2684235776
18:44:31:   Video Adapter Output 1: pos={0, 0}, size={1920, 1080}, attached=true
18:44:31:   Video Adapter Output 2: pos={1920, 0}, size={1280, 1024}, attached=true
18:44:31: =====Stream Start: 2014-01-03, 18:44:31===============================================
18:44:31:   Multithreaded optimizations: On
18:44:31:   Base resolution: 1280x720
18:44:31:   Output resolution: 1280x720
18:44:31: ------------------------------------------
18:44:31: Loading up D3D10 on NVIDIA GeForce GTX 580 (Adapter 1)...
18:44:31: ------------------------------------------
18:44:31: Audio Format: 48000hz
18:44:31: Playback device {0.0.0.00000000}.{894e87c4-a1ca-4f5a-927c-c3c0078ae5ac}
18:44:31: ------------------------------------------
18:44:31: Using desktop audio input: Line (Steinberg CI1)
18:44:31: ------------------------------------------
18:44:31: Using auxilary audio input: Line (Steinberg CI1)
18:44:31: ------------------------------------------
18:44:31: Audio Encoding: AAC
18:44:31:     bitrate: 128
18:44:31: Using text output
18:44:31: Using Window Capture
18:44:31: Using bitmap image
18:44:31: Using bitmap image
18:44:31: Using graphics capture
18:44:31: Scene buffering time set to 400
18:44:31: ------------------------------------------
18:44:31: Video Encoding: x264
18:44:31:     fps: 45
18:44:31:     width: 1280, height: 720
18:44:31:     preset: veryfast
18:44:31:     profile: high
18:44:31:     keyint: 90
18:44:31:     CBR: yes
18:44:31:     CFR: no
18:44:31:     max bitrate: 3000
18:44:31:     buffer size: 3000
18:44:31: ------------------------------------------
18:44:31: MMDeviceAudioSource: Frequency for device 'Line (Steinberg CI1)' is 352800, samples per sec is 44100
18:44:31: MMDeviceAudioSource: Frequency for device 'Line (Steinberg CI1)' is 352800, samples per sec is 44100
18:44:33: Using RTMP service: Twitch / Justin.tv
18:44:33:   Server selection: rtmp://live-lhr.justin.tv/app
18:44:33:   Interface: Realtek PCIe GBE Family Controller (ethernet, 100 mbps)
18:44:33: Completed handshake with rtmp://live-lhr.justin.tv/app in 425 ms.
18:44:34: SO_SNDBUF was at 8192
18:44:34: SO_SNDBUF is now 65536
18:44:38: SharedTexCapture hooked
18:44:39: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 262144 (buffer: 24823 / 400384)
18:44:52: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 524288 (buffer: 0 / 400384)
18:49:33: Total frames encoded: 13549, total frames duplicated: 309 (2.28%)
18:49:33: Total frames rendered: 13526, number of late frames: 12 (0.09%) (it's okay for some frames to be late)
18:49:33: RTMPPublisher::SocketLoop: Graceful loop exit
18:49:33: Average send payload: 6850 bytes, average send interval: 17 ms
18:49:33: Number of times waited to send: 0, Waited for a total of 0 bytes
18:49:33: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
18:49:33: Number of bytes sent: 116577255
18:49:33: 
18:49:33: Profiler time results:
18:49:33: 
18:49:33: ==============================================================
18:49:33: video thread frame - [100%] [avg time: 1.381 ms] [children: 61.8%] [unaccounted: 38.2%]
18:49:33: | scene->Preprocess - [24.4%] [avg time: 0.337 ms]
18:49:33: | GPU download and conversion - [37.4%] [avg time: 0.517 ms] [children: 9.2%] [unaccounted: 28.2%]
18:49:33: | | flush - [7.17%] [avg time: 0.099 ms]
18:49:33: | | CopyResource - [1.88%] [avg time: 0.026 ms]
18:49:33: | | conversion to 4:2:0 - [0.145%] [avg time: 0.002 ms]
18:49:33: Convert444Threads - [100%] [avg time: 0.503 ms] [children: 98.8%] [unaccounted: 1.19%]
18:49:33: | Convert444toNV12 - [98.8%] [avg time: 0.497 ms]
18:49:33: encoder thread frame - [100%] [avg time: 0.977 ms]
18:49:33: ==============================================================
18:49:33: 
18:49:33: 
18:49:33: Profiler CPU results:
18:49:33: 
18:49:33: ==============================================================
18:49:33: video thread frame - [cpu time: avg 0.205 ms, total 2776.82 ms] [avg calls per frame: 1]
18:49:33: | scene->Preprocess - [cpu time: avg 0.01 ms, total 140.4 ms] [avg calls per frame: 1]
18:49:33: | GPU download and conversion - [cpu time: avg 0.029 ms, total 405.602 ms] [avg calls per frame: 1]
18:49:33: | | flush - [cpu time: avg 0.021 ms, total 296.402 ms] [avg calls per frame: 1]
18:49:33: | | CopyResource - [cpu time: avg 0.003 ms, total 46.8 ms] [avg calls per frame: 1]
18:49:33: | | conversion to 4:2:0 - [cpu time: avg 0.001 ms, total 15.6 ms] [avg calls per frame: 1]
18:49:33: Convert444Threads - [cpu time: avg 0.489 ms, total 13228.9 ms] [avg calls per frame: 2]
18:49:33: | Convert444toNV12 - [cpu time: avg 0.485 ms, total 13104.1 ms] [avg calls per frame: 2]
18:49:33: encoder thread frame - [cpu time: avg 0.239 ms, total 3244.82 ms] [avg calls per frame: 1]
18:49:33: ==============================================================
18:49:33: 
18:49:33: =====Stream End: 2014-01-03, 18:49:33=================================================


Last game capture log:
2014-01-03, 18:44:31: we're booting up: 
18:44:31: CaptureThread: attached to process DayZ.exe
18:44:32: D3D9 Present
18:44:32: (half life scientist) everything..  seems to be in order
18:44:38: D3D9EndScene called
18:44:38: D3DPRESENT_PARAMETERS {
18:44:38: 	BackBufferWidth: 1920
18:44:38: 	BackBufferHeight: 1080
18:44:38: 	BackBufferFormat: D3DFMT_X8R8G8B8
18:44:38: 	BackBufferCount: 1
18:44:38: 	MultiSampleType: D3DMULTISAMPLE_NONE
18:44:38: 	MultiSampleQuality: 0
18:44:38: 	SwapEffect: D3DSWAPEFFECT_DISCARD
18:44:38: 	hDeviceWindow: 132484
18:44:38: 	Windowed: false
18:44:38: 	EnableAutoDepthStencil: true
18:44:38: 	AutoDepthStencilFormat: D3DFMT_D24S8
18:44:38: 	Flags: D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 
18:44:38: 	FullScreen_RefreshRateInHz: 60
18:44:38: 	PresentationInterval: 1
18:44:38: };
18:44:38: successfully set up d3d9 hooks
18:44:38: D3D9Present called
18:44:38: DoD3D9GPUHook: success - d3d9ex
18:44:38: D3DSURFACE_DESC {
18:44:38: 	Format: D3DFMT_X8R8G8B8
18:44:38: 	Type: D3DRTYPE_SURFACE
18:44:38: 	Usage: D3DUSAGE_RENDERTARGET 
18:44:38: 	Pool: D3DPOOL_DEFAULT
18:44:38: 	MultiSampleType: D3DMULTISAMPLE_NONE
18:44:38: 	MultiSampleQuality: 0
18:44:38: 	Width: 1920
18:44:38: 	Height: 1080
18:44:38: };
18:44:38: successfully capturing d3d9 frames via GPU
 

hilalpro

Member
Your log looks fine and you're not dropping any frames which basically means you guys are having problems downloading 3.2mbps from twitch.. You can try something a little easier like 720p@30fps at 2500 bitrate and see if that give you any issues.
 

Xerces

New Member
hilalpro said:
Your log looks fine and you're not dropping any frames which basically means you guys are having problems downloading 3.2mbps from twitch.. You can try something a little easier like 720p@30fps at 2500 bitrate and see if that give you any issues.

That could very well be the case, but everyone else who watches my stream is having the same issue. But I will lower the fps and bitrate and report back, although I still think 2500 might not give me the results I want.
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
It probably depends on the server you stream to, and where your viewers are located. It also probably depends on whether you're partnered or not, but I'm not entirely sure. They recently changed their whole networking system, so things are still sort of chaotic right now.
 

Xerces

New Member
Jim said:
It probably depends on the server you stream to, and where your viewers are located. It also probably depends on whether you're partnered or not, but I'm not entirely sure. They recently changed their whole networking system, so things are still sort of chaotic right now.

I've tried many different servers. I'm in Europe, and I have tried literally every server there is. Today I tried the US server and got the same result. What I do not understand is why I get lag (again, not frame drops, but the stream pausing itself to load) while watching my own stream in addition to other viewers experiencing it aswell. Even if their network is chaotic, I can watch any other stream with zero issue, regardless of the quality.
 

Xerces

New Member
hilalpro said:
Your log looks fine and you're not dropping any frames which basically means you guys are having problems downloading 3.2mbps from twitch.. You can try something a little easier like 720p@30fps at 2500 bitrate and see if that give you any issues.

Reporting back as promised. I tried lowering it, and I am still experiencing the same issue.
 

Belhifet

New Member
Are you aware of the difference between delay and lag? Whats the twitch channel?

Edit: I see now that you've described that lag. I had thought that this particular issue was fixed(the delete shaders bug thing, any chance thats the culprit? He was using a version that was prone to it)
 

Krazy

Town drunk
From what I have noticed, non-partnered, low viewer count streams are served to viewers from the San Francisco server. This compounds the issue of high bitrate streams struggling to maintain their throughput to the intended audience. Twitch has said with the new HLS system and some more hardware rejiggering, that more streams will be able to be served from closer to the viewer, but for right now the only thing you can do is lower bitrate until the buffering stops.
 

Xerces

New Member
Krazy said:
From what I have noticed, non-partnered, low viewer count streams are served to viewers from the San Francisco server. This compounds the issue of high bitrate streams struggling to maintain their throughput to the intended audience. Twitch has said with the new HLS system and some more hardware rejiggering, that more streams will be able to be served from closer to the viewer, but for right now the only thing you can do is lower bitrate until the buffering stops.

While I will take your word for it, I still do not understand how other streams with the same amount of viewers run better than mine in that case. But alas, I will try to wait it out, although this has been an issue for a very long time.

Finally, is there anything at all I can do to make it look better while still keeping a 2000 bitrate?
 

FerretBomb

Active Member
Yep, recommended maximum bitrate for non-partnered streamers is 2000kbps. If you're still getting buffering issues, you may need to drop that further. A 720p@30fps stream will look decent on even 1500kbps; 3000+ for a 720@45 stream is ridiculous amounts of overkill, unless you're playing a racing game or something.
Even a 720@30 at 2000kbps will be enough for most FPS/MMOs out there with acceptable levels of visual artifacting, and look quite good on other, lower-motion games. Remember, you WILL need to manage expectations at some point, as with current technology levels you will NEVER be able to achieve a perfect 1:1 stream.

If you have the CPU overhead available, you may also be able to move to a slower encoding preset which will improve visual clarity at the expense of additional CPU load.
 
Top