简体   繁体   English

压缩视频,如iOS的相机胶卷

[英]Compress video like iOS's camera roll

Background: 背景:

I am recording a video and then uploading it. 我正在录制视频然后上传。

Problem: 问题:

I compressed the video using this solution (medium quality) but it doesn't: 我使用此解决方案压缩视频(中等质量),但它没有:

  • keep the original dimensions of the video 保留视频的原始尺寸
  • have as good a compression ratio as camera roll's. 具有与相机胶卷一样好的压缩比。

I need similar compression (size and dimensions) like camera roll. 我需要类似的压缩(尺寸和尺寸),如相机胶卷。 If it's not possible, do we have a workaround, say, automatically select the file from the iOS video picker (for upload)? 如果不可能,我们是否有解决方法,比如自动从iOS视频选择器中选择文件(用于上传)?

You can use AVAssetWriter and set custom compression settings. 您可以使用AVAssetWriter并设置自定义压缩设置。 You can even compress the video while you're recording so you don't have to re-process the video before upload. 您甚至可以在录制时压缩视频,这样您就无需在上传前重新处理视频。 Search around, there's tons of examples. 搜索,有很多例子。

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

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