• Advertisement
Sign in to follow this  

Cutscenes with DirectShow

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

Hi everyone, In my game, I want to play a video cutscene at certain times. I am currently using IVideoWindow to do this, and it works perfectly when the game is being played in a window - a new window with the video is created over the top of the game window (the same size), the video plays, the new window is destroyed, and program control returns to my game. Perfect. However, when I play the game fullscreen, I get some problems. First of all, I obviously don't want the video to play in a window any more - I want it to be fullscreen too. So, I have been using put_FullscreenMode(OATRUE) to set the window to play fullscreen. When it plays though, the screen turns black (as would be expected in preparation for the video), and in the top left corner, the video plays in 800x600 size (this is the size I set for the Direct3D device before setting fullscreen - I don't know if this is important though). Ideally, I would like the video to stretch to fit the whole screen. If this is not possible, it would be good to at least have it centered. But if I set the game to be windowed, and the video to be fullscreen, the video stretches to cover the whole screen (like I want it to). So that's one problem, here's my second: when the video finishes and the game is being played fullscreen (it doesn't matter whether the video is fullscreen or not - the same thing still happens), the game becomes minimized and I can't reopen it... Anyway, I'd really appreciate some help on this - it's driving me crazy! Thanks, Harry

Share this post


Link to post
Share on other sites
Advertisement
I've gone through this DirectShow dance myself a while ago, but dealing with the video window was a bit of a pain. Even if you recycle the game's HWND for the video, it was a pain.

I ended up sticking with AVIs and extracting the WAVs and BMPs myself. The WAV you can play in DirectSound, and the BMPs can be used in your game as textures. I create a quad to display the video on. Search for Audio Compression Manager and acmStreamOpen() in MSDN for dealing with audio codecs, and ICDecompress() for dealing with video codecs.

I can help you out with more info if you are gonna investigate this.

Share this post


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

  • Advertisement