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.