-2

I'm using this code (thanks damikdk) to render lottie animation to video: https://github.com/damikdk/LottieExportDemo/blob/master/LottieExportDemo/ViewController.swift

I'm using the oldExport() in the previous file and these two methods (append and fill) to fill the pixelbuffer with the image: https://github.com/damikdk/LottieExportDemo/blob/master/LottieExportDemo/Helpers.swift

It works great on a iphone 5s and exports 30sec video in approximately 1min. But on a iPhone X it takes up to 10 min to export the same video with the same resolution settings. Is there a way to optimize this to work better on newer devices?

sold
  • 314
  • 1
  • 3
  • 11

1 Answers1

1

This repository was created as demonstration of bugs, you should not use it even as start point. Sorry if it's not obvious from description.

I am not sure what was wrong in your case, but I will check, if you share your code in issues.

  • Are there any working method to render Lottie as video? – orkenstein Apr 07 '21 at 20:43
  • 1
    @orkenstein nothing changed since this comment. You can export video frame by frame, but if you want to make it super fast or you are using heavy animations, lottie-ios is not an option – Damik Minnegalimov Apr 08 '21 at 10:31
  • Thanks! What's the key to the frame by frame approach? – orkenstein Apr 08 '21 at 12:46
  • 1
    @orkenstein try [this](https://github.com/damikdk/LottieExportDemo/blob/c3390aaba0e9b234d70402bf9cde75bdfe679fb8/LottieExportDemo/ViewController.swift#L169) method. 1. set correct progress for AnimationView 2. capture the view 3. write it with assetwriter 4. repeat – Damik Minnegalimov Apr 08 '21 at 14:35
  • 1
    @orkenstein Sorry I missed the link in first reply: "nothing has changed since [this comment](https://github.com/airbnb/lottie-ios/issues/30#issuecomment-531698005) – Damik Minnegalimov Apr 08 '21 at 14:43
  • Thank you! I'll check it out – orkenstein Apr 08 '21 at 15:33