Compile story-json documents into videos
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
test
.eslintrc
.gitignore
LICENSE
README.md
package-lock.json
package.json

README.md

story-json-to-video

Compile story-json documents into videos.

Note: Not all features of story-json format are supported at the moment. Open an issue if you need something that isn't supported yet. PRs are always welcome too.

Installation

This package requires node.js version 8 or later.

This package uses ffmpeg to process videos, which needs to be installed in your PATH directory.

This package depends on node-canvas, which requires Cairo, Pango, libpng, libjpeg, giflib and librsvg to be installed on the system. librsvg is optional for svg rendering. See https://github.com/Automattic/node-canvas#installation.

Example for macOS:

brew install ffmpeg
brew install pkg-config cairo pango libpng jpeg giflib librsvg
PKG_CONFIG_PATH=/usr/local/opt/zlib/lib/pkgconfig npm install story-json-to-video -g

This package also depends on yoga, targeting the node.js platform:

npm config set yoga-layout:platform node -g

Remove -g from the commands if you're cloning and installing this module locally.

Usage

To compile story.json into video, run:

story-json-to-video story.json

If everything works, the program will create story.mp4 in the same directory.

To list additional options:

story-json-to-video --help

Options

Use --font option to provide custom fonts, e.g. --font MyFont=./my-font.otf.

This uses registerFont from node-canvas.

License

MIT