fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document how to set input options when using ffprobe

Endain opened this issue · comments

I needed to probe a remote video that required authorization, but ffprobe would not respect the input options I was passing. It turns out that ffprobe does not receive any of the input options set up in the command, instead, you must pass them in the ffprobe() call.

For example, if you do this:

const cmd = ffmpeg();
cmd.input(url);
cmd.inputOption([`-headers`, `Authorization: Bearer ${some_token}`]);
cmd.ffprobe((err, data) => { ... });

Then the code will silently ignore anything you have set using inputOption();

What you must do instead is pass your additional options as a parameter to the ffprobe() call. This will do what I originally intended:

const cmd = ffmpeg();
cmd.input(url);
cmd.ffprobe([`-headers`, `Authorization: Bearer ${some_token}`], (err, data) => { ... });

I could not find this difference in behavior documented anywhere in the docs. It would be nice if the documentation could be updated, or if our options were forwarded to the probe command.