MediaElement的Speed​​ratio不是线性的线性、不是、MediaElement、Speed

2023-09-03 07:14:41 作者:距离产生小三

我有一个的MediaElement ,我用它来显示电影。我想有在这些电影的播放速度precise控制。为此,我使用了 Speed​​Ratio 财产的MediaElement

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.

我的问题是,它似乎并没有线性的。在speedratio 2小青几乎4倍的速度(即40秒在10秒内打),并speedratio 0.5次几乎0.25X的速度(即10秒在40秒内打)。这是一个近似值,任何人都可以澄清?文档没有解释。

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.

此外,当在玩 Speed​​Ratio 比1X其他电影似乎抖动。我已经加入了显示影片中的位置的标签,这是非常明显的,它不流畅运行。是否有其他的解决方案来试试呢?

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?

我有XNA的经验,它可能提供更好的性能。但是,为了保持项目简单,我想保持完全基于WPF的项目。菜单系统是用WPF。

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.

推荐答案

根据这个 MSDN主题,在 Speed​​Ratio 是高度依赖于视频的codeC。我会假设你使用不支持流畅的快进或快退codeC。

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.