Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface FFmpegCommand

Hierarchy

  • FFmpegCommand

Index

Methods

args

  • args(...args: string[]): this
  • Add arguments, they will be placed before any input or output arguments.

    Parameters

    • Rest ...args: string[]

      -

    Returns this

concat

getArgs

  • getArgs(): string[]
  • Returns all the arguments with which ffmpeg will be spawned.

    Returns string[]

input

  • Adds an input to the conversion.

    example
    const cmd = ffmpeg();
    cmd.input('input.avi');
    cmd.input(fs.createReadStream('input2.avi'));
    cmd.output();
    const process = await cmd.spawn();
    await process.complete();

    Parameters

    Returns FFmpegInput

output

  • Adds an output to the conversion, multiple destinations are supported using the tee protocol. You can use mixed destinations and multiple streams. Both NodeJS WritableStreams and AsyncGenerators are fully supported.

    example
    const cmd = ffmpeg();
    cmd.input('input.avi');
    cmd.output(fs.createWriteStream('dest1.mkv'), 'dest2.mkv');
    const process = await cmd.spawn();
    await process.complete();

    Parameters

    • Rest ...destinations: OutputDestination[]

      A sequence of OutputDestinations to which the output will be written. If no destinations are specified the conversion will run, but any output data will be ignored.

    Returns FFmpegOutput

spawn

  • Starts the conversion, this method is asynchronous so it must be await'ed.

    example
    const cmd = ffmpeg();
    cmd.input('input.avi');
    cmd.output('output.mp4');
    const process = await cmd.spawn();

    Parameters

    Returns Promise<FFmpegProcess>