@dfloresc/ffmpeg-macos-lgpl
v9.0.1-1
Published
FFmpeg 9.0.1 for macOS on Apple silicon and Intel, lgpl variant (LGPL-2.1-or-later): ffmpeg, ffprobe and shared libraries from checksum-pinned official sources
Maintainers
Readme
@dfloresc/ffmpeg-macos-lgpl
FFmpeg 9.0.1 for macOS 12.0 or later, on Apple silicon and Intel, lgpl
variant (LGPL-2.1-or-later): ffmpeg, ffprobe and the shared FFmpeg libraries, built by GitHub
Actions from official, checksum-pinned sources in
ffmpeg-macos-builds.
npm install @dfloresc/[email protected]const ffmpeg = require("@dfloresc/ffmpeg-macos-lgpl");
const { execFileSync } = require("node:child_process");
execFileSync(ffmpeg.ffmpegPath, ["-version"], { stdio: "inherit" });
ffmpeg.forArch("x64").ffmpegPath; // the Intel build, for example to package an app for IntelThis package installs @dfloresc/ffmpeg-macos-lgpl-arm64 and
@dfloresc/ffmpeg-macos-lgpl-x64 as optional dependencies, which npm skips on other systems.
The top-level paths (ffmpegPath, ffprobePath, binDir, libDir, packageDir) belong to
the Mac the code runs on.
Pin the exact version. npm treats 9.0.1-1 as a prerelease version, so a ^ range does not
pick up later FFmpeg versions.
gpl or lgpl?
@dfloresc/ffmpeg-macos-gplincludes x264 and x265, the H.264 and HEVC software encoders. The binaries are GPL-2.0-or-later.@dfloresc/ffmpeg-macos-lgplhas no GPL code and encodes H.264 and HEVC with VideoToolbox. The binaries are LGPL-2.1-or-later: the choice for closed-source software and the Mac App Store.
Electron
Programs cannot run from inside app.asar. With electron-builder, keep this package in
devDependencies and copy the architecture being built into the app's resources:
{
"devDependencies": {
"@dfloresc/ffmpeg-macos-lgpl": "9.0.1-1"
},
"build": {
"extraResources": [
{
"from": "node_modules/@dfloresc/ffmpeg-macos-lgpl-${arch}",
"to": "ffmpeg",
"filter": ["bin/**", "lib/**", "LICENSES/**", "BUILDINFO.txt"]
}
]
}
}The packaged app then runs path.join(process.resourcesPath, "ffmpeg", "bin", "ffmpeg").
Licenses and sources
Each architecture's package has LICENSES/ with the license of every component and
BUILDINFO.txt with the exact sources, configure line and toolchain. The
v9.0.1-1 release has the
corresponding source code. When you redistribute the binaries, include LICENSES/ and point to
those sources. Not legal advice: H.264 and HEVC may also be covered by patents in some countries.
The packages are published from GitHub Actions with npm provenance; npm audit signatures
verifies them.
