Hi i want to create a thumbnail from my video, is 2.46 minutes long and 68 Mb. I used this code to create the thumbnail :
AVAsset *asset = [AVAsset assetWithURL:videoURL];
AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc]initWithAsset:asset];
CMTime time = [asset duration];
time.value = 0;
CGImageRef imageRef = [imageGenerator copyCGImageAtTime:time actualTime:NULL error:NULL];
UIImage *thumbnail = [UIImage imageWithCGImage:imageRef];
CGImageRelease(imageRef);
return thumbnail;
The issue is the thumbnail is always nil, but if i reduce the video length to 15 secs it will create the thumbnail. Can i create thumbnail for movie that more than 15 secs?
thanks