Question / Help Strange lags on stream

Supermoler

New Member
Here is a video: http://www.twitch.tv/supermoler/b/496561117

The screen randomly goes freeze and then skip a few seconds...

Here is the log:

Code:
21:01:50: Settings::Video: Disabling Aero
21:02:01: Open Broadcaster Software v0.592b - 32bit (´・ω・`)
21:02:01: -------------------------------
21:02:01: CPU Name: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
21:02:01: CPU Speed: 3209MHz
21:02:01: Physical Memory:  4095MB Total, 3062MB Free
21:02:01: stepping id: 9, model 58, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 4, total cores 4
21:02:01: monitor 1: pos={0, 0}, size={1680, 1050}
21:02:01: Windows Version: 6.1 Build 7601 S
21:02:01: Aero is Disabled
21:02:01: -------------------------------
21:02:01: OBS Modules:
21:02:01: Base Address     Module
21:02:01: 00D70000         OBS.exe
21:02:01: 5FBF0000         OBSApi.dll
21:02:01: 5FEB0000         DShowPlugin.dll
21:02:01: 6F620000         GraphicsCapture.dll
21:02:01: 6F600000         NoiseGate.dll
21:02:01: 69B10000         PSVPlugin.dll
21:02:01: ------------------------------------------
21:02:01: Adapter 1
21:02:01:   Video Adapter: NVIDIA GeForce GTX 650
21:02:01:   Video Adapter Dedicated Video Memory: 1018888192
21:02:01:   Video Adapter Shared System Memory: 3221549056
21:02:01:   Video Adapter Output 1: pos={0, 0}, size={1680, 1050}, attached=true
21:02:01: ------------------------------------------
21:02:01: Adapter 2
21:02:01:   Video Adapter: Intel(R) HD Graphics
21:02:01:   Video Adapter Dedicated Video Memory: 67108864
21:02:01:   Video Adapter Shared System Memory: 1711276032
21:02:01: Using automatic low latency mode
21:02:01: =====Stream Start: 2014-01-19, 21:02:01===============================================
21:02:01:   Multithreaded optimizations: On
21:02:01:   Base resolution: 1680x1050
21:02:01:   Output resolution: 1680x1050
21:02:01: ------------------------------------------
21:02:01: Loading up D3D10 on NVIDIA GeForce GTX 650 (Adapter 1)...
21:02:01: ------------------------------------------
21:02:01: Audio Format: 48000hz
21:02:01: Playback device Default
21:02:01: ------------------------------------------
21:02:01: Using desktop audio input: Hangszórók (Realtek High Definition Audio)
21:02:01: ------------------------------------------
21:02:01: Using auxilary audio input: Mikrofon (Realtek High Definition Audio)
21:02:01: ------------------------------------------
21:02:01: Audio Encoding: AAC
21:02:01:     bitrate: 320
21:02:01: Using graphics capture
21:02:01: Scene buffering time set to 400
21:02:01: ------------------------------------------
21:02:01: Video Encoding: x264
21:02:01:     fps: 60
21:02:01:     width: 1680, height: 1050
21:02:01:     preset: ultrafast
21:02:01:     profile: main
21:02:01:     keyint: 120
21:02:01:     CBR: no
21:02:01:     CFR: no
21:02:01:     max bitrate: 6500
21:02:01:     buffer size: 6500
21:02:01:     quality: 10
21:02:01: ------------------------------------------
21:02:01: MMDeviceAudioSource: Frequency for device 'Hangszórók (Realtek High Definition Audio)' is 1536000, samples per sec is 192000
21:02:01: MMDeviceAudioSource: Frequency for device 'Mikrofon (Realtek High Definition Audio)' is 352800, samples per sec is 44100
21:02:01: SharedTexCapture hooked
21:02:03: GraphicsCaptureSource::NewCapture:  eliminating old capture
21:02:03: SharedTexCapture hooked
21:02:03: Using RTMP service: Twitch / Justin.tv
21:02:03:   Server selection: rtmp://live-fra.justin.tv/app
21:02:03:   Interface: Realtek PCIe GBE Family Controller (ethernet, 1000 mbps)
21:02:04: Completed handshake with rtmp://live-fra.justin.tv/app in 470 ms.
21:02:05: SO_SNDBUF was at 8192
21:02:05: SO_SNDBUF is now 65536
21:07:42: Total frames encoded: 20400, total frames duplicated: 60 (0.29%)
21:07:42: Total frames rendered: 20380, number of late frames: 3 (0.01%) (it's okay for some frames to be late)
21:07:44: RTMPPublisher::SocketLoop: Graceful loop exit
21:07:44: Average send payload: 1450 bytes, average send interval: 1 ms
21:07:44: Number of times waited to send: 28030, Waited for a total of 105347727 bytes
21:07:44: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 1774 (8.7%), Total 1774 (8.7%)
21:07:44: Number of bytes sent: 259340567
21:07:44: 
21:07:44: Profiler time results:
21:07:44: 
21:07:44: ==============================================================
21:07:44: video thread frame - [100%] [avg time: 0.755 ms] [children: 38.9%] [unaccounted: 61.1%]
21:07:44: | scene->Preprocess - [0.132%] [avg time: 0.001 ms]
21:07:44: | GPU download and conversion - [38.8%] [avg time: 0.293 ms] [children: 8.48%] [unaccounted: 30.3%]
21:07:44: | | flush - [6.62%] [avg time: 0.05 ms]
21:07:44: | | CopyResource - [1.59%] [avg time: 0.012 ms]
21:07:44: | | conversion to 4:2:0 - [0.265%] [avg time: 0.002 ms]
21:07:44: Convert444Threads - [100%] [avg time: 0.641 ms] [children: 99.1%] [unaccounted: 0.936%]
21:07:44: | Convert444toNV12 - [99.1%] [avg time: 0.635 ms]
21:07:44: encoder thread frame - [100%] [avg time: 0.816 ms]
21:07:44: ==============================================================
21:07:44: 
21:07:44: 
21:07:44: Profiler CPU results:
21:07:44: 
21:07:44: ==============================================================
21:07:44: video thread frame - [cpu time: avg 0.035 ms, total 733.204 ms] [avg calls per frame: 1]
21:07:44: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:07:44: | GPU download and conversion - [cpu time: avg 0.008 ms, total 171.601 ms] [avg calls per frame: 1]
21:07:44: | | flush - [cpu time: avg 0.004 ms, total 93.6 ms] [avg calls per frame: 1]
21:07:44: | | CopyResource - [cpu time: avg 0.001 ms, total 31.2 ms] [avg calls per frame: 1]
21:07:44: | | conversion to 4:2:0 - [cpu time: avg 0.001 ms, total 31.201 ms] [avg calls per frame: 1]
21:07:44: Convert444Threads - [cpu time: avg 0.832 ms, total 33867.8 ms] [avg calls per frame: 2]
21:07:44: | Convert444toNV12 - [cpu time: avg 0.823 ms, total 33524.6 ms] [avg calls per frame: 2]
21:07:44: encoder thread frame - [cpu time: avg 0.052 ms, total 1076.41 ms] [avg calls per frame: 1]
21:07:44: ==============================================================
21:07:44: 
21:07:44: =====Stream End: 2014-01-19, 21:07:44=================================================
21:18:28: Settings::Video: Disabling Aero
21:19:51: Using automatic low latency mode
21:19:51: =====Stream Start: 2014-01-19, 21:19:51===============================================
21:19:51:   Multithreaded optimizations: On
21:19:51:   Base resolution: 1680x1050
21:19:51:   Output resolution: 1680x1050
21:19:51: ------------------------------------------
21:19:51: Loading up D3D10 on NVIDIA GeForce GTX 650 (Adapter 1)...
21:19:51: ------------------------------------------
21:19:51: Audio Format: 48000hz
21:19:51: Playback device Default
21:19:51: ------------------------------------------
21:19:51: Using desktop audio input: Hangszórók (Realtek High Definition Audio)
21:19:51: ------------------------------------------
21:19:51: Using auxilary audio input: Mikrofon (Realtek High Definition Audio)
21:19:51: ------------------------------------------
21:19:51: Audio Encoding: AAC
21:19:51:     bitrate: 320
21:19:51: Using graphics capture
21:19:51: Scene buffering time set to 400
21:19:51: ------------------------------------------
21:19:51: Video Encoding: x264
21:19:51:     fps: 25
21:19:51:     width: 1680, height: 1050
21:19:51:     preset: ultrafast
21:19:51:     profile: main
21:19:51:     keyint: 50
21:19:51:     CBR: no
21:19:51:     CFR: no
21:19:51:     max bitrate: 6500
21:19:51:     buffer size: 6500
21:19:51:     quality: 10
21:19:51: ------------------------------------------
21:19:51: MMDeviceAudioSource: Frequency for device 'Hangszórók (Realtek High Definition Audio)' is 1536000, samples per sec is 192000
21:19:51: MMDeviceAudioSource: Frequency for device 'Mikrofon (Realtek High Definition Audio)' is 352800, samples per sec is 44100
21:19:51: SharedTexCapture hooked
21:19:54: Using RTMP service: Twitch / Justin.tv
21:19:54:   Server selection: rtmp://live-fra.justin.tv/app
21:19:54:   Interface: Realtek PCIe GBE Family Controller (ethernet, 1000 mbps)
21:19:54: Completed handshake with rtmp://live-fra.justin.tv/app in 514 ms.
21:19:56: SO_SNDBUF was at 8192
21:19:56: SO_SNDBUF is now 65536
21:20:03: GraphicsCaptureSource::NewCapture:  eliminating old capture
21:20:03: SharedTexCapture hooked
21:20:14: GraphicsCaptureSource::NewCapture:  eliminating old capture
21:20:14: SharedTexCapture hooked
21:44:16: Total frames encoded: 36591, total frames duplicated: 25 (0.07%)
21:44:16: Total frames rendered: 36578, number of late frames: 5 (0.01%) (it's okay for some frames to be late)
21:44:18: RTMPPublisher::SocketLoop: Socket error, send() returned -1, GetLastError() 10038
21:44:19: Average send payload: 1458 bytes, average send interval: 2 ms
21:44:19: Number of times waited to send: 210674, Waited for a total of 816524528 bytes
21:44:19: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 4980 (14%), Total 4980 (14%)
21:44:19: Number of bytes sent: 1058465944
21:44:19: 
21:44:19: Profiler time results:
21:44:19: 
21:44:19: ==============================================================
21:44:19: video thread frame - [100%] [avg time: 0.635 ms] [children: 23.1%] [unaccounted: 76.9%]
21:44:19: | scene->Preprocess - [0.157%] [avg time: 0.001 ms]
21:44:19: | GPU download and conversion - [23%] [avg time: 0.146 ms] [children: 17.5%] [unaccounted: 5.51%]
21:44:19: | | flush - [15.4%] [avg time: 0.098 ms]
21:44:19: | | CopyResource - [1.73%] [avg time: 0.011 ms]
21:44:19: | | conversion to 4:2:0 - [0.315%] [avg time: 0.002 ms]
21:44:19: Convert444Threads - [100%] [avg time: 0.636 ms] [children: 98.9%] [unaccounted: 1.1%]
21:44:19: | Convert444toNV12 - [98.9%] [avg time: 0.629 ms]
21:44:19: encoder thread frame - [100%] [avg time: 0.936 ms]
21:44:19: ==============================================================
21:44:19: 
21:44:19: 
21:44:19: Profiler CPU results:
21:44:19: 
21:44:19: ==============================================================
21:44:19: video thread frame - [cpu time: avg 0.012 ms, total 468.002 ms] [avg calls per frame: 1]
21:44:19: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:44:19: | GPU download and conversion - [cpu time: avg 0.007 ms, total 280.802 ms] [avg calls per frame: 1]
21:44:19: | | flush - [cpu time: avg 0.006 ms, total 249.602 ms] [avg calls per frame: 1]
21:44:19: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:44:19: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:44:19: Convert444Threads - [cpu time: avg 0.873 ms, total 63898 ms] [avg calls per frame: 2]
21:44:19: | Convert444toNV12 - [cpu time: avg 0.867 ms, total 63430 ms] [avg calls per frame: 2]
21:44:19: encoder thread frame - [cpu time: avg 0.142 ms, total 5226.03 ms] [avg calls per frame: 1]
21:44:19: ==============================================================
21:44:19: 
21:44:19: =====Stream End: 2014-01-19, 21:44:19=================================================


Last game capture log:
2014-01-19, 21:02:01: we're booting up: 
21:02:01: CaptureThread: attached to process TERA.exe
21:02:01: D3D9 Present
21:02:01: (half life scientist) everything..  seems to be in order
21:02:01: D3D9EndScene called
21:02:01: D3DPRESENT_PARAMETERS {
21:02:01: 	BackBufferWidth: 1680
21:02:01: 	BackBufferHeight: 1050
21:02:01: 	BackBufferFormat: D3DFMT_A8R8G8B8
21:02:01: 	BackBufferCount: 1
21:02:01: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:02:01: 	MultiSampleQuality: 0
21:02:01: 	SwapEffect: D3DSWAPEFFECT_DISCARD
21:02:01: 	hDeviceWindow: 262932
21:02:01: 	Windowed: false
21:02:01: 	EnableAutoDepthStencil: false
21:02:01: 	AutoDepthStencilFormat: D3DFMT_UNKNOWN
21:02:01: 	Flags: D3DPRESENTFLAG_LOCKABLE_BACKBUFFER 
21:02:01: 	FullScreen_RefreshRateInHz: 60
21:02:01: 	PresentationInterval: 2147483648
21:02:01: };
21:02:01: successfully set up d3d9 hooks
21:02:01: D3D9Present called
21:02:01: DoD3D9GPUHook: success
21:02:01: D3DSURFACE_DESC {
21:02:01: 	Format: D3DFMT_A8R8G8B8
21:02:01: 	Type: D3DRTYPE_SURFACE
21:02:01: 	Usage: D3DUSAGE_RENDERTARGET 
21:02:01: 	Pool: D3DPOOL_DEFAULT
21:02:01: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:02:01: 	MultiSampleQuality: 0
21:02:01: 	Width: 1680
21:02:01: 	Height: 1050
21:02:01: };
21:02:01: successfully capturing d3d9 frames via GPU
21:02:02: D3D9Reset called
21:02:02: ---------------------- Cleared D3D9 Capture ----------------------
21:02:02: successfully set up d3d9 hooks
21:02:03: D3D9EndScene called
21:02:03: D3D9Present called
21:02:03: DoD3D9GPUHook: success
21:02:03: D3DSURFACE_DESC {
21:02:03: 	Format: D3DFMT_A8R8G8B8
21:02:03: 	Type: D3DRTYPE_SURFACE
21:02:03: 	Usage: D3DUSAGE_RENDERTARGET 
21:02:03: 	Pool: D3DPOOL_DEFAULT
21:02:03: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:02:03: 	MultiSampleQuality: 0
21:02:03: 	Width: 1680
21:02:03: 	Height: 1050
21:02:03: };
21:02:03: successfully capturing d3d9 frames via GPU
21:07:43: ---------------------- Cleared D3D9 Capture ----------------------
21:07:43: D3D9EndScene called
21:07:43: D3D9Present called
21:07:52: D3D9Reset called
21:07:52: ---------------------- Cleared D3D9 Capture ----------------------
21:07:52: successfully set up d3d9 hooks
21:07:53: D3D9EndScene called
21:07:53: D3D9Present called
21:13:19: D3D9Reset called
21:13:19: ---------------------- Cleared D3D9 Capture ----------------------
21:13:19: successfully set up d3d9 hooks
21:13:20: D3D9EndScene called
21:13:20: D3D9Present called
21:13:56: D3D9Reset called
21:13:56: ---------------------- Cleared D3D9 Capture ----------------------
21:13:57: successfully set up d3d9 hooks
21:13:57: D3D9EndScene called
21:13:57: D3D9Present called
21:16:04: D3D9Reset called
21:16:04: ---------------------- Cleared D3D9 Capture ----------------------
21:16:05: successfully set up d3d9 hooks
21:16:05: D3D9EndScene called
21:16:05: D3D9Present called
21:17:05: D3D9Reset called
21:17:05: ---------------------- Cleared D3D9 Capture ----------------------
21:17:05: successfully set up d3d9 hooks
21:17:06: D3D9EndScene called
21:17:06: D3D9Present called
21:17:46: D3D9Reset called
21:17:46: ---------------------- Cleared D3D9 Capture ----------------------
21:17:47: successfully set up d3d9 hooks
21:17:48: D3D9EndScene called
21:17:48: D3D9Present called
21:18:58: D3D9Reset called
21:18:58: ---------------------- Cleared D3D9 Capture ----------------------
21:18:58: successfully set up d3d9 hooks
21:18:59: D3D9EndScene called
21:18:59: D3D9Present called
21:19:33: D3D9Reset called
21:19:33: ---------------------- Cleared D3D9 Capture ----------------------
21:19:33: successfully set up d3d9 hooks
21:19:34: D3D9EndScene called
21:19:34: D3D9Present called
21:19:51: received restart event, capturing
21:19:51: DoD3D9GPUHook: success
21:19:51: D3DSURFACE_DESC {
21:19:51: 	Format: D3DFMT_A8R8G8B8
21:19:51: 	Type: D3DRTYPE_SURFACE
21:19:51: 	Usage: D3DUSAGE_RENDERTARGET 
21:19:51: 	Pool: D3DPOOL_DEFAULT
21:19:51: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:19:51: 	MultiSampleQuality: 0
21:19:51: 	Width: 1680
21:19:51: 	Height: 1050
21:19:51: };
21:19:51: successfully capturing d3d9 frames via GPU
21:20:02: D3D9Reset called
21:20:02: ---------------------- Cleared D3D9 Capture ----------------------
21:20:02: successfully set up d3d9 hooks
21:20:03: D3D9EndScene called
21:20:03: D3D9Present called
21:20:03: DoD3D9GPUHook: success
21:20:03: D3DSURFACE_DESC {
21:20:03: 	Format: D3DFMT_A8R8G8B8
21:20:03: 	Type: D3DRTYPE_SURFACE
21:20:03: 	Usage: D3DUSAGE_RENDERTARGET 
21:20:03: 	Pool: D3DPOOL_DEFAULT
21:20:03: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:20:03: 	MultiSampleQuality: 0
21:20:03: 	Width: 1680
21:20:03: 	Height: 1050
21:20:03: };
21:20:03: successfully capturing d3d9 frames via GPU
21:20:13: D3D9Reset called
21:20:13: ---------------------- Cleared D3D9 Capture ----------------------
21:20:13: successfully set up d3d9 hooks
21:20:14: D3D9EndScene called
21:20:14: D3D9Present called
21:20:14: DoD3D9GPUHook: success
21:20:14: D3DSURFACE_DESC {
21:20:14: 	Format: D3DFMT_A8R8G8B8
21:20:14: 	Type: D3DRTYPE_SURFACE
21:20:14: 	Usage: D3DUSAGE_RENDERTARGET 
21:20:14: 	Pool: D3DPOOL_DEFAULT
21:20:14: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:20:14: 	MultiSampleQuality: 0
21:20:14: 	Width: 1680
21:20:14: 	Height: 1050
21:20:14: };
21:20:14: successfully capturing d3d9 frames via GPU
21:44:16: ---------------------- Cleared D3D9 Capture ----------------------
21:44:16: D3D9EndScene called
21:44:16: D3D9Present called
21:44:29: D3D9Reset called
21:44:29: ---------------------- Cleared D3D9 Capture ----------------------
21:44:29: successfully set up d3d9 hooks
21:44:29: D3D9EndScene called
21:44:29: D3D9Present called
21:45:16: D3D9Reset called
21:45:16: ---------------------- Cleared D3D9 Capture ----------------------
21:45:17: successfully set up d3d9 hooks
21:45:17: D3D9EndScene called
21:45:17: D3D9Present called
21:47:21: D3D9Reset called
21:47:21: ---------------------- Cleared D3D9 Capture ----------------------
21:47:21: successfully set up d3d9 hooks
21:47:22: D3D9EndScene called
21:47:22: D3D9Present called


Yes, I realize it's a terribly high bitrate, but that's the only way I could make the screen look decent... I'm no expert in this, so I'm asking you if there is any way to make the stream watchable with such a motion-full game.. :/

Thanks in advance,
 

dodgepong

Administrator
Community Helper
Re: Strange laggs on stream

Wow, there is a lot wrong with your streaming setup. Let's take it one step at a time.

First, don't stream at more than 3500kbps on Twitch. Not only do they not want streamers to do that, but you have to remember that in order to watch a high-bitrate stream, the viewer has to have enough download speed to download at the rate you are uploading. Most people won't be able to watch at 6500kbps stream smoothly, if at all. Not only that, but you are dropping frames, which is usually caused by not a good enough network connection to the streaming server to transmit data at the speed you specified. So 3500kbps should be your max.

So you'll probably notice that your quality will decrease a lot as a result. This is largely because you're using the ultrafast preset. You'll want to change that back to veryfast. The x264 preset defines a set of settings for the encoder to use that affects quality. The "ultrafast" preset skips a lot of extra things that help the stream look good, but the result is that it's easier on your CPU to encode it. There should have been a warning when you changed that setting, telling you not to change it if you don't know what you're doing. This is why.

So if you change your preset to veryfast, you may notice that your CPU usage does way up. So how do you lower it? Well, don't stream at 60fps at 1050p. That is a high resolution and a high frame rate to encode at, which is probably too high for your CPU to handle and the quality you're trying to achieve. Furthermore, Flash is really bad at displaying high-framerate-high-resolution video such as 1050p60, so your viewers will suffer as well. You're going to want to lower your frame rate to 30fps, and maybe even consider downscaling by 1.25x or 1.5x.

Finally, for Twitch, you're going to want to enable both CBR (in Encoding settings) and CFR (in Advanced settings) to follow Twitch's broadcaster requirements. CBR is a requirement, and CFR is useful to make sure that the keyframe interval of 2 is kept strictly, like Twitch wants.

So try all those things and see how it goes.
 

dodgepong

Administrator
Community Helper
Re: Strange laggs on stream

For what it's worth, the 1.25x stream really didn't look bad. You may need to adjust your expectations of kind of quality is possible when streaming.
 
Top