ffmpeg-command
A simple ffmpeg and ffprobe child process handler, easy to add commands and execute
Installation
In order to be able to use this module, make sure you have FFmpeg installed on your system (including all necessary encoding libraries like libmp3lame or libx264).
npm i ffmpeg-command
Usage
ffmpeg
import FFmpegCmd from 'ffmpeg-command';
const ffmpegCmd = new FFmpegCmd({ loglevel: 'info', cwd: './video' });
ffmpegCmd.add(`-i example.mp4 -af volumedetect -vn -sn -dn -f null /dev/null`);
console.log(ffmpegCmd.cmd());
ffmpegCmd.exec().then((stdout) => {
console.log(stdout);
}).catch((err) => {
console.log(err);
});
ffprobe
import { ffprobe } from 'ffmpeg-command';
ffprobe('./video/example.mp4').then((json) => {
console.log(json);
}).catch((err) => {
console.log(err);
});