ios - Creating Thumbnail from Video - Improving Speed Performance via MPMoviePlayerController -


this code using. want generate thumbnail after create video via these thumbnail drawing done on "drawimage" uiimageview.

   while([self.thunbnailarray count])     {         id times = [self.thunbnailarray objectatindex:0];////self.thumbnailarray contains duratin of player @ thumbnail generate//////         [self.thunbnailarray removeobjectatindex:0];         uiimage* thumbnail = [player1 thumbnailimageattime:[times floatvalue]             timeoption:mpmovietimeoptionexact];          uigraphicsbeginimagecontext(drawimage.frame.size);////drawimage uiimageview make drawing         [drawimage.layer renderincontext:uigraphicsgetcurrentcontext()];         uiimage *viewimage = uigraphicsgetimagefromcurrentimagecontext();         uigraphicsendimagecontext();          cgimageref firstimageref = thumbnail.cgimage;/////merge thumbnail , drawing both         cgfloat firstwidth = cgimagegetwidth(firstimageref);         cgfloat firstheight = cgimagegetheight(firstimageref);         cgsize mergedsize = cgsizemake(firstwidth, firstheight);         uigraphicsbeginimagecontext(mergedsize);         [thumbnail drawinrect:cgrectmake(0, 0, firstwidth, firstheight)];         [viewimage drawinrect:cgrectmake(0, 0, firstwidth, firstheight)];         uiimage *newimage = uigraphicsgetimagefromcurrentimagecontext();         uigraphicsendimagecontext();         [self.imagearray addobject:newimage];///self.imagearray used generate video      } 


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -