Home > Code Internals > The Windows Green-Screen

The Windows Green-Screen

I wanted to post this a few years back but I just didn’t have the time.

This is something really interesting and it seems that nobody else has come across this little secret.

Many members from dreamincode.net Forums asked me how I could make my signature show videos running in the background and I’ve finally found time to explain how.

This is how my Forum Signature looks like (or looked like when I was writing this post) :b2c_sig

To see how this works, follow these steps:

  1. Open your favourite media player and play any video file.
  2. Ensure that the media player window is covering the image above.
  3. Now, minimize the media player.
  4. You should now see a portion of the video being played on the image as if the image itself were a media player.

Awesome, isn’t it?

I figured this out while I was experimenting with an application of mine which tried to modify Media Player Classic on-the-fly.

It seems that in Windows XP (might also be true for other windows OSes and other OSes), Video files can only be displayed on a portion of the screen that has a particular colour. The video can only be displayed on a portion of the screen which is currently displaying a specific colour.

That specific colour is RGB(16,0,16).

Try it out for yourself. Create an image with a background colour of RGB(16,0,16) like this:b2c_test_screen

Now play any video over this image and minimize the video player. The video should now be visible on the image.

My guess as to why this works is that Windows (or other OSes) needs to be able to figure out where a video should be displayed when a media player requests for playback. According to me, this has been intentionally included in the video playback design.

If the media player just provided co-ordinates of a rectangle to the OS for displaying the video, that would mean that if any other application was placed on top of the media player window, the video would be displayed over the application’s interface which would not allow the user to see the application’s user interface (forms, controls etc.)

Here’s what I think they did to fix the problem.

The principle behind this design could have been that “if a video could be displayed only within a rectangle that displayed only a specific colour, no overlapping application would be affected.

But which colour would be best suitable for this purpose? Black is the first colour that comes to my mind for obvious reasons but black is a common colour and is used frequently in desktop wallpapers or in user interface elements.

Hence they chose a colour that’s technically not black but would look just like black and hence they must have come up with the colour RGB(16,0,16)

My reasoning probably isn’t correct but I’m pretty sure that the real reason is based somewhere along the lines.

I just find it ironic that something that behaves just like a green screen doesn’t even have a hint of green in its colour code (its 16,0,16 in RGB) 😉

As I’m still not sure if this works on other operating systems, I’d appreciate it if you could test this on your operating system and post the result as a comment to this post. Thanks.

  1. January 17th, 2009 at 22:34 | #1

    It worked with Media Player Classic but not with VLC on Windows XP using Opera.

  2. Robin
    January 18th, 2009 at 20:09 | #2

    Thats interesting. Good post.

  3. Gyi
    September 8th, 2009 at 13:52 | #3

    I think it is a directShow bug. I does not work in players that uses openGL nor in Vista/Win7 that has a newer version of directShow.

  4. September 28th, 2009 at 03:01 | #4

    I wish you could show this with screen shots and steps. For Newbies like me,,, Im not sure if my computer could do this as I have Windows XP…. I do have a coupon on my site for green screen video software. Its only untill Sept 30th 2009 , right around the corner. Untill I can get another one.

  5. September 28th, 2009 at 03:04 | #5

    I also have a neat how to manual for green screen on my site. Its free can be very helpfull if you are trying to use green screen photography for the first time.

  6. Mohammed Amer
    March 14th, 2010 at 18:07 | #6

    I’ve tried it but unfortunately nothing happened as such.
    I’m running Windows 7.
    Could you please help me how can I get that awesome thing?

  1. No trackbacks yet.