A CLI tool to generate a video for a Sunniesnow chart.
First, install FFmpeg (6.1 or later) and Node.js (20.6 or later).
Note
The version of FFmpeg must not be 6.0 because of a known bug in that version.
The version of Node.js most not be between 20.0 and 20.5 (inclusive) because of a known bug in those versions.
Then, run the following command:
npm install -g sunniesnow-record
Run the following command to get help:
sunniesnow-record --help
Here is a usage example:
sunniesnow-record --level-file online --level-file-online sunniesnow-sample --output test.mkv
There is also a command to generate a cover image:
sunniesnow-cover-gen --help
You can also use the Docker image to run this tool. To do this, run the following command:
docker run -v ./output:/data -i -t ulysseszhan/sunniesnow-record --level-file online --level-file-online sunniesnow-sample
This command will generate a video at output/output.mkv
.
Note that you can use the Docker image if there are issues that you cannot resolve.
[email protected]: Permission denied (publickey)
You need to generate an SSH keypair:
ssh-keygen
If only English characters are rendered incorrectly, this is due to a bug in node-canvas. To work around this, rebuild node-canvas from source:
env --chdir=$(npm root -g)/sunniesnow-record npm rebuild canvas --build-from-source
For other font rendering issues, you can also try rebuilding node-canvas from source. However, sometimes the issues are hard to fix. It is known that the font rendering behaviors are different for different versions of pangocairo and other dependencies.
You may see an error message about ModuleNotFoundError: No module named 'distutils'
reported by node-gyp.
This happens when your Python version is 3.12 or later. You need to run
pip install setuptools
Replace pip
with python3 -m pip
if necessary.
If you see error messages about canvas.node
or webgl.node
,
you may need to rebuild the native modules.
To do this, install the following dependencies first:
apt install build-essential pkg-config libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev libxi-dev libglu1-mesa-dev libglew-dev
and then run the following command (it may take several minutes):
env --chdir=$(npm root -g)/sunniesnow-record npm rebuild canvas gl --build-from-source
If you have troubles building them, see development instructions for headless-gl and compiling instructions for node-canvas.
If you installed this package from Git source (e.g. npm i github:sunniesnow/sunniesnow-record
),
you may see an error message like this when using this package:
Error: ENOENT: no such file or directory, open '.../node_modules/sunniesnow-record/game/js/utils/Utils.js'
This is due to an npm bug. To work around this, clone this repo recursively, and use the local file system as the package source.
Known bug in FFmpeg 6.0. Use FFmpeg 6.1 or later.
This may happen when the background or avatar is an SVG. This is a known issue caused by a bug and another bug. To work around this, use another image format.