Comments (8)
Yea it should work. Can you share which build of Windows you're trying this on as well as the error code inside the hresult_error
object?
from windows.ui.composition-win32-samples.
I'm running on Windows 11 Pro 22H2 SDK 10.0.19041.685
I'm having trouble getting the error code- this isn't working
CreateForWindow doesn't return, I just see
Its complicated by the fact that I'm running the capture in a DLL as the main project can't use WinRT. The call stack is
from windows.ui.composition-win32-samples.
Usually this happens because the window you're trying to capture is deemed non-capturable by the shell. Is it always the same window? Does it work if you attempt to capture that window first?
Does this sample work for you for successive window captures?
from windows.ui.composition-win32-samples.
So if I try and capture the second window first I get the exception straight away.
I'll investigate the differences between the windows tomorrow.
What could make a window non-capturable?
from windows.ui.composition-win32-samples.
The general rule of thumb is anything that shows up in the Alt+Tab view is considered capturable.
from windows.ui.composition-win32-samples.
Thanks for your help. I can now do the successive captures.
But its pretty slow, averaging ~10fps and I'm having to wait up to 100ms for the new frame. I guess that's to be expected.
Is it possible to run multiple simultaneous capture instances?
from windows.ui.composition-win32-samples.
I'm a little surprised you're seeing that kind of performance. What hardware are you running on?
Yes, you should be able to run more than one capture at once. There is a bug in Windows 10 when running multiple captures from the same GraphicsCaptureItem object though.
from windows.ui.composition-win32-samples.
Just to say that our main app can now use WinRT and I don't need to run the capture in a DLL any more. All these issues have now gone away and I can do multiple simultaneous captures at full speed
from windows.ui.composition-win32-samples.
Related Issues (20)
- Cannot use IGraphicsCaptureItemInterop::CreateForWindow with electron apps HOT 6
- This repo is missing important files HOT 4
- How to capture Windows10/11 Virtual Desktop via Windows.Graphics.Capture ? HOT 2
- Accessing screen capture image bytes with MapFlags.DoNotWait for better CPU usage HOT 3
- ScreenCapture Sample - write capture stream to disk mp4? HOT 5
- Capture area of a monitor HOT 4
- Memory Leak? HOT 5
- BSODs on 4 separate Hard Drives HOT 3
- Multiple screen captures in a loop cause explorer.exe and native Windows app to lag? HOT 11
- Capture OnFrame Callback very slow on Win11 23H2 HOT 7
- access_denied in CreateForMonitor in some cases HOT 5
- Cannot catch errors in CreateCaptureItemForWindow HOT 3
- WGC CaptureFrame returns wrong SystemRelativeTime in window capture mode HOT 2
- Cursor may become invisible when recording some fullscreen games using WGC HOT 7
- Frame has issue after change window state (maximize from normal/ normal from maximize/ ...) HOT 1
- ScreenCaptureforHWND sample leaks handles leading to "Out of memory" crash HOT 1
- ScreenCaptureforHWND sample main thread hang HOT 2
- ScreenCaptureforHWND: How to get the byte data of the captured frame? HOT 4
- CreateForWindow 0x80070057 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from windows.ui.composition-win32-samples.