Jump to content
  • Advertisement
Sign in to follow this  
ade-the-heat

OpenGL how to play videos with sound in opengl

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

I can play a video by say rendering each frame to a texture and then displaying that texture - is there another way ? More importantly - how can I play a video with sound in my game ?

Share this post


Link to post
Share on other sites
Advertisement
What API are you using for video playback? Rendering each frame to a texture works fine for the video. Audio cna be handled dirrectly by the API if you want. Quicktime sends audio to the default output device on playback using StartMovie(). With DirectShow you have to configure the audio pins for the default audio device. DS might automagically instantiate the filters and connect the pins in some cases.

Share this post


Link to post
Share on other sites
I think that's a fine way.
Other way is to use glDrawPixels.

There is OpenML for this sort of thing. Visit khronos.org
I don't know much about it.

For sound, OpenAL, DirectSound, Fmod, Bass.

With OpenAL, make a sound buffer object and sound source.
Bind sound source to SBO. Call alSourcePlay which will play in a separate thread and in your main thread, render your video to window.
Keeping video and sound in sync is something you need to figure out.

Share this post


Link to post
Share on other sites
You can check out libffmpeg. Be warned, it's supposed to be nasty. I would look at OpenML first, but like the previous poster I have no idea how it works or how mature it is.

Share this post


Link to post
Share on other sites
I was looking at this not too long ago, here's one I had found but didn't have the time to test: http://www.radgametools.com/bnkmain.htm It looked rather promising.

Cheers,
Shadx

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!