Question / Help Encoder skipping frames - XSplit = less CPU usage?

GameQber

New Member
First, let me start off by admitting I have a pretty old CPU - an Intel Q6600 (Quad Core, 2.4GHz) from about 7 years ago.

I can't seem to figure out why OBS is using so much CPU vs XSplit. I have configured the video encoder settings to be exactly like my XSplit setup (x264, veryfast, 2500kbps bitrate/buffer, etc), as well as downscaled to 480p just like XSplit. I ran through the thread here, as well, and tried everything: https://obsproject.com/forum/threads/high-cpu-usage-taking-too-long-to-encode-read-this-first.11641/

I used the log analyzer to see what it would say about the log, and it did mention setting up the webcam as a global source, so I did that, as well, then deleted the webcam from each scene and re-added the global source webcam.

Even after all this, for some reason, streaming with OBS demands 85 - 95% CPU usage, while streaming with XSplit hovers around 70 - 80%. That's with everything running, including a game (Minecraft), my webcam, Firefox and Chrome.

Does anyone have any suggestions? My license for XSplit expires on June 11th. If this CPU problem can be fixed, that would be awesome - otherwise I'm gonna have to foot the bill.
 

GameQber

New Member
I ran an actual stream test to Twitch at 2:29:40 in the log file (see attachment).
 

Attachments

  • 2014-06-08-0152-37.log
    71.4 KB · Views: 47

FerretBomb

Active Member
You weren't downscaling to 480p, you were downscaling to 720p. Which is DEFINITELY going to use a lot more CPU and bitrate.
02:29:40: =====Stream Start: 2014-06-08, 02:29:40===============================================
02:29:40: Multithreaded optimizations: On
02:29:40: Base resolution: 1920x1080
02:29:40: Output resolution: 1280x720
02:29:40: ------------------------------------------
02:29:40: Loading up D3D10 on NVIDIA GeForce GTX 560 Ti (Adapter 1)...

1080p = 1920x1080
720p = 1280x720
480p = 720x480
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
At the very end of the log file he tried 480p:

03:23:02: Output resolution: 852x480

However, according to the profiler information, most of the CPU usage appeared to be due not to what OBS the program was doing, or OBS' settings, but rather the sources and configuration of the sources.

You have a webcam running at 720p/1080p, which is going to drain not only CPU usage, but also bus bandwidth of the system. I highly doubt that you need to run the webcam at 1080p, that's a lot of data that the system has to process, and I'm betting you just resize it and throw it up in a corner of your stream. Instead of having it be a giant size and scaling it, ideally you want to go in to the video device source's properties for the webcam, and set the webcam to a (much much) lower resolution there. I'm betting you probably don't need more than 480p for that webcam. I'm also betting this is where a good percentage of the CPU usage is coming from.

It also appears that he's using the CLR browser plugin, which may use a fair amount of CPU usage (I unfortunately don't really know for sure). The CLR browser plugin isn't written in C or C++ and is a third party plugin so it's not really a part of OBS, and I don't know much about how it performs or how it renders its composite images, or what resolution it renders them at, which may impact CPU usage.
 

GameQber

New Member
Thanks for the help. It's fixed!

I did downscale to 480p as seen at the end of the log, and it was still high, but only the video output from OBS was downscaled. The webcam was actually the culprit, still running at 1080p, as Jim mentioned. I scaled it down to 480p, and instantly my CPU dropped from 90% to about 70% with everything running. In fact, it wasn't skipping any frames whatsoever anymore. This is awesome!

Here's the latest log file, just for reference.

Code:
21:38:17: CLR host plugin strings not found, dynamically loading 4 strings
21:38:17: CLRHost::Initialize() attempting to load and start the .NET runtime (null)
21:38:17: CLRHost::Initialize() Found version v2.0.50727 .NET runtime
21:38:17: CLRHost::Initialize() Found version v4.0.30319 .NET runtime
21:38:17: CLRHost::Initialize() attempting to use v4.0.30319 .NET runtime
21:38:17: CLRHost::LoadInteropLibrary() load the assembly plugins\CLRHostPlugin\CLRHost.Interop.dll
21:38:17: CLRHost::LoadPlugins() attempting to load the plugin assembly CLRBrowserSourcePlugin
21:38:19: CLRHost::LoadPlugins() successfully added CLR plugin [Type: CLRBrowserSourcePlugin.CLRBrowserSourcePlugin, Name: CLR Browser Source Plugin]
21:38:49: Open Broadcaster Software v0.624b - 32bit (´・ω・`)
21:38:49: -------------------------------
21:38:49: CPU Name: Intel(R) Core(TM)2 Quad CPU  @ 2.40GHz
21:38:49: CPU Speed: 2405MHz
21:38:49: Physical Memory:  4095MB Total, 4095MB Free
21:38:49: stepping id: 7, model 15, family 6, type 0, extmodel 0, extfamily 0, HTT 1, logical cores 4, total cores 4
21:38:49: monitor 1: pos={0, 0}, size={1920, 1080}
21:38:49: monitor 2: pos={1920, 0}, size={1920, 1080}
21:38:49: Windows Version: 6.2 Build 9200
21:38:49: Aero is Enabled
21:38:49: -------------------------------
21:38:49: OBS Modules:
21:38:49: Base Address  Module
21:38:49: 001F0000  OBS.exe
21:38:49: 692F0000  OBSApi.dll
21:38:49: 69A70000  CLRHostPlugin.dll
21:38:49: 698F0000  DShowPlugin.dll
21:38:49: 67E30000  GraphicsCapture.dll
21:38:49: 67AE0000  NoiseGate.dll
21:38:49: 67E10000  PSVPlugin.dll
21:38:49: ------------------------------------------
21:38:49: Adapter 1
21:38:49:  Video Adapter: NVIDIA GeForce GTX 560 Ti  
21:38:49:  Video Adapter Dedicated Video Memory: 1018621952
21:38:49:  Video Adapter Shared System Memory: 3221106688
21:38:49:  Video Adapter Output 1: pos={0, 0}, size={1920, 1080}, attached=true
21:38:49:  Video Adapter Output 2: pos={1920, 0}, size={1920, 1080}, attached=true
21:38:49: =====Stream Start: 2014-06-08, 21:38:49===============================================
21:38:49:  Multithreaded optimizations: On
21:38:49:  Base resolution: 1920x1080
21:38:49:  Output resolution: 852x480
21:38:49: ------------------------------------------
21:38:49: Loading up D3D10 on NVIDIA GeForce GTX 560 Ti (Adapter 1)...
21:38:49: ------------------------------------------
21:38:49: Audio Format: 48000 Hz
21:38:49: ------------------------------------------
21:38:49: Audio Channels: 2 Ch
21:38:49: Playback device Default
21:38:49: ------------------------------------------
21:38:49: Using desktop audio input: Speakers (Creative SB X-Fi)
21:38:49: Global Audio time adjust: 0
21:38:49: ------------------------------------------
21:38:49: Using auxilary audio input: Analog in 1-2 (Echo3G)
21:38:49: Mic time offset: 0
21:38:49: ------------------------------------------
21:38:49: Audio Encoding: AAC
21:38:49:  bitrate: 128
21:38:49: ------------------------------------------
21:38:49:  device: Logitech HD Pro Webcam C910,
21:38:49:  device id \\?\usb#vid_046d&pid_0821&mi_02#6&320a8dd3&0&0002#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58bba724083},
21:38:49:  chosen type: RGB24, usingFourCC: false, res: 640x480 - 640x480, frameIntervals: 166666-2000000
21:38:49:  use buffering: false - 0, fourCC: 00000000
21:38:49:  audio device: Disable,
21:38:49:  audio device id Disabled,
21:38:49:  audio time offset 0,
21:38:49:
21:38:49: Using directshow input
21:38:50: Scene buffering time set to 700
21:38:50: ------------------------------------------
21:38:50: Video Encoding: x264
21:38:50:  fps: 25
21:38:50:  width: 852, height: 480
21:38:50:  preset: superfast
21:38:50:  profile: main
21:38:50:  keyint: 50
21:38:50:  CBR: yes
21:38:50:  CFR: yes
21:38:50:  max bitrate: 2500
21:38:50:  buffer size: 2500
21:38:50: ------------------------------------------
21:39:11: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
21:39:11:  New Scene
21:39:11: Using graphics capture
21:39:11: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
21:39:11: CLRHost:: Browser 1: Status message:
21:39:11: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
21:39:11: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
22:00:33: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
22:00:33: CLRHost:: Browser 2: Status message:
22:00:33: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
22:00:55: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
22:00:55: CLRHost:: Browser 3: Status message:
22:00:55: CLRHost:: BrowserRenderHandler::OnPaint failed to create texture
22:01:13: Trying to hook process: javaw.exe
22:01:16: SharedTexCapture hooked
22:03:34: GraphicsCaptureSource::NewCapture:  eliminating old capture
22:03:34: SharedTexCapture hooked
22:21:42: Capture window 0x00060A00 invalid or changing, terminating capture
22:29:09: ++++++++++++++++++++++++++++++++++++++++++++++++++++++
22:29:09:  New Scene
22:33:37: Total frames encoded: 82149, total frames duplicated: 974 (1.19%)
22:33:37: Number of frames skipped due to encoder lag: 338 (0.41%)
22:33:37: Total frames rendered: 81741, number of late frames: 69 (0.08%) (it's okay for some frames to be late)
22:33:37:
22:33:37: Profiler time results:
22:33:37:
22:33:37: ==============================================================
22:33:37: video thread frame - [100%] [avg time: 3.453 ms] [children: 40.2%] [unaccounted: 59.8%]
22:33:37: | scene->Preprocess - [30.6%] [avg time: 1.055 ms]
22:33:37: | GPU download and conversion - [9.61%] [avg time: 0.332 ms] [children: 7.33%] [unaccounted: 2.29%]
22:33:37: | | flush - [5.88%] [avg time: 0.203 ms]
22:33:37: | | CopyResource - [1.1%] [avg time: 0.038 ms]
22:33:37: | | conversion to 4:2:0 - [0.348%] [avg time: 0.012 ms]
22:33:37: Convert444Threads - [100%] [avg time: 0.761 ms] [children: 98.2%] [unaccounted: 1.84%]
22:33:37: | Convert444toNV12 - [98.2%] [avg time: 0.747 ms]
22:33:37: encoder thread frame - [100%] [avg time: 2.041 ms] [children: 0.441%] [unaccounted: 99.6%]
22:33:37: | sending stuff out - [0.441%] [avg time: 0.009 ms]
22:33:37: ==============================================================
22:33:37:
22:33:37:
22:33:37: Profiler CPU results:
22:33:37:
22:33:37: ==============================================================
22:33:37: video thread frame - [cpu time: avg 2.644 ms, total 216172 ms] [avg calls per frame: 1]
22:33:37: | scene->Preprocess - [cpu time: avg 0.692 ms, total 56609.4 ms] [avg calls per frame: 1]
22:33:37: | GPU download and conversion - [cpu time: avg 0.204 ms, total 16687.5 ms] [avg calls per frame: 1]
22:33:37: | | flush - [cpu time: avg 0.129 ms, total 10609.4 ms] [avg calls per frame: 1]
22:33:37: | | CopyResource - [cpu time: avg 0.025 ms, total 2078.13 ms] [avg calls per frame: 1]
22:33:37: | | conversion to 4:2:0 - [cpu time: avg 0.01 ms, total 859.375 ms] [avg calls per frame: 1]
22:33:37: Convert444Threads - [cpu time: avg 0.645 ms, total 105453 ms] [avg calls per frame: 2]
22:33:37: | Convert444toNV12 - [cpu time: avg 0.639 ms, total 104453 ms] [avg calls per frame: 2]
22:33:37: encoder thread frame - [cpu time: avg 1.217 ms, total 100016 ms] [avg calls per frame: 1]
22:33:37: | sending stuff out - [cpu time: avg 0.003 ms, total 312.5 ms] [avg calls per frame: 1]
22:33:37: ==============================================================
22:33:37:
22:33:37: =====Stream End: 2014-06-08, 22:33:37=================================================
22:33:38: CLR host plugin instance deleted; removing dynamically loaded localization strings


Last game capture log:
2014-06-08, 22:01:13: we're booting up:
22:01:13: CaptureThread: attached to process javaw.exe
22:01:14: GL Present
22:01:14: (half life scientist) everything..  seems to be in order
22:01:15: SwapBuffers(100735924) Called
22:01:15: NV Capture available
22:01:15: FBO available
22:01:15: setting up gl data
22:01:16: share device: 328278976
22:01:16: share texture: 329417648
22:01:16: share device handle: 3542971582
22:01:16: share texture handle: 3229136114
22:01:16: DoGLGPUHook: success
22:01:16: wglSwapBuffers(100735924) Called
22:03:31: ---------------------- Cleared OpenGL Capture ----------------------
22:03:31: wglSwapBuffers(100735924) Called
22:03:31: setting up gl data
22:03:31: SwapBuffers(100735924) Called
22:03:34: reacquiring gl due to resize...
22:03:34: share device: 471776432
22:03:34: share texture: 496401712
22:03:34: share device handle: 3542971582
22:03:34: share texture handle: 3452835394
22:03:34: DoGLGPUHook: success
22:21:42: wglDeleteContext Called
22:21:42: ---------------------- Cleared OpenGL Capture ----------------------
 

FerretBomb

Active Member
Ah, I'd just checked the live test he'd mentioned, and a couple later. Do see the downscale right at the very end now.
Glad to hear that it's fixed though!
 
Top