• Advertisement
Sign in to follow this  

Playing video files in DirectX

This topic is 2088 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't find any helpful documentation on this anywhere.

I found "IAMMultiMediaStream" on MSDN, but it says it's depricated and shouldn't be used. It doesn't say what I should be using.

Anyone know where to look for this?

Share this post


Link to post
Share on other sites
Advertisement
DirectX on its own will not provide any mechanisms for playing video, you'll need another library for that

If you're developing for windows only you can use DirectShow/Windows Media Foundation for playing a wide range of video formats without having to worry about codec licensing

If you have a lot of money at your disposal you can purchase a Bink license, which provides a library and codec specially designed for game development which has seen use in loads of AAA titles

Another popular free (GPL/LGPL) cross-platform alternative is FFmpeg, which can play a wide variety of codecs but does not provide licenses for the proprietary ones.
You can also have a look at libtheora which is a decent free and open source codec, but which will require somewhat more work to integrate into your codebase.

Share this post


Link to post
Share on other sites
Ok I think i remember hearing about Direct Show somewhere. Which is the easiest? I don't really have alot of time to study and then implement the code.

Share this post


Link to post
Share on other sites

Ok I think i remember hearing about Direct Show somewhere. Which is the easiest? I don't really have alot of time to study and then implement the code.


Not having used all of them I can't say which one is the easiest. I've heard from others that Bink is really easy to implement, but the license costs are probably too much for a single-man project.

FFmpeg should be quite easy too, you just have to be somewhat more careful about which license to use and which codecs to include in your FFmpeg build if you don't want any legal trouble

Share this post


Link to post
Share on other sites
ya i just looked them up, they're all pretty easy, DirectShow is probably my best option due to licensing though thank you.

Share this post


Link to post
Share on other sites
When you download the DirectShow SDK (which is part of the Windows SDK, I believe) there should be a sample application for playing a video and rendering to a D3D texture (DX9). I based my implementation off of that, but I encountered some threading issues, where the video would just stop rendering, and had to bang my head into it a bit until it went away.

I find DirectShow works pretty good. Edited by Scarabus2

Share this post


Link to post
Share on other sites

When you download the DirectShow SDK (which is part of the Windows SDK, I believe) there should be a sample application for playing a video and rendering to a D3D texture (DX9). I based my implementation off of that, but I encountered some threading issues, where the video would just stop rendering, and had to bang my head into it a bit until it went away.

I find DirectShow works pretty good.


We have to keep in mind though that DirectShow is slowly becoming deprecated in favor of Windows Media Foundation, so DirectShow support cannot be guaranteed in the near future

Share this post


Link to post
Share on other sites
You can also use gstreamer, which provides support for video and audio files aswell. Gstreamer itself relies on other libraries like ffmpeg to do the decoding.

Share this post


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

  • Advertisement