Yoav Y
Yoav Y

Reputation: 1

Is there an API that will run on iOS in order to change the Frame Per Second of an existing video?

I am looking for a way to receive as an input any video (that is supported on iOS) and save on the device a new video with a new Frame Per Second rate. The motivation is to decrease the video size, and as well make it as lite weighted as possible.

Expected a video with less Frame Per Second, each frame is in the same quality. Similar to a brief thumbnail summary of the video

Upvotes: 0

Views: 190

Answers (2)

Shakir Zareen
Shakir Zareen

Reputation: 240

Get MobileFFMpeg up and running: https://stackoverflow.com/a/59325680/1466453

Once you can make MobileFFMpeg calls in your IOS code then changing frame rate is pretty straightforward with this code:

[MobileFFmpeg execute: @"-i -filter:v fps=fps=30 "];

Upvotes: 0

Mick
Mick

Reputation: 25471

The type of conversion you are doing will be time and power consuming on a mobile device, but I am guessing you are already aware of that.

Given your end goal is to reduce size, while presumably maintaining a reasonable quality, you may find you want to experiment with different settings etc in the encodings.

For this type of video manipulation, ffmpeg is a good choice as you probably saw from your command line usage. To use ffmpeg from an application, a common approach is to use a well supported 'ffmpeg wrapper' - this effectively runs the Ffmpeg command line commands from wihtin your application.

The advantage is that all the usual syntax should work and you can leverage the vast amount of info on ffmpeg command line syntax on the web. The downsides are that ffmpeg was not not designed to be wrapped like this so you may see some issues, although with a well supported wrapper you should find either help or that others have already worked around the issues.

Some examples of popular iOS ffmpeg wrappers:

Upvotes: 1

Related Questions