How does OBS capture the desktop at a particular framerate? #12058
Unanswered
IcyAlmond
asked this question in
Development Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use DDA on windows (AcquireNextFrame) to get frames of the screen, but I'm struggling to get it to reach a particular set framerate.
Currently if I put it into a loop, it just gets frames as quick as possible. Even if I calculate a "wait" timing like in Nvidia's example here https://github.com/NVIDIA/video-sdk-samples/blob/aa3544dcea2fe63122e4feb83bf805ea40e58dbe/nvEncDXGIOutputDuplicationSample/main.cpp#L351 it just seems to set a limit on how slow DDA will be in replying with a frame, it seems to imply that if things on screen are moving it will do nothing to limit how fast a frame can be returned, hence it captured at 150fps even though the timeout I gave to DDA was always under 17 ms (for 60fps 16.66ms)
I've also tried sleep_for but it doesn't seem consistent enough? i got about ~40fps when i aimed for 60fps.
how does OBS get an accurate capture rate using dda?
and how does the replay buffer mode work? I understand that it encodes to a memory location and then saves it to disk when a button is pressed, but once the buffer is full, how does it overwrite old data in a way which allows the whole buffer to still be a valid video stream?
Beta Was this translation helpful? Give feedback.
All reactions