OC Code Snippet #1- Create GIF Image From Movie Asset

WHAT WE NEED:

  1. UIImage+animatedGIF (UIImage category for GIF Displaying)
  2. Movie assets to convert

GET STARTED

Basic thinking for create GIF Image from movie assets is to create thumbnails of the movie at specified time spots and put then together at the end.

Key Selector:

This selector in AVAssetImageGenerator can “take screenshot” at requested time of associated movie and out put it as a CGImage.

Complete Code:

UIImage+GIFFromMovie.h:

UIImage+GIFFromMovie.m:

 

 

Leave a Reply