简体   繁体   English

如何使用UIImagePickerController或其他替代方法访问原始视频?

[英]How to access the original video using UIImagePickerController or other alternative methods?

I notice that the Dropbox iOS app allows you to set the Upload Quality for uploaded videos (Settings > Upload Quality > Video Quality > Original | High | Medium | Low). 我注意到,Dropbox iOS应用允许您设置上传视频的上传质量(设置>上传质量>视频质量>原始|高|中|低)。 I am curious how apps like this get access to the video at the "original" quality. 我很好奇这样的应用程序如何以“原始”质量访问视频。 Our apps are using the UIImagePickerController videoQuality property with the low, medium and high settings (UIImagePickerControllerQualityTypeLow/Medium/High) but when using these, the picker controller shows "compressing video" and the result is not the original video. 我们的应用程序使用具有低,中和高设置(UIImagePickerControllerQualityTypeLow / Medium / High)的UIImagePickerController videoQuality属性,但是使用这些属性时,选择器控制器显示“正在压缩视频”,并且结果不是原始视频。

Perhaps getting access to the original is not possible using the UIImagePickerController and we have to switch to another method? 也许使用UIImagePickerController无法访问原始图像,而我们必须切换到另一种方法?

I do see related question Do not compress video when I select a video but there are no answers to that one. 我确实看到了相关的问题, 当我选择一个视频但没有答案时, 不要压缩视频

Any suggestions on getting access to the original video would be appreciated. 关于访问原始视频的任何建议将不胜感激。

In the delegate's didFinishPickingMediaWithInfo, extract the original url from the info dictionary using the key UIImagePickerControllerReferenceURL, which can be passed to an AVURLAsset. 在委托的didFinishPickingMediaWithInfo中,使用键UIImagePickerControllerReferenceURL从信息字典中提取原始URL,该URL可以传递给AVURLAsset。

- (void)imagePickerController:(UIImagePickerController *)aPicker didFinishPickingMediaWithInfo:(NSDictionary *)info { 
{
    NSString* origAssetUrl = [info objectForKey:UIImagePickerControllerReferenceURL];
}

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

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