Demo project with Lottie-animation export with both AVAssetExportSession
and AVAssetWriter
. AVAssetWriter
works fine, but AVAssetExportSession
DOESN'T. We plan to use this method to export videos with any content inside: images, videos, animations and sound.
We have a Lottie-animations and we need to export it as video on iPhone. Our current AVAssetWriter implementation and frame-by-frame rendering is too slow, so we want to make it faster.
We have AVAssetExportSession
export implementation, but it works wrong because of lottie-ios architecture.
We create AVMutableVideoComposition
and add AnimationView.layer
(CALayer
) on it by AVVideoCompositionCoreAnimationTool
. Then just export it with AVAssetExportSession
:
Timings are broken for AVAssetExportSession
and animation is much slower on result video.
- This repo: https://github.com/damikdk/LottieExportDemo
- Main thread: airbnb/lottie-ios#30
- Our last commentary in it: airbnb/lottie-ios#30 (comment)
- Main issue with feature request: airbnb/lottie-ios#1001
I removed this line from AnimationView
:
guard self.window != nil else { waitingToPlayAimation = true; return }