Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我很震惊这样一个常见的问题有这么少的帖子/教程!(自己google一下看看)
输入:视频网址(可能来自照片库。)输出:视频网址(压缩,低质量)
我发现的所有解决方案要么太旧/在 Obj C 中/甚至是错误的!
谢谢你花时间帮助我:)
我在这里找到了一个非常有用的帖子:
https://medium.com/samkirkiles/swift-using-avassetwriter-to-compress-video-files-for-network-transfer-4dcc7b4288c5
使用的版本是 swift 3,但 xcode 可以解决所有问题。
但它只压缩 .mov 文件,这没关系,因为这是苹果(iPhone、Mac 等)使用的格式
希望能帮助到你。
(调整压缩程度,将比特率乘以某个常数)