WHAT WE NEED:
- UIImage+animatedGIF (UIImage category for GIF Displaying)
- Movie assets to convert
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.
- (CGImageRef _Nullable)copyCGImageAtTime:(CMTime)requestedTime actualTime:(CMTime * _Nullable)actualTime error:(NSError * _Nullable * _Nullable)outError
This selector in AVAssetImageGenerator can “take screenshot” at requested time of associated movie and out put it as a CGImage.