MediaElement Speedratio not linear

邮差的信 提交于 2019-12-02 04:20:23

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6957742/mediaelement-speedratio-not-linear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!