Skip to content

PotatoParser/ffmpeg-cli

Repository files navigation

ffmpeg-cli

Build Status Node LTS Node v10

A simple way of implementing FFmpeg regardless of OS

const ffmpeg = require("ffmpeg-cli");
ffmpeg.run("-version");
console.log(ffmpeg.runSync("-version"));

Hassle Free!

No need to install other programs as ffmpeg-cli will download and extract necessary binaries for your OS!

Supported OS

  • MacOS ~ 64 bit
  • Linux ~ 32/64 bit
  • Windows ~ 32/64 bit

FFmpeg Path

Returns the path of FFmpeg executable

ffmpeg.path;
// Ex: C:\Users\PotatoParser\Desktop\NodeJS\ffmpeg-cli\ffmpeg\win32x64\bin\ffmpeg.exe

Synchronous Commands

Returns the output from FFmpeg

ffmpeg.runSync(commands);
// Ex: ffmpeg.runSync(`-i input.jpg -vf scale=320:240 output.png`);

Asynchronous Commands

Returns a Promise

ffmpeg.run(commands);
ffmpeg.run(commands).catch((error)=>{...}); // Catch errors
ffmpeg.run(commands).then((result)=>{...}); // Only results
ffmpeg.run(commands).then((result)=>{...}).catch((error)=>{...}); // Catches when errors found

FFmpeg Force Re-Download

Run to redownload (synchronously) ffmpeg files Returns true if download is successful

ffmpeg.forceDownload();

FFmpeg Documentation

FFmpeg's Official Documentation