Question / Help Long delay on twitch

topsykrett

New Member
Hi. I'm getting a long delay while streaming. I would think with my connection and hardware that I could achieve much better results. I know exactly real time is impossible but I would just like to cut down the delay as much as possible. Right now it's about 22-25 seconds between my action and the action on the stream. I've been trying different settings and servers, but it always stays around the same. Any help is much appreciated.

Log:
Code:
20:54:16: Settings::Video: Enabling Aero
20:56:12: Open Broadcaster Software v0.591b - 64bit ( ^ω^)
20:56:12: -------------------------------
20:56:12: CPU Name: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
20:56:12: CPU Speed: 3500MHz
20:56:12: Physical Memory:  16327MB Total, 11912MB Free
20:56:12: stepping id: 3, model 60, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 8, total cores 4
20:56:12: monitor 1: pos={0, 0}, size={2560, 1440}
20:56:12: monitor 2: pos={2560, 69}, size={1920, 1200}
20:56:12: Windows Version: 6.1 Build 7601 S
20:56:12: Aero is Enabled
20:56:12: -------------------------------
20:56:12: OBS Modules:
20:56:12: Base Address     Module
20:56:12: 000000003F500000 OBS.exe
20:56:12: 00000000E53A0000 OBSApi.dll
20:56:12: 00000000EAD40000 DShowPlugin.dll
20:56:12: 00000000EC6F0000 GraphicsCapture.dll
20:56:12: 00000000F1C40000 NoiseGate.dll
20:56:12: 00000000EE0C0000 PSVPlugin.dll
20:56:12: ------------------------------------------
20:56:12: Adapter 1
20:56:12:   Video Adapter: NVIDIA GeForce GTX 780
20:56:12:   Video Adapter Dedicated Video Memory: 3140157440
20:56:12:   Video Adapter Shared System Memory: 3996719104
20:56:12:   Video Adapter Output 1: pos={0, 0}, size={2560, 1440}, attached=true
20:56:12:   Video Adapter Output 2: pos={2560, 69}, size={1920, 1200}, attached=true
20:56:12: =====Stream Start: 2013-12-22, 20:56:12===============================================
20:56:12:   Multithreaded optimizations: On
20:56:12:   Base resolution: 2560x1440
20:56:12:   Output resolution: 1280x720
20:56:12: ------------------------------------------
20:56:12: Loading up D3D10 on NVIDIA GeForce GTX 780 (Adapter 1)...
20:56:12: ------------------------------------------
20:56:12: Audio Format: 44100hz
20:56:12: Playback device Default
20:56:12: ------------------------------------------
20:56:12: Using desktop audio input: Speakers (Logitech G930 Headset)
20:56:12: Using 7.1 surround speaker setup
20:56:12: ------------------------------------------
20:56:12: Using auxilary audio input: Microphone (Logitech G930 Headset)
20:56:12: ------------------------------------------
20:56:12: Audio Encoding: AAC
20:56:12:     bitrate: 128
20:56:12: Using graphics capture
20:56:12: Scene buffering time set to 400
20:56:12: ------------------------------------------
20:56:12: Video Encoding: x264
20:56:12:     fps: 30
20:56:12:     width: 1280, height: 720
20:56:12:     preset: veryfast
20:56:12:     profile: high
20:56:12:     keyint: 60
20:56:12:     CBR: yes
20:56:12:     CFR: yes
20:56:12:     max bitrate: 3000
20:56:12:     buffer size: 3000
20:56:12: ------------------------------------------
20:56:12: MMDeviceAudioSource: Frequency for device 'Speakers (Logitech G930 Headset)' is 1536000, samples per sec is 48000
20:56:12: MMDeviceAudioSource: Frequency for device 'Microphone (Logitech G930 Headset)' is 64000, samples per sec is 16000
20:56:12: SharedTexCapture hooked
20:56:23: GraphicsCaptureSource::NewCapture:  eliminating old capture
20:56:23: SharedTexCapture hooked
20:56:35: Total frames encoded: 657, total frames duplicated: 0 (0.00%)
20:56:35: Total frames rendered: 662, number of late frames: 0 (0.00%) (it's okay for some frames to be late)
20:56:35: 
20:56:35: Profiler time results:
20:56:35: 
20:56:35: ==============================================================
20:56:35: video thread frame - [100%] [avg time: 0.708 ms] [children: 10.9%] [unaccounted: 89.1%]
20:56:35: | scene->Preprocess - [0.282%] [avg time: 0.002 ms]
20:56:35: | GPU download and conversion - [10.6%] [avg time: 0.075 ms] [children: 9.18%] [unaccounted: 1.41%]
20:56:35: | | flush - [6.5%] [avg time: 0.046 ms]
20:56:35: | | CopyResource - [2.12%] [avg time: 0.015 ms]
20:56:35: | | conversion to 4:2:0 - [0.565%] [avg time: 0.004 ms]
20:56:35: Convert444Threads - [100%] [avg time: 0.468 ms] [children: 99.4%] [unaccounted: 0.641%]
20:56:35: | Convert444toNV12 - [99.4%] [avg time: 0.465 ms]
20:56:35: encoder thread frame - [100%] [avg time: 0.765 ms]
20:56:35: ==============================================================
20:56:35: 
20:56:35: 
20:56:35: Profiler CPU results:
20:56:35: 
20:56:35: ==============================================================
20:56:35: video thread frame - [cpu time: avg 0.164 ms, total 109.2 ms] [avg calls per frame: 1]
20:56:35: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:56:35: | GPU download and conversion - [cpu time: avg 0.047 ms, total 31.2 ms] [avg calls per frame: 1]
20:56:35: | | flush - [cpu time: avg 0.047 ms, total 31.2 ms] [avg calls per frame: 1]
20:56:35: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:56:35: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:56:35: Convert444Threads - [cpu time: avg 0.507 ms, total 655.204 ms] [avg calls per frame: 2]
20:56:35: | Convert444toNV12 - [cpu time: avg 0.495 ms, total 639.603 ms] [avg calls per frame: 2]
20:56:35: encoder thread frame - [cpu time: avg 0.048 ms, total 31.2 ms] [avg calls per frame: 1]
20:56:35: ==============================================================
20:56:35: 
20:56:35: =====Stream End: 2013-12-22, 20:56:35=================================================
20:56:37: =====Stream Start: 2013-12-22, 20:56:37===============================================
20:56:37:   Multithreaded optimizations: On
20:56:37:   Base resolution: 2560x1440
20:56:37:   Output resolution: 1280x720
20:56:37: ------------------------------------------
20:56:37: Loading up D3D10 on NVIDIA GeForce GTX 780 (Adapter 1)...
20:56:37: ------------------------------------------
20:56:37: Audio Format: 44100hz
20:56:37: Playback device Default
20:56:37: ------------------------------------------
20:56:37: Using desktop audio input: Speakers (Logitech G930 Headset)
20:56:37: Using 7.1 surround speaker setup
20:56:37: ------------------------------------------
20:56:37: Using auxilary audio input: Microphone (Logitech G930 Headset)
20:56:37: ------------------------------------------
20:56:37: Audio Encoding: AAC
20:56:37:     bitrate: 128
20:56:37: Using graphics capture
20:56:37: Scene buffering time set to 400
20:56:37: ------------------------------------------
20:56:37: Video Encoding: x264
20:56:37:     fps: 30
20:56:37:     width: 1280, height: 720
20:56:37:     preset: veryfast
20:56:37:     profile: high
20:56:37:     keyint: 60
20:56:37:     CBR: yes
20:56:37:     CFR: yes
20:56:37:     max bitrate: 3000
20:56:37:     buffer size: 3000
20:56:37: ------------------------------------------
20:56:37: MMDeviceAudioSource: Frequency for device 'Speakers (Logitech G930 Headset)' is 1536000, samples per sec is 48000
20:56:37: MMDeviceAudioSource: Frequency for device 'Microphone (Logitech G930 Headset)' is 64000, samples per sec is 16000
20:56:37: SharedTexCapture hooked
20:56:39: Using RTMP service: Twitch / Justin.tv
20:56:39:   Server selection: rtmp://live-jfk.justin.tv/app
20:56:39:   Interface: Killer e2200 PCI-E Gigabit Ethernet Controller (NDIS 6.20) (ethernet, 1000 mbps)
20:56:39: Completed handshake with rtmp://live-jfk.justin.tv/app in 259 ms.
20:56:40: SO_SNDBUF was at 8192
20:56:40: SO_SNDBUF is now 65536
20:57:22: Total frames encoded: 1319, total frames duplicated: 0 (0.00%)
20:57:22: Total frames rendered: 1324, number of late frames: 1 (0.08%) (it's okay for some frames to be late)
20:57:22: RTMPPublisher::SocketLoop: Graceful loop exit
20:57:22: Average send payload: 9761 bytes, average send interval: 24 ms
20:57:22: Number of times waited to send: 0, Waited for a total of 0 bytes
20:57:22: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
20:57:22: Number of bytes sent: 15901306
20:57:22: 
20:57:22: Profiler time results:
20:57:22: 
20:57:22: ==============================================================
20:57:22: video thread frame - [100%] [avg time: 0.814 ms] [children: 10.6%] [unaccounted: 89.4%]
20:57:22: | scene->Preprocess - [0.123%] [avg time: 0.001 ms]
20:57:22: | GPU download and conversion - [10.4%] [avg time: 0.085 ms] [children: 8.11%] [unaccounted: 2.33%]
20:57:22: | | flush - [5.28%] [avg time: 0.043 ms]
20:57:22: | | CopyResource - [1.84%] [avg time: 0.015 ms]
20:57:22: | | conversion to 4:2:0 - [0.983%] [avg time: 0.008 ms]
20:57:22: Convert444Threads - [100%] [avg time: 0.425 ms] [children: 99.3%] [unaccounted: 0.706%]
20:57:22: | Convert444toNV12 - [99.3%] [avg time: 0.422 ms]
20:57:22: encoder thread frame - [100%] [avg time: 0.758 ms]
20:57:22: ==============================================================
20:57:22: 
20:57:22: 
20:57:22: Profiler CPU results:
20:57:22: 
20:57:22: ==============================================================
20:57:22: video thread frame - [cpu time: avg 0.306 ms, total 405.602 ms] [avg calls per frame: 1]
20:57:22: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:57:22: | GPU download and conversion - [cpu time: avg 0.047 ms, total 62.4 ms] [avg calls per frame: 1]
20:57:22: | | flush - [cpu time: avg 0.035 ms, total 46.8 ms] [avg calls per frame: 1]
20:57:22: | | CopyResource - [cpu time: avg 0.011 ms, total 15.6 ms] [avg calls per frame: 1]
20:57:22: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:57:22: Convert444Threads - [cpu time: avg 0.494 ms, total 1294.81 ms] [avg calls per frame: 2]
20:57:22: | Convert444toNV12 - [cpu time: avg 0.488 ms, total 1279.21 ms] [avg calls per frame: 2]
20:57:22: encoder thread frame - [cpu time: avg 0.023 ms, total 31.2 ms] [avg calls per frame: 1]
20:57:22: ==============================================================
20:57:22: 
20:57:22: =====Stream End: 2013-12-22, 20:57:22=================================================
20:57:38: =====Stream Start: 2013-12-22, 20:57:38===============================================
20:57:38:   Multithreaded optimizations: On
20:57:38:   Base resolution: 2560x1440
20:57:38:   Output resolution: 1280x720
20:57:38: ------------------------------------------
20:57:38: Loading up D3D10 on NVIDIA GeForce GTX 780 (Adapter 1)...
20:57:38: ------------------------------------------
20:57:38: Audio Format: 44100hz
20:57:38: Playback device Default
20:57:38: ------------------------------------------
20:57:38: Using desktop audio input: Speakers (Logitech G930 Headset)
20:57:38: Using 7.1 surround speaker setup
20:57:38: ------------------------------------------
20:57:38: Using auxilary audio input: Microphone (Logitech G930 Headset)
20:57:38: ------------------------------------------
20:57:38: Audio Encoding: AAC
20:57:38:     bitrate: 128
20:57:38: Using graphics capture
20:57:38: Scene buffering time set to 400
20:57:38: ------------------------------------------
20:57:38: Video Encoding: x264
20:57:38:     fps: 30
20:57:38:     width: 1280, height: 720
20:57:38:     preset: veryfast
20:57:38:     profile: high
20:57:38:     keyint: 60
20:57:38:     CBR: yes
20:57:38:     CFR: yes
20:57:38:     max bitrate: 2000
20:57:38:     buffer size: 2000
20:57:38: ------------------------------------------
20:57:38: MMDeviceAudioSource: Frequency for device 'Speakers (Logitech G930 Headset)' is 1536000, samples per sec is 48000
20:57:38: MMDeviceAudioSource: Frequency for device 'Microphone (Logitech G930 Headset)' is 64000, samples per sec is 16000
20:57:38: SharedTexCapture hooked
20:57:40: Using RTMP service: Twitch / Justin.tv
20:57:40:   Server selection: rtmp://live-jfk.justin.tv/app
20:57:40:   Interface: Killer e2200 PCI-E Gigabit Ethernet Controller (NDIS 6.20) (ethernet, 1000 mbps)
20:57:41: Completed handshake with rtmp://live-jfk.justin.tv/app in 276 ms.
20:57:41: SO_SNDBUF was at 8192
20:57:41: SO_SNDBUF is now 65536
20:57:52: Total frames encoded: 402, total frames duplicated: 0 (0.00%)
20:57:52: Total frames rendered: 408, number of late frames: 1 (0.25%) (it's okay for some frames to be late)
20:57:52: RTMPPublisher::SocketLoop: Graceful loop exit
20:57:53: Average send payload: 6889 bytes, average send interval: 25 ms
20:57:53: Number of times waited to send: 0, Waited for a total of 0 bytes
20:57:53: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
20:57:53: Number of bytes sent: 2686744
20:57:53: 
20:57:53: Profiler time results:
20:57:53: 
20:57:53: ==============================================================
20:57:53: video thread frame - [100%] [avg time: 0.765 ms] [children: 11.4%] [unaccounted: 88.6%]
20:57:53: | scene->Preprocess - [0.261%] [avg time: 0.002 ms]
20:57:53: | GPU download and conversion - [11.1%] [avg time: 0.085 ms] [children: 9.41%] [unaccounted: 1.7%]
20:57:53: | | flush - [7.32%] [avg time: 0.056 ms]
20:57:53: | | CopyResource - [1.7%] [avg time: 0.013 ms]
20:57:53: | | conversion to 4:2:0 - [0.392%] [avg time: 0.003 ms]
20:57:53: Convert444Threads - [100%] [avg time: 0.427 ms] [children: 99.3%] [unaccounted: 0.703%]
20:57:53: | Convert444toNV12 - [99.3%] [avg time: 0.424 ms]
20:57:53: encoder thread frame - [100%] [avg time: 0.709 ms]
20:57:53: ==============================================================
20:57:53: 
20:57:53: 
20:57:53: Profiler CPU results:
20:57:53: 
20:57:53: ==============================================================
20:57:53: video thread frame - [cpu time: avg 0.152 ms, total 62.4 ms] [avg calls per frame: 1]
20:57:53: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:57:53: | GPU download and conversion - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:57:53: | | flush - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:57:53: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:57:53: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
20:57:53: Convert444Threads - [cpu time: avg 0.558 ms, total 436.802 ms] [avg calls per frame: 2]
20:57:53: | Convert444toNV12 - [cpu time: avg 0.558 ms, total 436.802 ms] [avg calls per frame: 2]
20:57:53: encoder thread frame - [cpu time: avg 0.08 ms, total 31.2 ms] [avg calls per frame: 1]
20:57:53: ==============================================================
20:57:53: 
20:57:53: =====Stream End: 2013-12-22, 20:57:53=================================================

Upload Speed test:
http://testmy.net/compID/69861217196

Thanks for your help.
 

paibox

heros in an halfshel
The 22-25 second delay is normal, it's what everyone gets. Twitch switched their video system over to HLS, which requires buffering a number of video segments before playback starts, and the increased delay is due to that.
 

topsykrett

New Member
paibox said:
The 22-25 second delay is normal, it's what everyone gets. Twitch switched their video system over to HLS, which requires buffering a number of video segments before playback starts, and the increased delay is due to that.

Oh I see. That makes sense then. Thank you for the quick response
 

Boildown

Active Member
Is there any way to manipulate the length of a segment or how many segments are buffered? Just curious if it depends on the keyint or anything like that, that we can set.
 

BtbN

Member
HLS is only fake-streaming, it works by splitting the video in several small files with variable length.
Twitch uses two seconds segment length, which is why OBS and Twitch warns you if your keyint is anything else than 2 seconds.
HLS specs says that a player should always be playing the third last segment from a HLS livestream playlist, which would mean a delay of 3*2=6 seconds.
The current delay, which can get much higher than 30 seconds, must be caused by some mistake in their server infrastructure, as even forcing it to play the latest segment(via an external player like VLC) still has a huge delay.
 

Boildown

Active Member
Is it a hard-coded two seconds x three segments, or is it three key intervals? For example, if you set the key interval to 1 second, could you halve the time?
 

Krazy

Town drunk
Probably, but 1 second keyint is really killing quality, especially on lower bitrate streams. That "pulse" effect becomes a lot more noticeable
 
Top