fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.85k stars 874 forks source link

How to specify options for one of two raw inputs? #1082

Open alexgurr opened 3 years ago

alexgurr commented 3 years ago

Version information

Code to reproduce

 ffmpeg()
      .addInput('/Users/alexgurr/Desktop/recording.webm')
      .addInput('/Users/alexgurr/Desktop/recording.raw')
      .inputOptions(['-f s16le', '-ar 44100', '-ac 2'])
      .output('/Users/alexgurr/Desktop/recording.mp4')
      .on('end', function() {})
      .run();

recording.raw is raw audio.

Expected results

The raw audio is processed and merged with the video.

Observed results

Errors about input arguments.

In the terminal I can use ffmpeg -f s16le -ar 44100 -ac 2 -i recording.raw -ar 44100 -ac 2 out.wav to correctly process and convert the audio. How do I translate this command into node-fluent for the audio input only?

This collection of node-fluent commands works as expected without the inputOptions and when the audio is already encoded.