1.0.0 • Published 3 years ago

choirlessffmpegrunner v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

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')