How to transcode video to 16: 9 format and change bitrate (and, possibly, FPS)?

Let's say I access a video from a photo library using the UIImagePickerController , and then want to export it in 16x9 format (for example, 960x540, 1280x720, 1920x1080), but I also want to control the data transfer rate or frames per second, second or something else , which can help reduce the size of the exported video. Which API do I need to use to perform these (at least) two or three dimensions (aspect ratio, bit rate, possibly FPS)?

I can use (we already use) AVAssetExportSession and can we pre-set, for example, AVAssetExportPreset960x540 , AVAssetExportPreset1280x720 and AVAssetExportPreset1920x1080 to get a 16: 9 aspect ratio (and to some extent control the size of how different export returns are each). But I don’t think I can control things like bit rate and FPS at the same time. Should I switch to another API?

In a related question, I see that AVAssetExportSession has the logical property shouldOptimizeForNetworkUse , which "indicates whether the movie should be optimized for use on the network" or not. What is this optimization about?

+4
source share
1 answer

Have you ever tried using FFMPEG (third-party library for this)

http://ffmpeg.org/

0
source

All Articles