AVURLAsset Not Loading (.mov file)

守給你的承諾、 提交于 2019-12-10 14:51:40

问题


I am attempting to load a file called output.mov (created on the iPhone) as an AVURLAsset using the following code:

NSURL *outputURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@%@", NSTemporaryDirectory(), @"output.mov"]];

AVURLAsset *videoAsset = [AVURLAsset URLAssetWithURL:outputURL options:nil];

The file is located in the tmp directory of the app. No errors appear, but it seems that the asset is not loaded as no metadata is available (i.e. calling NSLog(@"%@", [videoAsset commonMetadata]) returns nothing) so I can't do anything with the asset.

I have used the following code to ensure that the resource is reachable via the URL, and it definitely seems to be:

if ([outputURL checkResourceIsReachableAndReturnError:&err] == NO)
        NSLog(@"Not reachable!");

so I am unsure why the asset is not loading. I have also tried loading the asset using [AVAsset assetWithURL:] but that also doesn't work.

Any help would be greatly appreciated.

来源:https://stackoverflow.com/questions/15447579/avurlasset-not-loading-mov-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!