Jump to content
  • Advertisement
Sign in to follow this  
_dogo

OpenGL movie screenshot

This topic is 4238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!