transitive-bullshit / puppeteer-lottie

Renders Lottie animations via Puppeteer to image, GIF, or MP4.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to improve rendering speed

Siddhar109 opened this issue · comments

My lottie has 300 frames which plays at 30fps. The render resolution is 1920x1080. It took around 150 sec to render into png sequence. But if i added a background image to the json file, the render time shot up to 500 sec.
I was wondering what is botelnecking the system and is there any way to optimize puppeteer-lottie rendering speed even if i have to sacrifice on render quality or is multi-processing an option

I find ffmpeg very fast to overlay the png sequence over a video (or background image). Not sure if that is an option but works well for me.

Can you give some more information about the environment you're running in? OS, RAM, Node.js version, etc?

What is the exact command or invocation you're using?

I am running on cloud server, with 2 CPU and 4Gb ram on Ubuntu 18 and Node version 10.x.
So i figured rendering frames into jpeg sequence works better for my use case also reduces the render time quite a lot but adding more compute resource doesn't yield better result.

Here is my code snippet -

renderLottie({
    path: "data.json",
    output: `tmp/%03d.jpg`,
    height: 1080,
    jpegQuality: 70,
    puppeteerOptions: { args: ["--no-sandbox", "--disable-setuid-sandbox"] }
  })

the same problem, render mp4 very slow, how to fix it?