简体   繁体   中英

How to transcode a video to 16:9 format and vary the bit rate (and perhaps FPS)?

Say I access a video from the photo library using UIImagePickerController and then I want to export it in a 16x9 format (eg 960x540, 1280x720, 1920x1080), but I want also to control the bit rate or frames-per-second or anything else that can help reduce the size of the exported video. What API do I need to use to accomplish these (at least) two or three dimensions (aspect ratio, bit rate, perhaps FPS)?

I can use (we already are using) AVAssetExportSession and could us presets like AVAssetExportPreset960x540 , AVAssetExportPreset1280x720 and AVAssetExportPreset1920x1080 to get the 16:9 aspect ratio (and to some degree to control the size as each of these yields differently sized exports). But I don't think I can simultaneously control things like bit rate and FPS. Do I have to go to aa different API?

On a related question, I see that AVAssetExportSession has the boolean property shouldOptimizeForNetworkUse which "indicates whether the movie should be optimized for network use" or not. What does this optimization consist of?

Have you ever tried using FFMPEG (Third Party library for this)

http://ffmpeg.org/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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