Seeking help/example regarding graphics api reading pixel data inside filters?

dcmouser

Member
I have worked a little bit with video filters in OBS, and using c code and effect files to do processing of video sources, to rescale them or color corrections, while rendering etc.

There are lots of great example of filters that render effects using only shader language stuff.

Bit I'm working on a filter now that requires that I do some more involved C code analysis of the source video that is not possible using just the shader language stuff.

I need to something similar to what the OBS Face Tracking plugin does -- but thankfully not nearly as complicated. That is, I need to be able to examine the source video in the filter C code, and I need to do so as efficiently as possible.

So I'm hoping to find some pointers to good practices and basic concepts for efficiently reading/processing the pixels in a source video from a filter so I can detect things. The Face Tracking plugin is an incredible achievement but it's pretty hairy and complex and I was hoping for something a little simpler to study.

Ideally, I think I'd even like to be able to perform an internal downscaling of the source image to a smaller temporary image buffer that I then scan for patterns (not to render this buffer on screen but just to render in a temporary smaller buffer which I could then loop through, presumably faster than looping through the entire large source image), and I'm not sure how to do that.

I'm new to this area of OBS code and hoping to find some more gentle discussion of this idea.

Thanks in advance!
-jesse
 
Top