avisynth
Avisynth bindings for NodeJS with a strong focus on ease-of-use.
A node module that you can use to process videos, images and sound with Avisynth, in a self-contained package.
- No dependencies
- Top code quality
- 100% code coverage for all files down to branches and statements
It currently only works in Windows (like Avisynth itself), but it may be possible, in theory, to add Linux support via Wine.
install
npm install -g avisynth
usage
It can be used both by scripts as well as from command line (also not requiring Avisynth to be installed, and possibly helpful for shell scripts in other languages).
Node usage:
var avisynth = require('avisynth');
var script = new avisynth.Script();
script.code = 'Version()';
script.sharpen(1);
script.renderFrame('foo.png', function(err) {
console.log(err || 'foo.png saved!');
});
script.run(function(err) {});
script.lint(function(err) {});
Command-line usage:
avisynth-js info path/to/script.avs
avisynth-js lint path/to/script.avs
Sample output for info
:
{
"width": 1280,
"height": 720,
"ratio": "16:9",
"fps": 29.97,
"fpsFraction": "30000/1001",
"videoTime": 3600,
"frameCount": 107892,
"colorspace": "YV12",
"bitsPerPixel": 12,
"interlaceType": "field-based",
"fieldOrder": "TFF",
"channels": 2,
"bitsPerSample": 32,
"sampleType": "float",
"audioTime": 3600,
"samplingRate": 48000,
"sampleCount": 172799827,
"blockSize": 8
}
docs
At the moment I'm working on a Wiki so soon there'll be docs there.