0

I am implementing one iPhone photo/Video application in which I have tried to implement below functionality.

Capture video through camera & convert in to GIF image

I have tried to googling but not got successed.

Can any one suggest me or advice me how to achive this feature?

Thanks in advance

Kirby Todd
  • 11,254
  • 3
  • 32
  • 60
ManthanDalal
  • 1,063
  • 2
  • 20
  • 45

2 Answers2

0

Add

#import <MediaPlayer/MediaPlayer.h>
#import <MobileCoreServices/UTCoreTypes.h>

and use following delegate method of UIImagePickerViewController

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
   if ([[info objectForKey:UIImagePickerControllerMediaType ] isEqualToString:@"public.movie"])
   {
     MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[info objectForKey:UIImagePickerControllerMediaURL];];
        UIImage  *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
        [player stop];
        player = nil;

     // Here your got UIImage name is 'thumbnail'
   }
}

You can get image (thumbnail) from video.

iPatel
  • 46,010
  • 16
  • 115
  • 137
0

Though this question is old, I created a library for converting videos to gifs for iOS.

matthewpalmer
  • 2,619
  • 3
  • 25
  • 27