简体   繁体   English

在播放期间调整AVPlayer帧速率

[英]Adjust AVPlayer Frame Rate During Playback

Is there a way to change the rate at which frames are rendered during playback? 有没有办法改变播放期间渲染帧的速率? I have a couple short 5 second videos that I would like to play at 15, 30, or 60 FPS. 我有几个简短的5秒视频,我想以15,30或60 FPS播放。 This would be an option to the user. 这将是用户的选项。

I did find a frameDuration property in the AVVideoComposition class. 我确实在AVVideoComposition类中找到了frameDuration属性。 But all this did was adjust how many frames rendered per second. 但所有这一切都是调整每秒渲染的帧数。

Similar question here 类似的问题在这里

There is a rate property in the AVPlayer. AVPlayer中有一个rate属性。 It worked very well from me. 它对我很有用。 Tho the rate values ranges from 0 to 2, 1 being played at normal speed, so to give the option to the suer to play at pre defined framerate would required some math to find the right rate value. 速率值的范围从0到2,1,正常速度播放1,因此,为了让suer以预定义的帧速率播放,需要一些数学来找到正确的速率值。

Bye, 再见,

Jean 吉恩

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM