eugeneware / eugeneware/ffmpeg-static
Misleading undocumented use of env var FFMPEG_BIN
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 204
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for maintaining this library, it helps a lot to bring FFmpeg where no system install is available!
A small "anti-feature" request, which might be seen as a bug, follows:
## Use case
I wrote my code such that it will try to load an FFmpeg program if it was supplied by the user with the env var `FFMPEG_BIN`. The code checks in case the user made a mistake and provided a path that doesn't exist, or is not an executable file, then a fallback is obtained from `"ffmpeg-static"`.
Imagine my surprise when `"ffmpeg-static"` points to the same path than the one provided by the user.
Then of course the mystery gets solved when checking [the source code](https://github.com/eugeneware/ffmpeg-static/blob/e546e43fe45fe1d4d2949a15c47bcca6e1eecbc1/index.js#L3-L5) and this is found:
```js
if (process.env.FFMPEG_BIN) {
module.exports = process.env.FFMPEG_BIN
}
```
## What's wrong
The bug report here that this is an unexpected behavior (and a totally undocumented one, too). `"ffmpeg-static"` has only one intended job and that is to bring a static build of Fmpeg; providing alternative builds or paths should be left for the application.
## What's expected
`"ffmpeg-static"` promises to bring a working FFmpeg binary, and does it well. This is also what docs in README and NPM talk about, which is quite reasonable job to expect from this library. Hijacking other env vars to provide additional search paths is arguably out of scope for this lib, and has unexpected consequences for higher-level code that might have fallback mechanisms in place.
Thanks and have a good day.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.