Render Lottie animations from Bodymovin using headless browser instance.
Basically a simpler transitive-bullshit/puppeteer-lottie rewrite but in GO and with the ability to render frames concurrently
Add the following import in your Go module
import "github.com/icyrogue/golottie"
Add the dependency explicitly if you need to
$ go get -u github.com/icyrogue/golottie
For examples checkout the go-reference and examples directory or just use the...
gollotie provides a simple experimental CLI to render animations localy. It renders frames by retrieving the SVG data and converting it to PNG using librsvg so install it first.
Note
Some package managers distribute the required rsvg-convert CLI separately
Install it with
$ go install github.com/icyrogue/golottie/cmd/golottie@latest
Usage of golottie:
-b --bufsize frame buffer size
(default: 16)
-c --count worker count (goroutines) to be created for concurrent rendering
(default: 1)
-h --height height of the output
(default: 1080)
-i --input input file name
-o --output output sprintf pattern
-q --quiet should I have a mouth to scream?
(default: false)
-w --width width of the output
(default: 1920)
This CLI is proof of concept that animation can be rendered by multiple concurrent workers specified by --count
option.
Note
The width and height have to be specified manually if differ from defaults.
Warning
Changes and optimizations are coming, use it if you dare!
The most obvious optimization is to use memory arena allocation strategy
Rust rewrite?
Released under the MIT License