Question / Help Game running perfectly smoothly, preview is okay, stream completely laggy

DrKoin

New Member
[log, speed test and rig at the end of the post]

Hey,

So as the title says, I've been trying to stream a few things around on Twitch.

While The Binding of Isaac Rebirth is perfectly okay ( despite a 10+ sec latency, which isn't that bad actually ), the [way] more demanding Assassin's Creed Unity has proven to be a failure thus far.

During actual gameplay, I've got no issues whatsoever, the game runs perfectly fine at almost top quality settings. I've even lowered a few options in order to reduce the overall load on the computer ( second to last textures / details options, no soft shadows, FXAA, no Vsync, etc ).
The preview in the OBS window is a bit choppy, which is fine by me as it's not as choppy as to drastically prevent viewers from experiencing the game. What's more it's still actually good for a not anymore top-of-the-line computer.
However... When I display the twitch channel to check on the results, it's just terrible. It's choppy, laggy, and always trying to buffer.

I've tried a wide range of options, from low buffer to custom CFR, from X264 to NVenc, from 480/30 fps to 1080p / 60fps, and I never witnessed any improvements. I even lowered the whole game options to ultra low just to be sure, and it still wasn't good. Basically I feel like I've run out of guides, tips and shared settings I could find, here or on Youtube or wherever.

Thing that bothers me the most is I have no idea which step is going wrong. Encoding ? Uploading ? Or even watching the stream myself at the same time ? Although with almost 300 / 50 Mbps I would hope I can still upload a 'low'-bitrate video and watch it at the same time.
It should be noted some of my friends also reported to me the stream wasn't exactly performing well.

Also, I tried both streaming and plain capture, both with OBS and Shadowplay. Shadowplay gives me a perfect local video, OBS gives me the same choppy video. Both however give me bad stream results on Twitch.

So any idea? At this point I'd just say my rig isn't powerful enough to stream ACU, but I'm not ready to give up on it yet. I may want to stream some other high-quality-looking games in the future anyway...

Log :
( 500 bitrate max / 1000 buffer size 720p/30fps here. I've got the same visual results with 3000+ and full 1080p/60fps anyway. )
Code:
21:14:18: Server Ping plugin strings not found, dynamically loading 24 strings
21:14:22: Open Broadcaster Software v0.637b - 64bit ( ^ω^)
21:14:22: -------------------------------
21:14:22: CPU Name: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz
21:14:22: CPU Speed: 3400MHz
21:14:22: Physical Memory:  8077MB Total, 2278MB Free
21:14:22: stepping id: 9, model 58, family 6, type 0, extmodel 1, extfamily 0, HTT 1, logical cores 4, total cores 4
21:14:22: monitor 1: pos={0, 0}, size={1920, 1080}
21:14:22: monitor 2: pos={1920, 0}, size={1920, 1080}
21:14:22: Windows Version: 6.1 Build 7601 S
21:14:22: Aero is Enabled
21:14:22: -------------------------------
21:14:22: OBS Modules:
21:14:22: Base Address  Module
21:14:22: 000000003F3F0000 OBS.exe
21:14:22: 00000000E6580000 OBSApi.dll
21:14:22: 00000000F17C0000 DShowPlugin.dll
21:14:22: 00000000F1780000 GraphicsCapture.dll
21:14:22: 00000000F8550000 NoiseGate.dll
21:14:22: 00000000EDB50000 PSVPlugin.dll
21:14:22: 00000000EDB20000 ServerPingPlugin.dll
21:14:22: ------------------------------------------
21:14:22: Adapter 1
21:14:22:  Video Adapter: NVIDIA GeForce GTX 780
21:14:22:  Video Adapter Dedicated Video Memory: 3140157440
21:14:22:  Video Adapter Shared System Memory: 3966701568
21:14:22:  Video Adapter Output 1: pos={0, 0}, size={1920, 1080}, attached=true
21:14:22:  Video Adapter Output 2: pos={1920, 0}, size={1920, 1080}, attached=true
21:14:22: =====Stream Start: 2014-11-18, 21:14:22===============================================
21:14:22:  Multithreaded optimizations: On
21:14:22:  Base resolution: 1920x1080
21:14:22:  Output resolution: 1280x720
21:14:22: ------------------------------------------
21:14:22: Loading up D3D10 on NVIDIA GeForce GTX 780 (Adapter 1)...
21:14:23: ------------------------------------------
21:14:23: Audio Format: 48000 Hz
21:14:23: ------------------------------------------
21:14:23: Audio Channels: 2 Ch
21:14:23: Playback device Default
21:14:23: ------------------------------------------
21:14:23: Using desktop audio input: SPDIF Interface (FiiO USB DAC-E10)
21:14:23: Global Audio time adjust: 0
21:14:23: ------------------------------------------
21:14:23: Using auxilary audio input: Microphone (Realtek High Definition Audio)
21:14:23: Mic time offset: 0
21:14:23: ------------------------------------------
21:14:23: Audio Encoding: AAC
21:14:23:  bitrate: 64
21:14:23: Using bitmap image
21:14:23: Using text output
21:14:23: Using graphics capture
21:14:23: Trying to hook process: ACU.exe
21:14:23: Scene buffering time set to 700
21:14:23: ------------------------------------------
21:14:23: Video Encoding: x264
21:14:23:  fps: 30
21:14:23:  width: 1280, height: 720
21:14:23:  preset: veryfast
21:14:23:  profile: main
21:14:23:  keyint: 60
21:14:23:  CBR: yes
21:14:23:  CFR: yes
21:14:23:  max bitrate: 500
21:14:23:  buffer size: 1000
21:14:23: ------------------------------------------
21:14:25: Using RTMP service: Twitch
21:14:25:  Server selection: rtmp://live-cdg.twitch.tv/app
21:14:25:  Interface: Broadcom NetLink (TM) Gigabit Ethernet (ethernet, 1000 mbps)
21:14:25: Completed handshake with rtmp://live-cdg.twitch.tv/app in 681 ms.
21:14:26: SO_SNDBUF was at 8192
21:14:26: SO_SNDBUF is now 65536
21:14:29: SharedTexCapture hooked
21:14:30: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 131072 (buffer: 0 / 131072)
21:15:23: RTMPPublisher::SocketLoop: Increasing send buffer to ISB 262144 (buffer: 0 / 131072)
21:15:26: GraphicsCaptureSource::NewCapture:  eliminating old capture
21:15:26: SharedTexCapture hooked
21:16:33: FlushBufferedVideo: Flushing 28 packets over 900 ms
21:16:34: Total frames encoded: 3911, total frames duplicated: 1340 (34.26%)
21:16:34: Number of frames skipped due to encoder lag: 445 (11.38%)
21:16:34: Total frames rendered: 3017, number of late frames: 230 (7.62%) (it's okay for some frames to be late)
21:16:34:
21:16:34: Profiler time results:
21:16:34:
21:16:34: ==============================================================
21:16:34: video thread frame - [100%] [avg time: 15.658 ms] [children: 48.8%] [unaccounted: 51.2%]
21:16:34: | scene->Preprocess - [0.134%] [avg time: 0.021 ms]
21:16:34: | GPU download and conversion - [48.6%] [avg time: 7.613 ms] [children: 31.8%] [unaccounted: 16.8%]
21:16:34: | | flush - [10.3%] [avg time: 1.607 ms]
21:16:34: | | CopyResource - [21.4%] [avg time: 3.357 ms]
21:16:34: | | conversion to 4:2:0 - [0.083%] [avg time: 0.013 ms]
21:16:34: Convert444Threads - [100%] [avg time: 0.947 ms] [children: 98.9%] [unaccounted: 1.06%]
21:16:34: | Convert444toNV12 - [98.9%] [avg time: 0.937 ms]
21:16:34: encoder thread frame - [100%] [avg time: 7.998 ms] [children: 2.24%] [unaccounted: 97.8%]
21:16:34: | sending stuff out - [2.24%] [avg time: 0.179 ms]
21:16:34: ==============================================================
21:16:34:
21:16:34:
21:16:34: Profiler CPU results:
21:16:34:
21:16:34: ==============================================================
21:16:34: video thread frame - [cpu time: avg 0.403 ms, total 1216.81 ms] [avg calls per frame: 1]
21:16:34: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:16:34: | GPU download and conversion - [cpu time: avg 0.051 ms, total 156.002 ms] [avg calls per frame: 1]
21:16:34: | | flush - [cpu time: avg 0.036 ms, total 109.202 ms] [avg calls per frame: 1]
21:16:34: | | CopyResource - [cpu time: avg 0.015 ms, total 46.8 ms] [avg calls per frame: 1]
21:16:34: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:16:34: Convert444Threads - [cpu time: avg 0.281 ms, total 1684.81 ms] [avg calls per frame: 2]
21:16:34: | Convert444toNV12 - [cpu time: avg 0.281 ms, total 1684.81 ms] [avg calls per frame: 2]
21:16:34: encoder thread frame - [cpu time: avg 0.502 ms, total 1950.01 ms] [avg calls per frame: 1]
21:16:34: | sending stuff out - [cpu time: avg 0.012 ms, total 46.8 ms] [avg calls per frame: 1]
21:16:34: ==============================================================
21:16:34:
21:16:34: =====Stream End: 2014-11-18, 21:16:34=================================================
21:16:34: ~RTMPPublisher: Packet flush completed in 112 ms
21:16:34: ~RTMPPublisher: Send thread terminated in 0 ms
21:16:34: RTMPPublisher::SocketLoop: Graceful loop exit
21:16:34: ~RTMPPublisher: Socket thread terminated in 0 ms
21:16:45: ~RTMPPublisher: Final socket shutdown completed in 11077 ms
21:16:45: Average send payload: 2536 bytes, average send interval: 34 ms
21:16:45: Number of times waited to send: 0, Waited for a total of 0 bytes
21:16:45: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
21:16:45: Number of bytes sent: 9404923
21:18:26: No Intel graphics adapter visible in QSVHelper.exe, Optimus problem?
21:18:26: CUDA loaded successfully
21:18:26: 1 CUDA capable devices found
21:18:26: [ GPU #0 - < GeForce GTX 780 > has Compute SM 3.5, NVENC Available ]

Speedtest.net results :
286 Mbps Download
46.9 Mbps Upload
Location : Paris, France, with a 2ms ping.

Rig:
( should be readable on the log file but I'll put it here too for easier reference )
Intel Core i5-3570k Ivy Bridge / 3.4ghz OCed at 4k ( 100 x 40 )
Nvidia GeForce GTX 780 3gb
8Gb DDR3
SSD as primary boot disk
Windows 7 ultimate SP1
 

DrKoin

New Member
To be honest, I had also tried the tips explained in this guide :/

However, I found out one of the issues was with my ability to watch the stream - for some reasons it was very laggy. No chance in hell it was because of my download/upload rate, so I just tried on my phone. It was playing way smoother. So I ended up trusting my phone rather than my computer.

In the end I managed to get something decent at 480p/60fps. I'll try 720p/30fps again, just to be sure, but I get the feeling the FPS gain is better for the viewers.

Also I'm thinking of giving NVenc another go. I think I'm limited by my I5 CPU, but what do I know ? Facts are that Isaac runs perfectly fine and streams like a charm using Shadowplay while it struggles when using X264. Guess this is because Isaac is more CPU intensive and the game fights with the encoding for processing power.

Oh well, tests tests tests...
 

Sapiens

Forum Moderator
I hear ACU is pretty demanding and your log file seems to agree with that. Check your CPU load while playing, if it's very high then streaming with x264 may not be a viable option (very similar to BF3/4 when they came out and people tried to stream them).

Watching your own stream from the PC you're streaming from while playing this demanding game also probably won't work well, you should check your local recordings or VODs instead.

Quick Sync could be a good fallback and should provide better quality than NVENC.
 

DrKoin

New Member
Yeah, trying to check on my stream on the same computer was a dumb move. I fell back on local recordings first and found the aforementionned 480p/60fps settings working alright.

I will delve into Quick Sync some more. I completely overlooked it because it is greyed out in OBS parameters. I guess this is due to me deactivating the onboard GPU a while back because I had a few issues with... something I can't even remember.
Or I could upgrade to some higher level I7 cpu, but that's not really on my priority list ;)
 

DrKoin

New Member
So I tried QS. It's indeed better quality than NVenc, but it seems I'm in the 10-to-30-seconds-before-crashing bandwagon. You know, QSVhelper.exe etc.
Also, it seems I can't output a full 1080p file - the virtual monitor is limited to 720p. Not that it is a big bother really, since I'd probably not stream at 1080p and have good results.

Too bad! After some more tests, I defintely can't get anything better than 480p / 60 fps on ACU. well 540p works, but not above 30fps, which makes the result both sluggish and pixellated.
And Isaac works perfectly with NVenc.

So in the end, I'll probably have to use different settings according to the games I want to stream. Not a big deal. I feel like that QS option would have been perfect, had it not suffered so many crashes ... With some load already on both the CPU and the GPU, taking advantage of the iGPU which isn't used anyway seemed like the ideal solution.
 

DrKoin

New Member
So yeah, some interesting news and one more question.

First, I finally decided to do what was needed and clean my computer. I switched to Windows 8.1 in the process as I had heard QS was working flawlessly with this OS. Also, clearly killing firefox/chrome/whatever is needed. This thing takes up so much memory and processing power, it's almost indecent.
Using QS Isaac is now perfecly streamable 1080p/60fps, ACU was a tougher client as it wasn't working ( QSVHelper crash ) up until today. I suspect the latest Ubisoft patch actually did some good there. Would be a first !
So yay !

STILL

With ACU, I wanted to try x264 again. I agree there is no doubt : it's just better looking. Crisper, essentially. However, I just can't find a decent spot. 720p/30fps I want, as 25fps really looks choppy. This is a videogame, after all, not a motion-blurred movie.
Using CBR, CBR padding checked, Use Custom Buffer Size unchecked, max bitrate 3000 ; downscale to 1280*720, Lanczos filter, 30fps ; high priority, Main profile, CFR checked :
- Ultrafast is able to follow the flow but looks bad.
- Superfast is barely able to follow ( too many dropped frames ) but looks decent enough.
So my question would be :

"What could I do to achieve something of a middle setting between ultrafast and superfast ?"

I suspect this involves fiddling with the custom parameters...

Oh and bonus : what does Disable encoding while previewing does ? I haven't been able to locate a clear description. And also, is there a way other than minimizing to disable the preview entirely, doesn't it take up a bit of computer ressources ?

Thanks for you hard work, by the way, and for making streaming available to any and all!
 
Top