Sign in to follow this  
Roof Top Pew Wee

Easiest way to play video when rendering in D3D?

Recommended Posts

I'm looking to add in video support to the FRB engine using DirectX. Obviously, that's what DirectShow is about (I assume), but I've heard so many bad things about it (and its documentation) that I'm nervous to even look into it - plus there is talk about it changing soon. What I want to be able to do is play a video on the screen while still drawing things on top of it, and possibly to throw a video on a quad or portion of the screen. I guess my biggest problem is I don't know where to start. I googled around a bit, but nothing quite answering my question. So, I ask you experienced folk, what libaries should I look at and if possible, do you have any references for tutorials? My two concerns are ease of use and the number of users; I'd like to use a library that is used often so I can find support in the community if I need it. Any thoughts? --Vic--

Share this post


Link to post
Share on other sites
Shouldn't be worried about DirectShow changing because its COM. Everything COM is always usable through the updates.

You should probably take a good look some engines out there that provide that sort of thing(i had a demo of one, but i can't remember the name of it and if i recall it i will repost).

Share this post


Link to post
Share on other sites
Well, I'm not concerned with the old code not running, but I just want to use the latest stuff, and I don't want to have to rewrite stuff to use the new MS video libraries.

--Vic--

Share this post


Link to post
Share on other sites
The AudioVideoPlayback namespace (assuming here you are working in C#) may have what you are looking for. The Video object can play a video in a window or spit frames as textures. The structure for getting textures out is a little odd. but it should not be too hard to get working as those two things are about all you can do with the Video object.

Share this post


Link to post
Share on other sites
If you are using C++ you have two basic options.

1. The VMR with a custom allocator - this is the new way to do it. Look it up, you create an allocator which will draw frames on to a Direct3d texture with which you can do whatever you like. This is well documented in the SDK which basically means you have an uphill struggle ahead of you and at least a few headaches, or...

2. You can use the Sample Grabber technique - I was working on a tutorial on this but then got bogged down at work. If you look back through CodeMunkie's posts you will find one of him telling me how to get this working. There is one performance flaw in that code (no disrespect CodeMunkie!) but it is very clear and should get you going. If it starts working PM me and I'll tell you how to make it a bit quicker!

Any problems just ask!

Mark Coleman

Share this post


Link to post
Share on other sites
What bad stuff have you heard about DirectShow? I've used it in the past - with OpenGL as well - and it's always been very nice and logical to me.

Share this post


Link to post
Share on other sites
Yeah, I'm using C#, so I will definitely look into that. Well, for one, I've heard that the documentation isn't very good, and hasn't improved for quite some time. This is obviously a concern to me since I'm new to the topic, and am probably going to be spending some time in the docs. Also, I recall reading past posts about people trying to get videos to render to quads and having a lot of problems with it. I suppose I should have paid more attention to those posts, or bookmarked them. I don't know if these claims are true, just things I've read in on the boards.

--Vic--

Share this post


Link to post
Share on other sites
Ah, of course, you're using managed stuff. In which case I can't really comment, beyond my knowledge that the whole managed docs for DX used to be in a pretty dire state. I thought they'd fixed that now, though, so check for yourself...

Share this post


Link to post
Share on other sites
Quote:
Original post by superpig
What bad stuff have you heard about DirectShow? I've used it in the past - with OpenGL as well - and it's always been very nice and logical to me.

[lol] I won't go into too much detail, but trying to do anything advanced with DirectShow has been a traumatic experience for me. I was never entirely sure why, but needless to say, I've not gone back since - and my life is much better because of it [grin]

Jack

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this