动态xna视频播放速度?
当从 XNA 3.1 中的视频对象调用 getTexture 时,您可以根据视频开始播放以来经过的时间获取正在播放视频的当前帧。
但是,我需要播放视频,同时根据玩家的操作动态更改播放速度。
我想知道是否有办法以更快或更慢的速度播放视频?以某种方式欺骗玩家相信比实际播放时间多或少?
如果没有,还有其他方法可以使用 XNA 以动态帧速率播放视频吗?
这只需要在 Windows 中工作。
When calling getTexture from a video object in XNA 3.1 you get the current frame of the playing video based on how much time elapsed since the video started to play.
However, I need to play back the video while changing the playback speed dynamically based on the players actions.
I wonder if there is a way to play back the video at a faster or slower rate? Somehow tricking the player to believe more or less than the actual playback time has passed?
If not, any other way to play back videos with a dynamic framerate using XNA?
This only needs to work in Windows.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
内置的 XNA 视频 API 没有执行此操作的功能。如果您只需要在 Windows 上工作,请查看用于播放视频的替代 API,例如:
http://xnadsplayer.codeplex.com/
The built in XNA video API doesn't have a facility to do this. If you only need to work on windows, check out alternative APIs for playing videos such as:
http://xnadsplayer.codeplex.com/
在四处寻找但没有找到任何足够有效的解决方案后,我最终自己编写了一个 mpeg-1 解码器。我能得到的最接近的是使用 directshow,但这有一些严重的滞后问题,因此如果 CPU 工作得太辛苦,改变视频速度就不会实时发生。
I ended up writing a mpeg-1 decoder myself in the end after looking around a lot without finding any solution that worked well enough. The closest I could get was using directshow, but that had some serious lag issues so that changing video speed would not happen realtime if the CPU was working too hard.