fluent-ffmpeg is a zero-dependency wrapper for ffmpeg that aims at simplifying its usage with Node.js.
fluent-ffmpeg is looking for new maintainers More details on the wiki
Make sure ffmpeg
is installed. You can set the FFMPEG_PATH
environment variable if it is not in your PATH
.
$ npm install fluent-ffmpeg
Note: this is the documentation for fluent-ffmpeg version 3. The API was completely rewritten. If you want to migrate from fluent-ffmpeg version 2, you will have to completely rewrite your calls.
import ffmpeg from 'fluent-ffmpeg'
async function convertVideo() {
try {
await ffmpeg({
input: 'path/to/input.avi',
output: 'path/to/output.mp4'
}).run()
console.log('Done')
} catch (e) {
console.log('Error:', e)
}
}