@ChenCravat In an old version of Windows (Windows 98 iirc) if you took screenshot of a video from media player and paste it into paint, and resume media player, video would play inside paint. Do you why it happened? It is still bugging me to this day. β Yasar Arabaci @ysar.bsky.social (@y_arabaci) July 18, 2025
One of the tricks for video playback is to use a green screen, more technically known as color-keying or chroma-keying.
The media player program didnβt render the video pixels to the screen. Rather, it followed this recipe:
Draw solid green where you want the video to go.
Render the video pixels to a graphics surface shared with the graphics card.
Tell the graphics card that whenever it sees a green pixel about to be written to the screen, it should substitute a pixel from that shared graphics surface.
Surface ποΈ β ποΈ β Graphics card β ποΈ Desktop Monitor
There are a few advantages to this approach.
One is that the shared graphics surface need not have the same pixel format as the userβs main display. Therefore, you can specify that the shared graphics surface have a pixel format that matches that of the video, avoiding the need to do any pixel format conversions.
Another is that you can update the content without having to go through a full paint cycle. You just update the shared graphics surface, and the results are on the screen at the next frame. This lets you update the video at 60 frames per second from a background thread, which works even if the UI thread is busy or sluggish.
... continue reading