0.13.0 • Published 2 years ago

pellicola v0.13.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
2 years ago

pellicola

npm version node Build Status Coverage Status Known Vulnerabilities Typed with TypeScript

Generate video files from <canvas> animations in Node.js

Installation

npm install --save pellicola

Usage

This package provides a lightweight framework for generating animations with node-canvas and saving them as video files using ffmpeg.

const pellicola = require('pellicola')

function myAnimation () {
  // provide a function to draw video frames
  return function ({ context, width, height, playhead }) {
    context.fillStyle = '#0f0'
    context.fillRect(0, 0, width * playhead, height)
  }
}

const settings = {
  dimensions: [640, 360],   // video will be 640px wide by 360px tall
  duration: 2,              // video will last 2 seconds
  filename: 'my-sketch.mp4' // set custom filename for output video
}

pellicola(myAnimation, settings)
  .then(path => console.log('Done saving video file to:', path))
  // => Done saving video file to: /path/to/current-dir/my-sketch.mp4

Conceptually, pellicola uses the idea of the “sketch” that can be found in Processing and its Javascript cousin p5.js. The API tries to follow Matt DesLauriers’s canvas-sketch framework, which provides excellent tools for working on generative art with <canvas> in the web browser. The aim is to permit a sketch function developed using canvas-sketch to be re-used with pellicola with minimal adaptation.

For more details, see the Documentation →

License

pellicola is distributed under the GNU General Public License v3.0.

0.13.0

2 years ago

0.12.0

3 years ago

0.11.6

3 years ago

0.11.4

3 years ago

0.11.5

3 years ago

0.11.3

4 years ago

0.11.2

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.2

4 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago