Reputation: 1723
I am trying to display thumbnail images for the downloaded videos in one of my apps. I have shown the images along with the video title inside a table view. I'm using this code for getting the image:
NSURL *videoURL = [NSURL fileURLWithPath:myString];
MPMoviePlayerController *player = [[MPMoviePlayerController alloc]
initWithContentURL:videoURL];
UIImage *thumbnail =
[player thumbnailImageAtTime:1.0
timeOption:MPMovieTimeOptionNearestKeyFrame];
cell.imageView.image = thumbnail;`
Images are showing for the files that are downloaded from YouTube, but I'm not getting the images from .flv video files. Can anyone suggest a solution? This is a sample of my video path
/Users/admin/Library/Application Support/iPhone Simulator/5.0/Applications/AA8DDEED-E91C-47BB-8F1E-C057D9E94B7C/Documents/downloads/qkycmzafawmk.flv
Upvotes: 2
Views: 3067
Reputation: 1723
This is the tutorial i have followed to solve this issue.Hope this may help someone: http://www.codza.com/extracting-frames-from-movies-on-iphone.
Upvotes: 0
Reputation: 8323
What is the value of thumbnail
after the call to -thumbnailImageAtTime:timeOption:
? Assuming that this UIImage
is not nil
, have you checked its alpha
property?
If thumbnail
is nil
, have you checked into the numerous other SO questions regarding this? Here are a couple to get you started:
Upvotes: 1