开发者

Playing mpg file in XNA

开发者 https://www.devze.com 2023-01-04 22:29 出处:网络
Is there any wa开发者_StackOverflow社区y to play mpg files in XNA? (I want to develop a game that a video stream has to play at background)XNA has built-in video playback. A good place to get started

Is there any wa开发者_StackOverflow社区y to play mpg files in XNA? (I want to develop a game that a video stream has to play at background)


XNA has built-in video playback. A good place to get started using it might be Catalin's XNA 3.1 Video Sample.

One downside to XNA's built-in functionality is that it has limited format support (specifically WMV9). So you will need to convert your video to that format. Two options for encoding are Windows Movie Maker and Windows Media Encoder (which seems to have recently become Expression Encoder 4).

Once in that format, you can simply add it as content to your project. Then load it as a Video through the content manager, and use VideoPlayer to play it back, calling videoPlayer.GetTexture() to get a texture of the current video frame you can set on the device or pass to spriteBatch.Draw().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号