Skip to content

Feature Request: Avoid downloading the CLI when not using node-av/ffmpeg #332

Description

@kakkokari-gtyih

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions