Question / Help Black Screen on Game Capture

deranjer

New Member
I know there are a ton of these threads, just hoping someone can help me with my particular issue which I think is maybe slightly different.

I have sporadic black screen when I start casting. Only happens sometimes, with some games (dota2 seems to catch it more often) I cannot replicate it easily. These are the steps and issues:

1. Launch OBS (as admin)
2. Launch Dota2
3. Start Capture
4. If I get a black screen I get the words "cannot find window" (or something similar, forgot exact wording)
5. To solve this, I sometimes can alt-tab out of the game, then alt-tab back in, then captures without any issues.
6. Sometimes this does not solve my issue. If I relaunch game and OBS, this sometimes works.

Settings:
I have a dual screen PC, which I wonder might be causing the issue. I have two scenes, one with game and facecam, one with just facecam. Currently have facecam "unchecked" for testing but it is a global source.

I only have one video adapter, a AMD 7970.

I am using game capture.

Here is my log:
This log was taken where it was a black screen with "cannot find window" then I alt-tabbed out and back in and it started working just fine. I ran the log analyzer, and it only said low bitrate (which I already knew).

Code:
21:04:42: Open Broadcaster Software v0.584b - 64bit ( ^ω^)
21:04:42: -------------------------------
21:04:42: CPU Name: Intel(R) Core(TM) i5 CPU         760  @ 2.80GHz
21:04:42: CPU Speed: 2798MHz
21:04:42: Physical Memory:  8183MB Total, 5443MB Free
21:04:42: stepping id: 5, model 30, family 6, type 0, extmodel 0, extfamily 0, HTT 1, logical cores 4, total cores 4
21:04:42: monitor 1: pos={0, 0}, size={1920, 1200}
21:04:42: monitor 2: pos={1920, 0}, size={1920, 1080}
21:04:42: Windows Version: 6.1 Build 7601 S
21:04:42: Aero is Enabled
21:04:42: -------------------------------
21:04:42: OBS Modules:
21:04:42: Base Address     Module
21:04:42: 000000003F2D0000 OBS.exe
21:04:42: 00000000FF130000 OBSApi.dll
21:04:42: 00000000FF400000 DShowAudioPlugin.dll
21:04:42: 00000000FF0F0000 DShowPlugin.dll
21:04:42: 00000000FF0C0000 GraphicsCapture.dll
21:04:42: 00000000FF0A0000 NoiseGate.dll
21:04:42: 00000000FF080000 PSVPlugin.dll
21:04:42: ------------------------------------------
21:04:42: Adapter 1
21:04:42:   Video Adapter: AMD Radeon HD 7900 Series
21:04:42:   Video Adapter Dedicated Video Memory: 3202523136
21:04:42:   Video Adapter Shared System Memory: 4022071296
21:04:42:   Video Adapter Output 1: pos={0, 0}, size={1920, 1080}, attached=true
21:04:42:   Video Adapter Output 2: pos={1920, 0}, size={1920, 1080}, attached=true
21:04:42: =====Stream Start: 2013-12-04, 21:04:42===============================================
21:04:42:   Multithreaded optimizations: On
21:04:42:   Base resolution: 1920x1080
21:04:42:   Output resolution: 1920x1080
21:04:42: ------------------------------------------
21:04:42: Loading up D3D10 on AMD Radeon HD 7900 Series...
21:04:42: ------------------------------------------
21:04:42: Audio Format: 48000hz
21:04:42: Playback device {0.0.0.00000000}.{1669f9ac-1df6-460c-80f9-7052fc09e228}
21:04:42: ------------------------------------------
21:04:42: Using desktop audio input: Speakers (2- Logitech G930 Headset)
21:04:42: Using 7.1 surround speaker setup
21:04:42: ------------------------------------------
21:04:42: Using auxilary audio input: Microphone (2- Logitech G930 Headset)
21:04:42: ------------------------------------------
21:04:42: Audio Encoding: AAC
21:04:42:     bitrate: 128
21:04:42: Using graphics capture
21:04:42: Scene buffering time set to 700
21:04:42: ------------------------------------------
21:04:42: Video Encoding: x264
21:04:42:     fps: 30
21:04:42:     width: 1920, height: 1080
21:04:42:     preset: veryfast
21:04:42:     profile: high
21:04:42:     keyint: 60
21:04:42:     CBR: yes
21:04:42:     CFR: yes
21:04:42:     max bitrate: 3500
21:04:42:     buffer size: 3500
21:04:42: ------------------------------------------
21:04:42: MMDeviceAudioSource: Frequency for device 'Speakers (2- Logitech G930 Headset)' is 1536000, samples per sec is 48000
21:04:42: MMDeviceAudioSource: Frequency for device 'Microphone (2- Logitech G930 Headset)' is 64000, samples per sec is 16000
21:05:13: Total frames encoded: 888, total frames duplicated: 0 (0.00%)
21:05:13: Total frames rendered: 892, number of late frames: 0 (0.00%) (it's okay for some frames to be late)
21:05:13: 
21:05:13: Profiler time results:
21:05:13: 
21:05:13: ==============================================================
21:05:13: video thread frame - [100%] [avg time: 0.568 ms] [children: 24.1%] [unaccounted: 75.9%]
21:05:13: | scene->Preprocess - [0.176%] [avg time: 0.001 ms]
21:05:13: | GPU download and conversion - [23.9%] [avg time: 0.136 ms] [children: 21.8%] [unaccounted: 2.11%]
21:05:13: | | flush - [19.9%] [avg time: 0.113 ms]
21:05:13: | | CopyResource - [1.58%] [avg time: 0.009 ms]
21:05:13: | | conversion to 4:2:0 - [0.352%] [avg time: 0.002 ms]
21:05:13: Convert444Threads - [100%] [avg time: 1.361 ms] [children: 99.6%] [unaccounted: 0.367%]
21:05:13: | Convert444toNV12 - [99.6%] [avg time: 1.356 ms]
21:05:13: encoder thread frame - [100%] [avg time: 2.264 ms]
21:05:13: ==============================================================
21:05:13: 
21:05:13: 
21:05:13: Profiler CPU results:
21:05:13: 
21:05:13: ==============================================================
21:05:13: video thread frame - [cpu time: avg 0.017 ms, total 15.6 ms] [avg calls per frame: 1]
21:05:13: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:13: | GPU download and conversion - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:13: | | flush - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:13: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:13: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:13: Convert444Threads - [cpu time: avg 0.988 ms, total 1716.01 ms] [avg calls per frame: 2]
21:05:13: | Convert444toNV12 - [cpu time: avg 0.988 ms, total 1716.01 ms] [avg calls per frame: 2]
21:05:13: encoder thread frame - [cpu time: avg 2.015 ms, total 1747.21 ms] [avg calls per frame: 1]
21:05:13: ==============================================================
21:05:13: 
21:05:13: =====Stream End: 2013-12-04, 21:05:13=================================================
21:05:22: =====Stream Start: 2013-12-04, 21:05:22===============================================
21:05:22:   Multithreaded optimizations: On
21:05:22:   Base resolution: 1920x1080
21:05:22:   Output resolution: 1920x1080
21:05:22: ------------------------------------------
21:05:22: Loading up D3D10 on AMD Radeon HD 7900 Series...
21:05:22: ------------------------------------------
21:05:22: Audio Format: 48000hz
21:05:22: Playback device {0.0.0.00000000}.{1669f9ac-1df6-460c-80f9-7052fc09e228}
21:05:22: ------------------------------------------
21:05:22: Using desktop audio input: Speakers (2- Logitech G930 Headset)
21:05:22: Using 7.1 surround speaker setup
21:05:22: ------------------------------------------
21:05:22: Using auxilary audio input: Microphone (2- Logitech G930 Headset)
21:05:22: ------------------------------------------
21:05:22: Audio Encoding: AAC
21:05:22:     bitrate: 128
21:05:22: Using graphics capture
21:05:22: Scene buffering time set to 700
21:05:22: ------------------------------------------
21:05:22: Video Encoding: x264
21:05:22:     fps: 30
21:05:22:     width: 1920, height: 1080
21:05:22:     preset: veryfast
21:05:22:     profile: high
21:05:22:     keyint: 60
21:05:22:     CBR: yes
21:05:22:     CFR: yes
21:05:22:     max bitrate: 1500
21:05:22:     buffer size: 1500
21:05:22: ------------------------------------------
21:05:22: MMDeviceAudioSource: Frequency for device 'Speakers (2- Logitech G930 Headset)' is 1536000, samples per sec is 48000
21:05:22: MMDeviceAudioSource: Frequency for device 'Microphone (2- Logitech G930 Headset)' is 64000, samples per sec is 16000
21:05:24: Using RTMP service: Twitch / Justin.tv
21:05:24:   Server selection: rtmp://live.justin.tv/app
21:05:24:   Interface: Realtek PCIe GBE Family Controller (ethernet, 1000 mbps)
21:05:24: Completed handshake with rtmp://live.justin.tv/app in 185 ms.
21:05:26: SO_SNDBUF was at 8192
21:05:26: SO_SNDBUF is now 65536
21:05:36: SharedTexCapture hooked
21:05:45: Total frames encoded: 664, total frames duplicated: 73 (10.99%)
21:05:45: Total frames rendered: 617, number of late frames: 9 (1.46%) (it's okay for some frames to be late)
21:05:45: RTMPPublisher::SocketLoop: Graceful loop exit
21:05:45: Average send payload: 5987 bytes, average send interval: 29 ms
21:05:45: Number of times waited to send: 0, Waited for a total of 0 bytes
21:05:45: Number of b-frames dropped: 0 (0%), Number of p-frames dropped: 0 (0%), Total 0 (0%)
21:05:45: Number of bytes sent: 3772388
21:05:45: 
21:05:45: Profiler time results:
21:05:45: 
21:05:45: ==============================================================
21:05:45: video thread frame - [100%] [avg time: 4.673 ms] [children: 7.3%] [unaccounted: 92.7%]
21:05:45: | scene->Preprocess - [0.0214%] [avg time: 0.001 ms]
21:05:45: | GPU download and conversion - [7.28%] [avg time: 0.34 ms] [children: 5.71%] [unaccounted: 1.56%]
21:05:45: | | flush - [5.11%] [avg time: 0.239 ms]
21:05:45: | | CopyResource - [0.556%] [avg time: 0.026 ms]
21:05:45: | | conversion to 4:2:0 - [0.0428%] [avg time: 0.002 ms]
21:05:45: Convert444Threads - [100%] [avg time: 1.419 ms] [children: 99.6%] [unaccounted: 0.423%]
21:05:45: | Convert444toNV12 - [99.6%] [avg time: 1.413 ms]
21:05:45: encoder thread frame - [100%] [avg time: 2.225 ms]
21:05:45: ==============================================================
21:05:45: 
21:05:45: 
21:05:45: Profiler CPU results:
21:05:45: 
21:05:45: ==============================================================
21:05:45: video thread frame - [cpu time: avg 0.025 ms, total 15.6 ms] [avg calls per frame: 1]
21:05:45: | scene->Preprocess - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:45: | GPU download and conversion - [cpu time: avg 0.025 ms, total 15.6 ms] [avg calls per frame: 1]
21:05:45: | | flush - [cpu time: avg 0.025 ms, total 15.6 ms] [avg calls per frame: 1]
21:05:45: | | CopyResource - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:45: | | conversion to 4:2:0 - [cpu time: avg 0 ms, total 0 ms] [avg calls per frame: 1]
21:05:45: Convert444Threads - [cpu time: avg 1.08 ms, total 1279.21 ms] [avg calls per frame: 2]
21:05:45: | Convert444toNV12 - [cpu time: avg 1.08 ms, total 1279.21 ms] [avg calls per frame: 2]
21:05:45: encoder thread frame - [cpu time: avg 1.843 ms, total 1185.61 ms] [avg calls per frame: 1]
21:05:45: ==============================================================
21:05:45: 
21:05:45: =====Stream End: 2013-12-04, 21:05:45=================================================


Last game capture log:
2013-12-04, 21:05:34: we're booting up: 
21:05:34: D3D9 Present
21:05:34: D3D9EndScene called
21:05:34: D3DPRESENT_PARAMETERS {
21:05:34: 	BackBufferWidth: 1920
21:05:34: 	BackBufferHeight: 1080
21:05:34: 	BackBufferFormat: D3DFMT_A8R8G8B8
21:05:34: 	BackBufferCount: 1
21:05:34: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:05:34: 	MultiSampleQuality: 0
21:05:34: 	SwapEffect: D3DSWAPEFFECT_DISCARD
21:05:34: 	hDeviceWindow: 721778
21:05:34: 	Windowed: false
21:05:34: 	EnableAutoDepthStencil: true
21:05:34: 	AutoDepthStencilFormat: D3DFMT_D24S8
21:05:34: 	Flags: None
21:05:34: 	FullScreen_RefreshRateInHz: 60
21:05:34: 	PresentationInterval: 1
21:05:34: };
21:05:34: successfully set up d3d9 hooks
21:05:35: NV Capture available
21:05:35: FBO available
21:05:35: GL Present
21:05:35: (half life scientist) everything..  seems to be in order
21:05:36: D3D9Present called
21:05:36: DoD3D9GPUHook: success - d3d9ex
21:05:37: D3DSURFACE_DESC {
21:05:37: 	Format: D3DFMT_A8R8G8B8
21:05:37: 	Type: D3DRTYPE_SURFACE
21:05:37: 	Usage: D3DUSAGE_RENDERTARGET 
21:05:37: 	Pool: D3DPOOL_DEFAULT
21:05:37: 	MultiSampleType: D3DMULTISAMPLE_NONE
21:05:37: 	MultiSampleQuality: 0
21:05:37: 	Width: 1920
21:05:37: 	Height: 1080
21:05:37: };
21:05:37: successfully capturing d3d9 frames via GPU
21:05:45: ---------------------- Cleared D3D9 Capture ----------------------
21:05:45: received restart event, capturing
21:05:45: DoD3D9GPUHook: success - d3d9ex
21:05:45: D3D9EndScene called
21:05:45: D3D9Present called
 

Lain

Forum Admin
Lain
Forum Moderator
Developer
Hm, strange. You could also use the game capture hotkey to have it capture the "top level window", though you have to press it again every time you alt-tab. My suggestion would be to run the game in borderless mode so you don't have any alt-tab issues.
 

deranjer

New Member
Figured out a "fix" that almost always works. If I hit F9 and get a black screen and "cannot find window", then I alt-tab out, right click on the "Game Capture" source, go to properties, and hit refresh on "select application". Then I hit OK, and alt-tab back into the game, and it appears to work after that.
 
Top