如何在XBOX游戏中显示和控制全屏视频
我想为XBox360创建一个游戏,主要是全屏高清视频。玩家在游戏过程中可以选择播放哪个视频。
我需要对视频进行非常细粒度的控制,例如控制播放速度、寻找视频帧以及可能对视频应用简单的效果。
我还希望能够使用增强现实向视频添加元素,因此我需要能够在视频上渲染 3D 对象。
如果这可以在 XNA 中完成那就太好了,但是那里只有基本的视频播放功能。我还有什么其他选择?
I would like to create a game for XBox360 which is mostly full-screen HD videos. The player will be given choices during the game to determine which video is to be played.
I need very fine-grained control over the video such as controlling playback speed, seeking to video frames and possibly applying simple effects to the videos.
I also want to be able to use augmented reality to add elements to the videos so I need to be able to render 3d objects over the video.
It would be great if this could be done in XNA however there is only basic video playback functionality there. What other options do I have?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您解码视频的选项是有限的。
VideoPlayer
类提供从头开始播放视频、暂停和恢复视频、循环播放视频以及设置音频音量的功能。就显示视频而言 - 您拥有很大的自由度。您基本上将视频的每一帧作为纹理,您可以将其绘制为精灵,或应用于任何 3D 对象。这包括将其用作像素着色器的输入,允许您将各种效果应用于视频。
内置播放器的唯一替代方案是创建您自己的播放器。如果您想以 Xbox 360 为目标,这将限制您只能使用托管代码。我不知道有任何合适的视频解码器库。
对于 Windows,稍微谷歌搜索一下就会发现这个库,这可能是一个很好的起点。
Your options for decoding videos are limited. The
VideoPlayer
class provides functionality for playing videos from the start, pausing and resuming them, looping them, and setting their audio volume.As far as displaying videos goes - you have a huge degree of freedom. You basically get each frame of the video as a texture that you can draw as a sprite, or apply to any 3D object. This includes using it as an input to a pixel shader, allowing you to apply all kinds of effects to the video.
The only alternative to the built-in player is to create your own. If you want to target the Xbox 360 this will limit you to managed code only. I am not aware of any suitable video decoder libraries.
For Windows, a little Googling revealed this library, which may be a good starting point.