All Projects → transitive-bullshit → Puppeteer Lottie

transitive-bullshit / Puppeteer Lottie

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Puppeteer Lottie

puppeteer-lottie-cli
CLI for rendering Lottie animations via Puppeteer to image, GIF, or MP4.
Stars: ✭ 85 (-59.13%)
Mutual labels:  ffmpeg, lottie, puppeteer
Puppeteer Recorder
Record animations using puppeteer. Based on electron-recorder.
Stars: ✭ 169 (-18.75%)
Mutual labels:  ffmpeg, puppeteer
Gear360pano
Simple script to create equirectangular panorama by stitching images from Samsung Gear 360
Stars: ✭ 178 (-14.42%)
Mutual labels:  ffmpeg
Venom
Venom is the most complete javascript library for Whatsapp, 100% Open Source.
Stars: ✭ 3,457 (+1562.02%)
Mutual labels:  puppeteer
Giph
simple gif recorder
Stars: ✭ 193 (-7.21%)
Mutual labels:  ffmpeg
Jaffree
Java ffmpeg and ffprobe command-line wrapper
Stars: ✭ 184 (-11.54%)
Mutual labels:  ffmpeg
Puppeteer Recaptcha Solver
Recaptcha solver for puppeteer
Stars: ✭ 195 (-6.25%)
Mutual labels:  puppeteer
Autosubsync
Automatically synchronize subtitles with audio using machine learning
Stars: ✭ 179 (-13.94%)
Mutual labels:  ffmpeg
Puppeteer Extra
💯 Teach puppeteer new tricks through plugins.
Stars: ✭ 3,397 (+1533.17%)
Mutual labels:  puppeteer
Lottie Miniapp
lottie mniapp 小程序
Stars: ✭ 191 (-8.17%)
Mutual labels:  lottie
Root Cause
🔍 Root Cause is a tool for troubleshooting Puppeteer and Playwright tests. 🔎
Stars: ✭ 205 (-1.44%)
Mutual labels:  puppeteer
Phantomas
Headless Chromium-based web performance metrics collector and monitoring tool
Stars: ✭ 2,191 (+953.37%)
Mutual labels:  puppeteer
Weixinrecordeddemo
仿微信视频拍摄UI, 基于ffmpeg的视频录制编辑
Stars: ✭ 2,197 (+956.25%)
Mutual labels:  ffmpeg
Equa11y
A stream-lined command line tool for developers to easily run accessibility testing locally through axe-core and puppeteer.
Stars: ✭ 201 (-3.37%)
Mutual labels:  puppeteer
Chrome Aws Lambda
Chromium Binary for AWS Lambda and Google Cloud Functions
Stars: ✭ 2,502 (+1102.88%)
Mutual labels:  puppeteer
Thal
Getting started with Puppeteer and Chrome Headless for Web Scraping
Stars: ✭ 2,345 (+1027.4%)
Mutual labels:  puppeteer
Ae Element
🎨 use bodymovin to render some interesting After Effects vector element
Stars: ✭ 180 (-13.46%)
Mutual labels:  lottie
Headless Recorder
Chrome extension that records your browser interactions and generates a Playwright or Puppeteer script.
Stars: ✭ 13,786 (+6527.88%)
Mutual labels:  puppeteer
Jvppeteer
Headless Chrome For Java (Java 爬虫)
Stars: ✭ 193 (-7.21%)
Mutual labels:  puppeteer
Softest
Recording Browser Interactions And Generating Test Scripts.
Stars: ✭ 208 (+0%)
Mutual labels:  puppeteer

puppeteer-lottie

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

NPM Build Status JavaScript Style Guide

Logo

This module is also available as a CLI.

Install

npm install --save puppeteer-lottie

If you want to generate GIFs, you must also install gifski. On macOS, you can run:

brew install gifski

If you want to generate MP4s, you must also install ffmpeg. On macOS, you can run:

brew install ffmpeg

Usage

const renderLottie = require('puppeteer-lottie')

// Create an MP4 from a lottie animation
await renderLottie({
  path: 'fixtures/bodymovin.json',
  output: 'example.mp4'
})

// Create a GIF with width 640px from a lottie animation
await renderLottie({
  path: 'fixtures/bodymovin.json',
  output: 'example.gif',
  width: 640
})

// Render each frame of the animation as PNG images with height 128px
await renderLottie({
  path: 'fixtures/bodymovin.json',
  output: 'frame-%d.png', // sprintf format
  height: 128
})

// Render the first frame of the animation as a JPEG image
await renderLottie({
  path: 'fixtures/bodymovin.json',
  output: 'preview.jpg'
})

Output Size

If you don't pass width or height, the animation's intrinsic size will be used, and if that doesn't exist it will use 640x480.

If you pass width or height, the other dimension will be inferred by maintaining the original animation's aspect ratio.

If both width and height are passed, the output will have those dimensions, but there will be extra whitespace (or transparency if rendering PNGs) due to lottie-web's default rendererSettings.preserveAspectRatio of xMidyMid meet (docs and demo).

For mp4 outputs, the height may be different by a pixel due to the x264 encoder requiring even heights.

API

renderLottie

Renders the given Lottie animation via Puppeteer.

You must pass either path or animationData to specify the Lottie animation.

output must be one of the following:

  • An image to capture the first frame only (png or jpg)
  • An image pattern (eg. sprintf format 'frame-%d.png' or 'frame-%012d.jpg')
  • An mp4 video file (requires FFmpeg to be installed)
  • A GIF file (requires Gifski to be installed)

Type: function (opts): Promise

  • opts object Configuration options
    • opts.output string Path or pattern to store result
    • opts.animationData object? JSON exported animation data
    • opts.path string? Relative path to the JSON file containing animation data
    • opts.width number? Optional output width
    • opts.height number? Optional output height
    • opts.jpegQuality object JPEG quality for frames (does nothing if using png) (optional, default 90)
    • opts.quiet object Set to true to disable console output (optional, default false)
    • opts.deviceScaleFactor number Window device scale factor (optional, default 1)
    • opts.renderer string Which lottie-web renderer to use (optional, default 'svg')
    • opts.rendererSettings object? Optional lottie renderer settings
    • opts.puppeteerOptions object? Optional puppeteer launch settings
    • opts.ffmpegOptions object? Optional ffmpeg settings for crf, profileVideo and preset values
    • opts.gifskiOptions object? Optional gifski settings (only for GIF outputs)
    • opts.style object Optional JS CSS styles to apply to the animation container (optional, default {})
    • opts.inject object Optionally injects arbitrary string content into the head, style, or body elements. (optional, default {})
      • opts.inject.head string? Optionally injected into the document
      • opts.inject.style string? Optionally injected into a <style> tag within the document
      • opts.inject.body string? Optionally injected into the document
    • opts.browser object? Optional puppeteer instance to reuse

Compatibility

All lottie-web features should be fully supported by the svg, canvas, and html renderers.

This includes all of the animations on lottiefiles.com! 🔥

Also see Lottie's full list of supported features.

Related

License

MIT © Travis Fischer

Support my OSS work by following me on twitter twitter

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].