You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using your library in personal OBS-like project and while overall its working great, i noticed that captured desktop texture stutters and never achieve desktop framerate. Fps are pretty close, but sometimes frame drops occur. If i understand correctly, that because frame grab occur on background thread and copied to unity on demand without any sync.
While experimenting i moved duplication from Duplicator::Start() to Monitor::Render(), and now stuters are gone, since AcquireNextFrame locks thread untill new image is captured
I'm not very familiar with native-side things and i don't understand how this dirty hack didn't slowed all things down to a crawl, but it works for me.
I understand that your library prioritizes unity performance over capture performance, but "official" setting for stutterless capture would be nice.
Also, is there any unforeseen consequences in my hack, except frame skips synced to desktop skips?
The text was updated successfully, but these errors were encountered:
3DI70R
changed the title
60fps capture?
Stutterless capture?
Apr 8, 2020
Thank you for using uDD! And thank you for providing a good solution to enhance a frame rate. I'll check your code also in my environment and if it doesn't have big problem, I'll add a parameter to executing Duplicate() in the render thread.
Well, i've tried to use my "hack" with dual monitor setup, and its problem became very apparent. It worked fine with one monitor just because my unity app is fullscreen transparent window, and it forced desktop to update on every frame. When nothing happens on second monitor, app freezes, just because it waits for new frame from second monitor.
So, i probably found different, and more correct solution.
I always used OBS as reference during stutter detection, and here is OBS implementation of desktop duplicator: https://github.com/obsproject/obs-studio/blob/master/libobs-d3d11/d3d11-duplicator.cpp (gs_duplicator_update_frame)
It uses no timeouts and releases frame right after its copied to output texture.
I've removed timeout in Duplicate, and called release after Monitor::Render(), and to my surprise, now capture is very smooth, even with multiple monitors. I didn't tested it very much, but no side effects found yet.
Hello
I'm using your library in personal OBS-like project and while overall its working great, i noticed that captured desktop texture stutters and never achieve desktop framerate. Fps are pretty close, but sometimes frame drops occur. If i understand correctly, that because frame grab occur on background thread and copied to unity on demand without any sync.
While experimenting i moved duplication from Duplicator::Start() to Monitor::Render(), and now stuters are gone, since AcquireNextFrame locks thread untill new image is captured
I'm not very familiar with native-side things and i don't understand how this dirty hack didn't slowed all things down to a crawl, but it works for me.
I understand that your library prioritizes unity performance over capture performance, but "official" setting for stutterless capture would be nice.
Also, is there any unforeseen consequences in my hack, except frame skips synced to desktop skips?
The text was updated successfully, but these errors were encountered: