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,070
  • 3
  • 31
  • 58
ManthanDalal
  • 1,065
  • 2
  • 20
  • 44

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
  • 43,583
  • 14
  • 113
  • 135
0

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

matthewpalmer
  • 2,609
  • 3
  • 24
  • 27