Question

I've been looking for a way to grab a frame from a video currently in the hardware overlay, and I've not found anything solid. Everything I find is either for grabbing frames from a video you are playing (in your app) or creating a filter to which I can't find a good example on how I would actually grab the frames in my app (or can the app be an in-memory filter that doesn't need to be "installed" and chosen in player?).

So, my question is how would I go about doing this? I know it's possible with a filter, I've seen it done, I just haven't seen how it's done. Is there a good example somewhere of how to grab frames in a filter and send them to my app? Or is there a way like, hook into some procedure call and get the frame from there somehow?

I've seen hooking done for DirectX to get all the DirectX info, but, hardware overlays are not DirectX, are they? Or can I just hook into DirectX and grab the front buffer from there or something?

I've been searching for resources on this issue but I keep going around in circles and the fact that there are people who want to put the overlays on DirectX surfaces doesn't help, a lot of the results are on that topic.

If it's relevant, I would prefer a solution in C++ (the app I have is in C++ and currently uses the "regular" way of grabbing screenshots from screen, which ofcourse leaves black rectangles for the hardware overlay).

No correct solution

OTHER TIPS

There are two ways I know how to grab frames using directshow. The first one is with using the SampleGrabber filter there are many examples available in internet. The second one is with using your custom videorenderer in this case you have to implement your own filter you can use baceclasses project from platform sdk in order to derive from cbasevideorenderer and implement your render method.

If you need the app's image in first place and hardware overlay is an obstacle to obtain the snapshot, perhaps the easiest would be to make a simple application which starts video playback through overlay (you don't need to stream real samples! just pausing the graph would be suffucuent) and run your application prior to running application of your interest.

This way you would lock the overlay, which is typically a limited resource, e.g. one per video adapter, and the application of interest will be unable to use it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top