DirectShow and Direct3D
I''m having problems figuring out how to use both Direct3D and DirectShow in the same application. Basically I want to put a cut scene into my game. So, I figured directShow would be useful to play the avi. I''ve looked at the documentation and the sample project called cutScene. From what I can tell, directShow opens a child window, pumps messages to the parent window, puts the child window in full screen mode, and runs the avi in the child window. Is there a way to just run the avi in the original window without having to create a child window? Right now I can get my game to start with the cut scene and then switch over to the game but there''s about 5 seconds between the avi and the game where you can see the desktop since the avi window was destroyed but the game window is still initializing. Can anyone explain what I should do? Should I even be using DirectShow? Any comments would be helpful.
(note: I''m using VC++ 6 and DirectX 8)
There''s an example project that renders onto a texture if I''m not mistaken. It plays the ski.avi on a spinning cube... that''s the one you want to look it.
Magmai Kai Holmlor
"Oh, like you''ve never written buggy code" - Lee
"What I see is a system that _could do anything - but currently does nothing !" - Anonymous CEO
Magmai Kai Holmlor
"Oh, like you''ve never written buggy code" - Lee
"What I see is a system that _could do anything - but currently does nothing !" - Anonymous CEO
Okay, as Magmai said... you can either create a quad that covers the entire screen and render the avi on that as a texture... or you can clear the screen, suspend the renderer and use something like BINK video library to playback your video. Avi is just about the most common and the crappiest and bulkiest format I know.
If I have to recommend, I recommend BINK/SMACKER tools http://www.smacker.com/ They have been used in many games and I've used them and personally... I like it despite the fact that they are a bit bitchy to use.
Both, DirectX SDK 7 and 8 have a sample on how to use D3D to render video onto a texture. If anyone works with OpenGL, there's a tutorial on the same subject at NeHe : http://nehe.gamedev.net/
- A.J. -
"Where's the KABOOM?! There was supposed to be an earth-shattering KABOOM!"
Edited by - A J Oja on December 14, 2001 9:32:54 AM
If I have to recommend, I recommend BINK/SMACKER tools http://www.smacker.com/ They have been used in many games and I've used them and personally... I like it despite the fact that they are a bit bitchy to use.
Both, DirectX SDK 7 and 8 have a sample on how to use D3D to render video onto a texture. If anyone works with OpenGL, there's a tutorial on the same subject at NeHe : http://nehe.gamedev.net/
- A.J. -
"Where's the KABOOM?! There was supposed to be an earth-shattering KABOOM!"
Edited by - A J Oja on December 14, 2001 9:32:54 AM
avi is bulky? granted its not the best format. but it is the most versitle since you can use virtually ANY codec for yoru video and audio streams (thats right you can have more than one of each). lets see, amazing quality and size can be mized and matched, yes you too can use this formats together:
audio: mpeg1 layer1 or 2 or 3, mpeg2, ac3, wma, wav, aclep, voxware, vivo, etc.
video: divx, wmv8, wmv7, indeo 4.3, indeo 5.0, mpeg1, mpeg2, mjpeg, raw yuv, raw bitmaps, rle bitmaps, vivo, duck, etc.
and also misc stuff that can be added. like subtitles. in fact if bink is availible in a codec format, you can even use that in an avi file. its old, its not as clean as it could be, but its very worthwhile. avi is not terrible hard to edit or use.
i am not trying to say bink is bad, but its no where nearly as flexible as avis are. also getting d3d8 to display videos aint too hard. the texture3d shows very easily how to do it (and you get the benifit with some work the ability to support and codec directshow supports). also there is a cutscene sample as well.
Edited by - a person on December 14, 2001 4:50:07 PM
audio: mpeg1 layer1 or 2 or 3, mpeg2, ac3, wma, wav, aclep, voxware, vivo, etc.
video: divx, wmv8, wmv7, indeo 4.3, indeo 5.0, mpeg1, mpeg2, mjpeg, raw yuv, raw bitmaps, rle bitmaps, vivo, duck, etc.
and also misc stuff that can be added. like subtitles. in fact if bink is availible in a codec format, you can even use that in an avi file. its old, its not as clean as it could be, but its very worthwhile. avi is not terrible hard to edit or use.
i am not trying to say bink is bad, but its no where nearly as flexible as avis are. also getting d3d8 to display videos aint too hard. the texture3d shows very easily how to do it (and you get the benifit with some work the ability to support and codec directshow supports). also there is a cutscene sample as well.
Edited by - a person on December 14, 2001 4:50:07 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement