在播放期间调整AVPlayer帧速率 [英] Adjust AVPlayer Frame Rate During Playback

查看:174
本文介绍了在播放期间调整AVPlayer帧速率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法改变播放期间渲染帧的速率?我有几个简短的5秒视频,我想以15,30或60 FPS播放。这对用户来说是一个选项。

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. This would be an option to the user.

我确实在 frameDuration 属性> AVVideoComposition 类。但所有这一切都是调整每秒渲染的帧数。

I did find a frameDuration property in the AVVideoComposition class. But all this did was adjust how many frames rendered per second.

推荐答案

类似的问题这里

有一个房价AVPlayer。它对我很有用。速率值的范围从0到2,1,正常速度播放1,因此,为了让suer以预先定义的帧速率播放,需要一些数学来找到正确的速率值。

There is a rate property in the AVPlayer. 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.

再见,

Jean

这篇关于在播放期间调整AVPlayer帧速率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆