Appearance
@igpapi/ffmpeg-audio
Installed with @igpapi/android; you never import it. One thing to know: if a bundler inlines the packages into one file, copy the package's module/ directory beside what it loads from (details below).
The audio codec of igpapi, the Instagram private API Simulator for Node.js: what a Reel with a catalog song needs to mix the song into its sound. It holds FFmpeg 5.1 compiled to WebAssembly for Node, audio only, plus constant-bitrate padding of AAC frames. The platform package installs it.
- No native code and no install script: the WebAssembly is inlined (as base64) in one ES module,
module/ffmpeg-audio.mjs, so there is no separate.wasmfile and it behaves the same on Linux, macOS and Windows with Node 22 or later. - Each run happens in its own worker thread, so your event loop keeps running while FFmpeg works. The thread is ended when the run settles or when the run's
AbortSignalaborts. - Two files must ship next to each other. The package loads
module/ffmpeg-audio.worker.mjsandmodule/ffmpeg-audio.mjsby file URL (import.meta.url) at run time, so a bundler that inlines the package'sdistinto one file must still copy the package'smodule/directory beside what it loads from.
License
This package is licensed under the GNU Lesser General Public License, version 2.1 or later (COPYING.LGPLv2.1), because it is FFmpeg.
- Configuration. The build is FFmpeg's LGPL configuration: no GPL or nonfree component is enabled.
ffmpeg -buildconfin the module prints it. - Source. The FFmpeg source is the unmodified release tarball named in
module/ffmpeg-audio.manifest.json, with its URL and sha256: https://ffmpeg.org/releases/. - Build recipe.
recipe/build-in-container.shbuilds the module inside the Emscripten SDK image the manifest pins by digest, andrecipe/rebuild.mjsruns that build with Docker. The rebuild reproduces the module byte for byte, and the manifest records its sha256. The recipe is published and runs from the installed package (recipe/recipe-hash.mjscarries its own copy of the shared hash definition, put there when the package is packed); the rebuild needs Docker and the FFmpeg tarball the manifest names. - Replacing the module. The module is a separate file that the package's own code loads at run time, so you can replace it with your own build.