movie screenshot

Started by
12 comments, last by iNsAn1tY 17 years, 2 months ago
hi! i would like to save a snapshot of a movie to an opengl texture. how could i? a simple frambuffer-save (like the 'printscreen' in windows) is not enough, as movies use overlays. i tried to turn off overlaying, but i was still unable to save the pic. could you help me with any advices? thanks a lot!
credo
Advertisement
www.fraps.com
Quote:Original post by Dunge
www.fraps.com


i know fraps very well, but i dont know why you posted here...? it is a screen capture software, but i wan to save a movie screen to an OpenGl texture. (in c++/opengl code.) how does it come to Fraps?
credo
If you want to display a movie via OpenGL check this or Nehe Tutorial #35.

If you just want to use one screenshot, why not capture it offline?
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
thanks for your replies!

no, i do NOT want to display a movie. i want to MODIFY a movie. ANY movie. so not an AVI, or any known formats, i wanna catch anything that is on the screen, ant this project's one part is to modofy a movie's pic.
so for example, you play a dvd, or a divx on your pc, i want to catch this picture, and save it to an opengl texture, then make my modifications, than draw my modified texture to a separate device.

so the question is still the same: how could i save a movie's snapshot to an OpenGl texture?

thanks a lot!
credo
pls, any idea?
i would be very grateful...
credo
Well, the first part of what you're asking (capturing the source image) might be a bit tricky.

If you just want to capture the whole screen, it's easy. There are Win32 GDI functions to do that, the ones which Fraps probably uses. Grab a device context for the whole screen with GetDC( NULL ) and use BitBlt to copy from it. Then you can process that data and create an OpenGL texture from it.

However, if you want to capture from a particular window, the first thing you need to do is determine which window to capture from. Maybe you could just get the window handle of the currently active window (GetForegroundWindow). If you want to pick from a very specific window, maybe you could code up a picker like the thing Spy++ uses - find it in the Visual Studio tools folder and have a bit of an experiment with it. Basically, it allows you to get the window handle of a window by clicking on it. It's probably fairly simple. Once you've got the window handle, you can get the DC and copy from it as above. Consider though that certain programs might take steps to prevent you from doing this. There's copy protection built into DVD software, although I don't think that it can stop you if you grab the window handle independently through the Platform SDK and read from the DC.
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
On Linux, there is the GLX_EXT_texture_from_pixmap extension which is just made for this to realise a 3D Desktop.
I don't think there is a similar possibility on Windows. You could potentially do this with the technology Windows Vista uses for the Aero Desktop, but i assume that this technology is proprietary and not accessable to normal developers.
You could try just decoding the video yourself using a codec and related library (for example, SMPEG), then converting the image data by hand to a texture.
Thanks!
1. I think a simple gdi-way screensave with bitblt wont work becouse of the overlays. I have not tried it yet.
2. Its a Windows program i write. Unfortunately there are many programs that use a technology that would be usable, but they are all closed source.
3. Decode the video? Wel.. not a bad idea...:) the trouble is that i can presume nothing of the video. It cab be anything...
credo

This topic is closed to new replies.

Advertisement