Accessing the ID3D11Texture2D in a plugin

HireRyanToday

New Member
I'm building an AI project, and I've got it halfway there, my final hangup is trying to get a smooth, low latency frame capture. There's the virtual camera plugins and all that, but I have to imagine there's fairly significant latency vs grabbing it as it comes off the backbuffer. I did some work with a raw dxgi capture so I understand the raw objects, and managed to turn that into an opencv mat.

I'm trying to dissect various plugins, but it all feels more convoluted and complex than I need. Everyone is making filters and shaders and piping to recorders and all this stuff and it's waaay more than I need.

My goal is take whatever obs sees right now and turn that into a cv mat in a non blocking fasion. So lets say it's capping at 100fps, but my conversion only occurs at 60 fps I don't want to block anything. I'd just take the next available frame. I don't need to show anything back to the user, I don't need any settings or widgets. I just need that ID3D11Texture2D (preferably with cpu access, but I understand how to make my own staging textures etc if that's not possible).

Is there a super simple plugin I can look at, that just gives me a frame with no intent on giving back to anyone or ever rendering it?
 

Suslik V

Active Member
You need to write your own OBS. OBS uses different ways to get the pictures: hooks, build-in OS API, OS level drivers for specific devices, directshow, pipewire, syphon...
 

HireRyanToday

New Member
You need to write your own OBS. OBS uses different ways to get the pictures: hooks, build-in OS API, OS level drivers for specific devices, directshow, pipewire, syphon...
I think the gs texture functions are exposed to plugins so that should not be necessary. I did end up going a different route, but I might still circle back. I had some misunderstandings about D3D11_BOX that threw me off.
 
Top