Advertisement Jump to content


This topic is now archived and is closed to further replies.


OpenGL OpenGL & AVI/MPEG playback problem

This topic is 6272 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

Greetings, In my current OpenGL application, I need to be able to play an AVI/MPEG file at any time (basic 2D rendering of the video, no need for any 3D video-texture). My problem is that when I do play the AVI file, I''m loosing some of my textures (both in software rendering and with my GeForce 2 MX OpenGL driver). I''ve tried to play the video in a separate process too, the results are the same. I''m using DirectShow to render the video file in a separate window, displayed just over the OpenGL rendering window. This seems to conflict with the OpenGL drivers. But when I launch the AVI from the Mediaplayer while my OpenGL app is running, I don''t loose any texture. Do you know how I could solve this problem ? Thanks, Emmanuel.

Share this post

Link to post
Share on other sites
I don''t know if you''ve found this, but there''s a recent NeHe tutorial dealing with video. I haven''t gone throught it yet (I''ve got far more important things at the moment to do ), but it should help you out. I think it uses Video For Windows instead of DirectShow.

You can find it at

I seem to remember somebody saying that it''s generally a bad idea to use OpenGL and a MS rendering API together...

Simon Wilson,
XEOS Digital Development

Share this post

Link to post
Share on other sites

Sure, I took a look at this excellent tutorial, but it mainly
explains how to render a video to a texture. In my case, I
want to render the video + sound streams in my window.

After some more experiments, it appears that even if I launch
the Mediaplayer application while my app is running, I also
loose textures (either in software & hardware mode) !!!

I''ve found a workaround to my problem: after the video has finished to play, I recreate the OpenGL rendering context.
But this involves reloading all the textures, which can be
a pain and is really not elegant ... But it works.

If someone has a better way to do it, please let me know.


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!