I am trying to extract multiple images from a selected video file using MPMoviePlayerController. Below is the code I wrote.
movie = [[MPMoviePlayerController alloc] initWithContentURL:[info objectForKey:UIImagePickerControllerMediaURL]]; NSNumber *time1 = [NSNumber numberWithInt:1]; NSNumber *time2 = [NSNumber numberWithInt:3]; NSNumber *time3 = [NSNumber numberWithInt:5]; NSArray *times = [NSArray arrayWithObjects:time1,time2,time3,nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleThumbnailImageRequestFinishNotification:) name:MPMoviePlayerThumbnailImageRequestDidFinishNotification object:movie]; [movie requestThumbnailImagesAtTimes:times timeOption:MPMovieTimeOptionExact];
Here is the notification handler
-(void)handleThumbnailImageRequestFinishNotification:(NSNotification*)note { NSDictionary *userinfo = [note userInfo]; NSError* value = [userinfo objectForKey:MPMoviePlayerThumbnailErrorKey]; if (value!=nil) { NSLog(@"Error: %@", [value debugDescription]); } else { _imageView.image = [userinfo valueForKey:MPMoviePlayerThumbnailImageKey]; } }
However, I get the following error message:
Error: Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x1d8a63d0 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1d8b7b50 "The operation couldn't be completed. (OSStatus error -12433.)", NSLocalizedFailureReason=An unknown error occurred (-12433)}
Does anyone know the description of the OSStatus error -12433? I tried to find documentation regarding OSStatus error codes, but was unsuccessful.
Any help would be greatly appreciated.
skmathu
source share