Using difference in video to make a mask?

I’m wondering if it’s possible to take two videos and create a mask out of the difference. Kind of like a poor-man’s green screen.