How iOS creates a video thumbnail image
//writes the complete picture and the thumbnail image to the Temp folder
nsdata *pngimage = uiimagepngrepresentation (thumbnail) ;
if ([pngimage writetofile:[nsstring stringwithformat:@ "%@/tempimage.png", Temp_folder] atomically: yes]) {
UIImage *mythumbnail = [[UIImage alloc] initwithdata:pngimage];
Uigraphicsbeginimagecontext (Cgsizemake (60.0, 60.0));
[Mythumbnail Drawinrect:cgrectmake (0.0, 0.0, 60.0, 60.0)];
UIImage *newimage = Uigraphicsgetimagefromcurrentimagecontext ();
Uigraphicsendimagecontext ();
Uiimageview *thumbview = [[Uiimageview alloc] Initwithframe:cgrectmake (0.0, 0.0, 60.0, 60.0)];
Thumbview.image = NewImage;
[Self.view Addsubview:thumbview];
NSData *thumbdata = uiimagepngrepresentation (newimage);
if ([Thumbdata writetofile:[nsstring stringWithFormat:@ "%@/tempimagethumb.png"] atomically:YES]) {
NSLog (@ "thumb written!");
}
}
Video images can be captured from the video
_movieplayer = [[MPMoviePlayerController alloc]initwithcontenturl: Movieurl];
UIImage *thumbnail = [_movieplayerthumbnailimageattime:1.0 timeoption: Mpmovietimeoptionnearestkeyframe
How iOS creates a video thumbnail image