lottie-ios
lottie-ios copied to clipboard
Add support for video Export usage
I can export animation with video but the problem is animation speed is variable in different device while exporting .the animation is actually not rendered correctly depending on device etc.The animation timespace is not linked to the video timespace . Any suggestion for this issue ?
I got the same issue. The faster device the slower animation.
In my case animation looks perfect on iPhone 6 with animationView.respectAnimationFrameRate = true
. Any other device (XR, iPad Pro, iPhone 7/8) records it much slower.
According this question (4 years ago, btw), I decide to hardcode constants for each device for now :(
@damikdk Thanks for the reply . How to set the hardcore constants for each device , I mean what constants i need to add to match the video timing ? Btw i am using version 2.5.3
I am using version 2.5.3 and project is in objective C . Can't find this functions . which version are you using ?
@tawhidkuet04 I use last one and Swift, sorry. It doesn't matter, because even my awful code above can't save us. Because current export depends on both device AND animation.
It will be super useful if somebody point us to some CoreAnimation primitive that we can use for export with AVVideoCompositionCoreAnimationTool
and AVAssetExportSession
. Doesn't matter public or private, we can fork and get it.
This setup can export animation, but I got the same problems @spykr describe in #30
let animationView = AnimationView()
animationView.animation = Animation()
let animationLayer = animationView.layer
animationLayer.repeatCount = .greatestFiniteMagnitude
animationLayer.beginTime = AVCoreAnimationBeginTimeAtZero
animationLayer.frame = CGRect(x:0, y:0, width: 50, height: 50)
parentLayer.addSublayer(animationLayer)
animationView.play()
But animation renders in result video, albeit wrong. So there is some logic above native primitives. I just started digging, but help is super welcome.
UPD: Demo repo
Adding to feature requests
Hello there. I ran into this problem. Has anyone solved it? Or can @buba447 tell a deadline for when it will be implemented?
+1
Ran into the same problem.
Please help us.
Is this problem solved yet?
Just curious, why are folks interested in exporting Lottie animations to video files?
Thanks all for the suggestion. We don't plan on adding support for video exports at this time. This seems like something that could be made available as a separate library on top of this one.