AVURLAsset should not require a file extension to work

Originator:tomas.znamenacek
Number:rdar://10892688 Date Originated:19-Feb-2012
Status:Open Resolved:
Product:iPhone SDK Product Version:5.0
Classification:Enhancement Reproducible:Always
 
Summary:

The AVURLAsset class currently requires a correct file extension in order to read the media file. For example, in order to read a video and do something with it, the file has to have a “mov” extension or another extension that describes the file type. This is an extra constrained forced on the users of the API. It would be great if the class worked even with files without extensions, the file format could be supplied using the already existing “options” dictionary.

Steps to Reproduce:

NSError *error = nil;
NSURL *fileURL = [NSURL fileURLWithPath:@"some_file_without_extension"];
AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:videoURL options:nil];
AVAssetImageGenerator *generator = [[AVAssetImageGenerator alloc] initWithAsset:asset];
CGImageRef imageHandle = [generator copyCGImageAtTime:kCMTimeZero actualTime:NULL error:&error];

Expected Results:

I get a non-NULL frame image of the asset.

Actual Results:

I get the following error:

Error Domain=AVFoundationErrorDomain Code=-11828 "Cannot Open" UserInfo=0x167170 {NSLocalizedFailureReason=This media format is not supported., NSUnderlyingError=0x163a00 "The operation couldn’t be completed. (OSStatus error -12847.)", NSLocalizedDescription=Cannot Open}

Notes:

There’s already an ”options” dictionary passed to the asset being created, that would be a perfect way to pass the file format information. The problem is also described here:

http://stackoverflow.com/questions/9290972

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!