Find frames in video that contain an image I would like to find all frames in a clip that are likely to contain an image at a known position.

My idea is to grab a still from the video, cut the image and create a mask, feed the video and mask into ffmpeg, use a filter to apply the mask over the video, calculate the difference between the current frame and mask and try to detect if the entire image is black which would indicate that the image is present in the frame.

For example, suppose I have a video where the logo on the right appears at exactly the same spot with the same dimensions several times throughout the video:


My idea is to create a mask that looks like this:


And apply it to the video such that when the image is not present the resulting frame "looks" like this:


But when it does match the blended difference should result in a black screen which I can detect using blackframe.

I've gotten as far as blacking out the actual image, but I'm not sure how to black out the surrounding part of the frame.  

Is this possible using ffmpeg, or is there perhaps a different way of doing the same thing?
You don't need to black out the entire frame. Once you've blacked out the logo portion, apply crop filter to select a rectangular portion entirely within the logo area. Then run blackframe/blackdetect on that canvas. The cropped result will srill retain the original timestamps.