MediaElement 速度比非线性
我有一个用于显示电影的 MediaElement
。我想精确控制这些电影的播放速度。为此,我使用了 MediaElement
上的 SpeedRatio
属性。
我遇到的问题是它似乎不是线性的。在速度比 2 下,它以几乎 4 倍的速度播放(即 10 秒内播放 40 秒),而速度比 0.5 则以几乎 0.25 倍的速度播放(即 40 秒内播放 10 秒)。这是一个近似值,有人可以澄清吗?文档没有解释。
此外,当以 1x 以外的 SpeedRatio
播放时,电影似乎会抖动。我添加了一个显示电影中位置的标签,很明显它运行不流畅。还有其他解决方案可以尝试吗?
我有使用 XNA 的经验,它可能会提供更好的性能。但是,为了使项目保持简单,我希望该项目完全基于 WPF。菜单系统是用WPF制作的。
I have a MediaElement
which I use to display movies. I would like to have precise control of the speed at which these movies are played. For this purpose I used the SpeedRatio
property on MediaElement
.
The problem I have is that it does not seem to be linear. At speedratio 2 it plays at almost 4x speed (ie 40 seconds play in 10 seconds) and speedratio 0.5 plays at almost 0.25x speed (ie 10 seconds play in 40 seconds). This is an approximation, can anyone clarify? The documentation does not explain.
Also when playing at a SpeedRatio
other than 1x the movie seems to jitter. I have added a label that displays the position in the movie and it is very obvious that it does not run smooth. Are there other solutions to try?
I have experience with XNA and it might give better performance. However, for the sake of keeping the project simple I would like to keep the project entirely WPF based. The menu system is made with WPF.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据此 MSDN 线程< /a>,
SpeedRatio
高度依赖于视频的编解码器。我假设您使用的编解码器不支持平滑快进或倒带。According to this MSDN Thread, the
SpeedRatio
is highly dependent on the codec of the video. I would assume that the codec you're using doesn't support smooth fast forward or rewind.