Open nixnoughtnothing opened 8 years ago
Currently, there is no support for importing and playing animated GIFs.
I have the same problem as well - would be great if gifs are supported!
Currently I am using a little work around to achieve the animation effect:
Manually set the next frame image in the setFrameProcessingCompletionBlock
.
Like this:
self.frameNum = 1;
__unsafe_unretained GPUImageUIElement *weakUIElementInput = self.element;
[filter setFrameProcessingCompletionBlock:^(GPUImageOutput *output, CMTime time) {
// set next frame image to fake animation
[self.animationImageView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"image_%d.png", self.frameNum]]];
// determine next frame number
if (self.frameNum == 10){
self.frameNum = 1;
} else {
self.frameNum = self.frameNum + 1;
}
[weakUIElementInput update];
}];
One drawback of this method is that you can't control the speed of animation.
@BradLarson which means the property animationImages
of UIImageView
is unavailable also?
@porridgec I tried but didn't work
Use AVVideoCompositionCoreAnimationTool to export CAKeyFrameAnimation with keypath contents.
https://www.raywenderlich.com/2734-avfoundation-tutorial-adding-overlays-and-animations-to-videos
Hi there!
I use GPUImageVideoCamera with blend filters (e.g. GPUImageDissolveBlendFilter) and it works pretty well with an image but Is there a way to blend an animated gif and a video?
Any advice and suggestions will be greatly appreciated.