Current Situation
Most of the operations performed via the JavaScript interface are provided through N-API binaries, so the installation of the ffmpeg CLI, which runs during the postinstall script, should arguably be optional. Since this download adds ~50MB to the total download size (~150MB when unzipped), it is a step that should be avoided if you don't intend to use node-av/ffmpeg (direct CLI access) at all.
Proposed Solution
Currently, this installation step can be skipped by setting the SKIP_FFMPEG environment variable; however, specifying this variable during every installation is not practical. Also, this environment variable is not mentioned in the documentation, and judging by the commit message (063f516) , it appears to have been added for internal use (for CI).
I haven't come up with the best or most elegant solution for this either, but for example:
- Separate the downloading of the ffmpeg binary into a separate command so it doesn't run by default (similar to how Playwright handles browser installation - run
npx node-av install-cli or similar to fetch cli binary after install).
- Completely separate the package used to access the ffmpeg CLI (e.g., changing
node-av/ffmpeg to node-av-ffmpeg).
Both of these would be breaking changes, so if there is a good approach, that would be much better.
API Level
Low-Level API
Alternative Solutions
- Use
SKIP_FFMPEG environment variable when install.
It is not currently documented, so there is no telling when it might be deprecated or changed.
- Explicitly skip the install script (when using the latest npm or pnpm).
It won't work if the install script is later updated to perform other necessary tasks.
FFmpeg Reference
No response
Use Cases
To reduce the installation size (and total size of the application).
Additional Context
No response
Current Situation
Most of the operations performed via the JavaScript interface are provided through N-API binaries, so the installation of the ffmpeg CLI, which runs during the
postinstallscript, should arguably be optional. Since this download adds ~50MB to the total download size (~150MB when unzipped), it is a step that should be avoided if you don't intend to usenode-av/ffmpeg(direct CLI access) at all.Proposed Solution
Currently, this installation step can be skipped by setting the
SKIP_FFMPEGenvironment variable; however, specifying this variable during every installation is not practical. Also, this environment variable is not mentioned in the documentation, and judging by the commit message (063f516) , it appears to have been added for internal use (for CI).I haven't come up with the best or most elegant solution for this either, but for example:
npx node-av install-clior similar to fetch cli binary after install).node-av/ffmpegtonode-av-ffmpeg).Both of these would be breaking changes, so if there is a good approach, that would be much better.
API Level
Low-Level API
Alternative Solutions
SKIP_FFMPEGenvironment variable when install.It is not currently documented, so there is no telling when it might be deprecated or changed.
It won't work if the install script is later updated to perform other necessary tasks.
FFmpeg Reference
No response
Use Cases
To reduce the installation size (and total size of the application).
Additional Context
No response