Skip to main content
GameDev.net gamedev.net
🔒 Locked

Video Playback

Started by Nightski Jun 3, 2006 at 9:35 PM 6 replies 800+ views
Original Post
Nightski
Nightski
I am looking for a way to render a video as a texture on a surface instead of a static image. My question is - does DirectX provide any way to do this? I have looked into DirectShow but so far haven't found anything. It all appears to be for video playback but not in a 3d context. Of course, I could implement this myself but it would not be trivial by any means. Before I go down that road does anyone know of an easier way?
TheC00L1
TheC00L1
Do you have the directX 7 sdk handy, cause there's a specific sample app that has a spinning box with a avi video playing on it via texture, if dod't have it i can give ya it. But the only problem is it is in DX7, very out dated, cause it uses DirectDraw.
A wiseman once said nothing, but no one was there to hear it.
don
don
Apparently there used to be a sample in the DX SDK (when it included DShow) called VMR9Allocator that showed how to get DShow to render video frames to a D3D9 texture.

I think the DShow samples got moved to the Platform SDK so you might check there, or search the web for "VMR9Allocator".

theunicorn
theunicorn
Okay, first of all you should use DirectShow which is no longer a part of the DirectX SDK. Instead they put it in the Platform SDK(see Platform SDK for Widnows 2003 sp1 where I know it is). Personally I like the help files that come with the extra package that came with DirectX SDK february 2005 but I cannot find a link to that at the moment. After that You should look at the SampleGrabber and see if you can find a reference for how it can be used with a Direct3DTexture.

If there is any confusion I can post my code however it is poorly optimized and even less documented.
Nightski
Nightski
Yeah DirectShow seems to be the way to go. So judging from the examples they basically subscribe to the TextureReadyToRender event and whenever it is fired they update the mesh's texture with the current frame of the video.

It seems to be working now but is kind of messy and definately needs to be cleaned up.

Thanks a bunch for the help. I'm excited to see the new solution Microsoft is working on for this (successor to DirectShow).
Krohm
Krohm
Quote:
Original post by Nightski
I'm excited to see the new solution Microsoft is working on for this (successor to DirectShow).
What? Is there a plan to suppress DShow? I don't know of it.

Previously "Krohm"
jollyjeffers
jollyjeffers
Quote:
Original post by Krohm
Quote:
Original post by Nightski
I'm excited to see the new solution Microsoft is working on for this (successor to DirectShow).
What? Is there a plan to suppress DShow? I don't know of it.
DirectShow got bumped to the PSDK about a year or so back - its no longer an actively developed technology as far as I'm aware.

I think there is a successor in the pipeline, but I dont really know any details about it. I've a feeling it might be at least related to one of the Vista-generation technologies.

hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |
Krohm
Krohm
Thank you. Luckly, this seems far from being declared as deprecated, at least for the next year.
I didn't realize putting in in SDK meant to say that - I was thinking they just wanted to consolidate its position.

Anyway, I'll wait for the next thing... by sure means they'll want to integrate it more in Aero and stuff like that.
Previously "Krohm"

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.