@effing/ffmpeg

中文文档
0.48.0发布于 2026/11/12MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 3345

FFmpeg binary downloader for Effing

原始使用文档
文档目录4 节
  1. Usage
  2. How it works
  3. Supported platforms
  4. Environment variables

@effing/ffmpeg

Platform-specific FFmpeg binary downloader.

Part of the Effing family — programmatic video creation with TypeScript.

Downloads a platform-specific FFmpeg binary at install time from the effing-ffmpeg-builds GitHub releases (currently tag v9.0.2, FFmpeg 9.0.2).

Usage

import { pathToFFmpeg } from "@effing/ffmpeg";

// pathToFFmpeg is the absolute path to the binary, or null on unsupported platforms

How it works

The install lifecycle script (node install.mjs) runs during pnpm install and:

  1. Detects the current platform and architecture
  2. Skips the download if a binary already exists and its SHA-256 matches the pinned digest in checksums.json (a stale binary from an older release, or a truncated or wrong-arch one, is replaced)
  3. Downloads the gzipped binary from GitHub releases
  4. Decompresses it and verifies its SHA-256 against the pinned digest in checksums.json
  5. Renames it into place and sets executable permissions (only if verification passed)

On a checksum mismatch the partially downloaded file is removed and the install fails; an existing binary is left untouched until its replacement has been verified.

Maintenance: every FFmpeg version bump (FFMPEG_VERSION in install.mjs) must regenerate checksums.json. For each supported target: curl -sL "<base-url>/ffmpeg-<platform>-<arch>.gz" | gunzip | shasum -a 256

The binary is placed in the package root (packages/ffmpeg/ffmpeg). In the monorepo, pnpm symlinks mean all workspace consumers share the same binary.

Supported platforms

PlatformArchitectures
darwinx64, arm64
linuxx64, arm64
win32x64

Environment variables

VariableDescription
FFMPEG_BINARIES_URLOverride the base URL for binary downloads (defaults to the effing-ffmpeg-builds GitHub release). The pinned checksums still apply, so a mirror must serve the same builds unless FFMPEG_SKIP_CHECKSUM=1 is set
FFMPEG_SKIP_CHECKSUMSet to 1 to skip SHA-256 verification of the downloaded binary and keep any existing binary as-is — only for custom builds served via FFMPEG_BINARIES_URL

版本与发布记录

@effing/ffmpeg 共发布 113 个版本,首次发布于 2026/02/07;过去 12 个月发布了 113 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.48.0latest2026/11/121 天前
0.47.32026/11/112 天前
0.47.22026/11/104 天前
0.47.12026/10/2915 天前
0.47.02026/10/2717 天前
0.46.22026/10/2222 天前

关于 @effing/ffmpeg 的常见问题

@effing/ffmpeg 是什么?

FFmpeg binary downloader for Effing

如何安装 @effing/ffmpeg?

在项目目录运行 npm install @effing/ffmpeg,或使用 pnpm add / yarn add / bun add。

@effing/ffmpeg 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@effing/ffmpeg 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@effing/ffmpeg 可以商用吗?

@effing/ffmpeg 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@effing/ffmpeg 的下载量有多少?

根据 npm 官方下载统计,@effing/ffmpeg 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,345 次,日均约 112 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@effing/ffmpeg 还在维护吗?

最新版本 0.48.0 发布于 2026/11/12(1 天前);至今共发布 113 个版本,其中过去 12 个月发布了 113 个;首次发布于 2026/02/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。