eugeneware / ffmpeg-static

ffmpeg static binaries for Mac OSX and Linux and Windows
GNU General Public License v3.0
1.11k stars 182 forks source link

When can the `ffmpegPath` be `null`? #118

Closed leafac closed 1 year ago

leafac commented 1 year ago

The type for ffmpegPath says that it can be null.

When would this happen?

If, for example, ffmpeg-static can’t find a suitable binary, shouldn’t it fail to install in the first place?

And if that’s the case, are you interested in a pull request in which I remove the null from the type?

Thanks!


Edit: For the time being I’m doing the following awkward gymnastics:

import assert from "node:assert/strict";
import maybeFFmpeg from "ffmpeg-static";
assert.equal(typeof maybeFFmpeg, "string");
const ffmpeg = maybeFFmpeg as unknown as string;
derhuerst commented 1 year ago

ffmpegPath can be null if the platform is not supported:

https://github.com/eugeneware/ffmpeg-static/blob/a43ff37b26dac78a0512575ee0ad8911d3168dc8/index.js#L31-L33

derhuerst commented 1 year ago

Please re-open if you have more questions related to this.