ffmpeg-wrap
A basic Node FFMpeg wrapper, easy to use, chainable ffmpeg cli generator and runner.
Usage
Install via NPM
npm install ffmpeg-wrap
Require in Node
var FFMpeg = FFMpeg;
Examples
Set FFMpeg Path, by default it uses whatever is in the path
FFMpeg
Basic Input/Output
Basic convert file.mov to file.mp4 using ffmpeg default settings
var command = ; // Returns a FfmpegComand Classvar input = commandinput'path/to/file.mov'; // Returns a FfmpegInput Classvar output = command // Returns a FfmpegOutput Classcommand;command;command; // Spawns the ffmpeg Command
This outputs and runs the ffmpeg command ffmpeg -i path/to/file.mov path/to/file.mp4
Convenience Methods
Both the FFMpegInput & FFMpegOutput classes have several convenience methods linked to the FFMpegCommand for chaining
(input, output, run, on, off, emit
). This allows the above example to be replaced with
input'path/to/file.mov';
Setting Input/Output Options
input'path/to/file.pcm' ;
Or any options can be passed as an object on the input call
input'path/to/file.pcm' format: 's16le' audioCodec: 'pcm_s16le' audioChannels: 2 audioFrequency: 48000;
This outputs the ffmpeg command ffmpeg -f s16le -c:a pcm_s16le -ac 2 -ar 48000 -i path/to/file.pcm