I'm not one to say something is impossible, but I don't think PHP was meant to handle doing this on its own on the fly.
In theory, you could read the video and process each frame and then AND/OR/XOR or whatever your image into the video and then process the next frame. If done from a binary level, I'd predict PHP could do this. But you'd have to figure out how to persuade PHP to interpret each video format.
I would think you're best hope would be to find a 3rd party tool/application that could do this from a command line. Then you could have PHP launch the command line tool.