Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The maximum frame capture is 60 per second is limitation #92

Open
JustinKJChen opened this issue Mar 5, 2025 · 8 comments
Open

The maximum frame capture is 60 per second is limitation #92

JustinKJChen opened this issue Mar 5, 2025 · 8 comments

Comments

@JustinKJChen
Copy link

Measure latency per frame capture, the latency is 15ms-17ms.

The latency is 15ms-17ms per frame capture, is this performance for frame capture?

The capture device is nVidia RTX4090.

@JustinKJChen
Copy link
Author

The display refresh rate is 240 Hz.
But I find the almost latency is 15-17ms per frame capture.
This limitation is exceptional?

@robmikh
Copy link
Owner

robmikh commented Mar 5, 2025

Could you share some more details?
What build of Windows are you running? Are you capturing a window or the whole screen? Are you capturing a full screen game that is rendering at >60 fps?

@JustinKJChen
Copy link
Author

Could you share some more details? What build of Windows are you running? Are you capturing a window or the whole screen? Are you capturing a full screen game that is rendering at >60 fps?

Windows build is 10.0.26100
The game launch with fullscreen, nVidia DDS generate Display2. I set capture whole screen in Display2.
The game is rendering during 220-240 fps

@Esvandiary
Copy link

We've been seeing the same with WGC on 24H2 (26100) with some users. We've seen it with our recorder but the same CaptureSample binary does full frame rate on pre-24H2 but seems to be capped to 60fps on 24H2.

@robmikh
Copy link
Owner

robmikh commented Mar 7, 2025

Does this improve if you set the MinUpdateInterval property to something non-zero? Like 1 millisecond?

namespace winrt
{
    using Windows::Foundation::Metadata;
    using Windows::Graphics::Capture;
}

if (winrt::ApiInformation::IsPropertyPresent(winrt::name_of<winrt::GraphicsCaptureSession>(), L"MinUpdateInterval"))
{
    session.MinUpdateInterval(std::chrono::milliseconds(1));
}

@Esvandiary
Copy link

Esvandiary commented Mar 7, 2025

@robmikh Yes it does! Thanks for the tip, we can use this to fix high-framerate capture in our recorder for now.

If I could ask for a bit of info on the implementation of MinUpdateInterval, if possible - is it "once elapsed we'll deliver the next frame once it's provided to us in the future" or "once elapsed, we'll immediately deliver the last frame we received if we have one that wasn't delivered yet"?
In other words if we set MinUpdateInterval to 10ms, will we typically see 100fps (assuming >=100fps frame rate of the target content) or will we be undershooting a bit due to waiting for the next frame after the interval elapses?
I can appreciate this is something that could change in future so you might not want to commit to a specific behaviour, that's fine if so. We can continue using our own frame rate limiting mechanisms (and will do on pre-26100), but obviously this will be more efficient if we can make use of it!

@robmikh
Copy link
Owner

robmikh commented Mar 7, 2025

Good to know! I think I know what's going on then.

As for how MinUpdateInterval works, we are tracking dirty regions in the compositor. When the compositor goes to render a frame, it will check if the interval has elapsed and draw if there are any accumulated dirties. It's implemented this way to reduce the rendering done in the system compositor.

Ideally this means you should get something that matches the specified interval, assuming the content is constantly changing.

@Esvandiary
Copy link

Thanks for the explanation! That sounds like we will need to guard against frame rate undershooting, which is fine (we'll just specify a MinUpdateInterval of "a bit" shorter than what would be required for our nominal frame rate).
Very cool to see this feature get added BTW - previously we've essentially been having to just drop frames if the content's frame rate is way higher than our nominal capture frame rate, which felt wasteful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants