Note that there are some explanatory texts on larger screens.

plurals
  1. PONot Able to Generate Thumbnail Image from the Recorded Video
    text
    copied!<p>I am Generating the thumbnail from the recorded video which is stored in the documents directory that video can't not be more than to the 1 minute. till the recording time everything works properly.as i try to generate the thumbnail from that recorded video got nothing.i have used the two way for the same </p> <ul> <li><p><strong>By using the MPMoviePlayerController</strong></p> <pre><code>-(void)generateThumbnail:(NSURL*)assetURL{ if(assetURL){ MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:assetURL]; UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame]; //AT THIS POINT AS I CHECK IT THIS thumbnail contains 0X000000 player = nil; if (thumbnail) { //will use that image to further } else { //here wil doing some intimation } } } </code></pre> <p>As Above method finish with the execution got these logs</p> <p>Autoplay: Enabling autoplay Autoplay: Likely to keep up or full buffer: 0 [MPAVController] Autoplay: Skipping autoplay, not enough buffered to keep up. [MPAVController] Autoplay: Enabling autoplay [MPAVController] Autoplay: Enabling autoplay [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player: 1) [MPAVController] Autoplay: Enabling autoplay[MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 0, on player:1)</p></li> <li><p><strong>By using AVAssetImageGenerator</strong></p> <pre><code> -(void)genrateThumbnailImageFromAsset:(AVAsset*)_assetObject size:(CGSize)size forTime:(CMTime)thumbTime { __weak typeof(self) wself = self; __block UIImage * thumbNailImage = nil; AVAssetImageGenerator *generator = [[AVAssetImageGenerator alloc] initWithAsset:_assetObject]; generator.appliesPreferredTrackTransform=TRUE; AVAssetImageGeneratorCompletionHandler handler = ^(CMTime requestedTime, CGImageRef im, CMTime actualTime, AVAssetImageGeneratorResult result, NSError *error) { switch (result) { case AVAssetImageGeneratorSucceeded:{ /*get the generated image*/ thumbNailImage=[UIImage imageWithCGImage:im]; // We finished updating the image. Set the visual UI button to the uploaded image if (thumbNailImage) { //using accordingly } else { //using accordingly } } break; case AVAssetImageGeneratorFailed:{ //using accordingly NSLog(@"%@",[error localizedDescription]); } break; case AVAssetImageGeneratorCancelled:{ //using accordingly NSLog(@"%@",[error localizedDescription]); } break; default: break; } }; generator.maximumSize = size; [generator generateCGImagesAsynchronouslyForTimes:[NSArray arrayWithObject:[NSValue valueWithCMTime:thumbTime]] completionHandler:handler]; } </code></pre></li> </ul> <p>By Above got nothing .... still looking for the same.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload