Jump to content
  • Advertisement
Sign in to follow this  
celios

OpenGL Playing video with OpenGL

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

What's the best way to play video with OpenGL ? Is there any freely available library to do this ? Right now, the only way I can think of doing this is : - Draw two triangles that span across fullscreen in backbuffer. - Create some textures. - For every frame : - Copy frame pixel datas to texture. - Bind texture to the triangles. - Flip backbuffer. This approach seems very costly. I am sure there are better ways. Please guide this beginner :) Thanks, celios

Share this post


Link to post
Share on other sites
Advertisement
You can do it this way:
- get a decoding library for your video, for instance FFMPEG
- create and bind just one texture
- decode the frame
- upload the frame to the GPU using glTexSubImage2D() or using a PBO
- draw a quad in the correct size

Share this post


Link to post
Share on other sites
Thanks for all the fast replies :D

The OpenML looks very interesting but seems too complicated for my current purpose.

Looks like I still have to stick to textures.

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!