choirlessffmpegrunner

fluent-ffmpeg promise runner

Usage no npm install needed!

<script type="module">
  import choirlessffmpegrunner from 'https://cdn.skypack.dev/choirlessffmpegrunner';
</script>

README

ffmpegrunner

A tiny utility that turns a fluent-ffmpeg command into a Promise

Installing

npm install https://github.com/glynnbird/ffmpegrunner.git

Usage

const run = require('ffmegrunner').run
const ffmpeg = require('fluent-ffmpeg')

const main = async () => {
  const command = ffmpeg()
    .input('in.mp4')
    .output('out.jpg')
    .outputOptions(['-format singlejpeg', '-vframes 1'])
  await run(command)
}

main()

To send debug information to stderr, add true as a second parameter to run e.g

  await run(command, true)

To probe a file with ffprobe:

  const probe = require('ffmpegrunner').probe
  const results = await probe('myfile.mp4')