Skip to content

damikdk/LottieExportDemo

Repository files navigation

LottieExportDemo

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.

What is happening

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.

What is the problem

We have AVAssetExportSession export implementation, but it works wrong because of lottie-ios architecture.

How our AVAssetExportSession works

We create AVMutableVideoComposition and add AnimationView.layer (CALayer) on it by AVVideoCompositionCoreAnimationTool. Then just export it with AVAssetExportSession:

layer.addSublayer(animationLayer)

What's wrong with it

Timings are broken for AVAssetExportSession and animation is much slower on result video.

More details

Why does it even run? (important)

I removed this line from AnimationView:

guard self.window != nil else { waitingToPlayAimation = true; return }

About

[BUG DEMO] Demonstration of AVAssetExportSession export NOT working correctly with lottie-ios

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published