简体   繁体   English

如何将视频转码为16:9格式并改变比特率(也许是FPS)?

[英]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. 假设我使用UIImagePickerController从照片库访问视频,然后我想以16x9格式(例如960x540,1280x720,1920x1080)导出它,但我还要控制比特率或每秒帧数或其他任何可以帮助减少导出视频的大小。 What API do I need to use to accomplish these (at least) two or three dimensions (aspect ratio, bit rate, perhaps FPS)? 我需要使用什么API来实现这些(至少)二维或三维(纵横比,比特率,可能是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). 我可以使用(我们已经在使用) AVAssetExportSession并且我们可以预设AVAssetExportPreset960x540AVAssetExportPreset1280x720AVAssetExportPreset1920x1080以获得16:9的宽高比(并且在某种程度上控制尺寸,因为每个产生不同大小的导出)。 But I don't think I can simultaneously control things like bit rate and FPS. 但我不认为我可以同时控制比特率和FPS等事情。 Do I have to go to aa different API? 我是否必须使用不同的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. 在一个相关的问题上,我看到AVAssetExportSession具有布尔属性shouldOptimizeForNetworkUse ,它“指示电影是否应该针对网络使用进行优化”。 What does this optimization consist of? 这种优化包括什么?

Have you ever tried using FFMPEG (Third Party library for this) 你有没有尝试过使用FFMPEG(第三方库)

http://ffmpeg.org/ http://ffmpeg.org/

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

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