Low-level FFmpeg bindings for Bare
npm install bare-ffmpegLow-level FFmpeg bindings for Bare.
```
npm i bare-ffmpeg
Complete API documentation for all components is available in the /docs directory:
- IOContext - Input/output context for media files with streaming support
- Dictionary - Key-value pairs for FFmpeg options
- Codec - Access to FFmpeg codecs
- Encoder - Find and access encoders by name or codec
- Decoder - Find and access decoders by name or codec
- CodecContext - Encoding/decoding functionality
- CodecParameters - Codec parameter configuration
- Stream - Media stream information and operations
- InputFormat - Input format specification
- OutputFormat - Output format specification
- FormatContext - Base class for media file handling
- InputFormatContext - Reading media files
- OutputFormatContext - Writing media files
- Frame - Decoded audio/video data
- Packet - Encoded audio/video data
- SideData - Packet side data and metadata
- Image - Raw pixel data management
- Rational - Rational number (fraction) representation
- Scaler - Video scaling and pixel format conversion
- Resampler - Audio resampling and format conversion
- Filter - FFmpeg filter access
- FilterGraph - Filter chain management
- FilterContext - Filter instance representation
- FilterInOut - Filter input/output pads
- AudioFIFO - Audio sample buffering
- HWDeviceContext - Hardware device context for acceleration
- HWFramesContext - Hardware frame pool management
- HWFramesConstraints - Hardware capability information
- Constants - FFmpeg constants and utility functions
. Start by installing the tool globally:
`console`
npm i -g bare-make
Next, generate the build system for compiling the bindings, optionally setting the --debug flag to enable debug symbols and assertions:
`console`
bare-make generate [--debug]
This only has to be run once per repository checkout. When updating bare-make or your compiler toolchain it might also be necessary to regenerate the build system. To do so, run the command again with the --no-cache flag set to disregard the existing build system cache:
`console`
bare-make generate [--debug] --no-cache
With a build system generated, the bindings can be compiled:
`console`
bare-make build
This will compile the bindings and output the resulting shared library module to the build/ directory. To install it into the prebuilds/ directory where the Bare addon resolution algorithm expects to find it, do:
`console`
bare-make install
To make iteration faster during development, the shared library module can also be linked into the prebuilds/ directory rather than copied. To do so, set the --link flag:
`console`
bare-make install --link
Prior to publishing the module, make sure that no links exist within the prebuilds/ directory as these will not be included in the resulting package archive.
A few compile options can be configured to customize the addon. Compile options may be set by passing the --define option=value flag to the bare-make generate command when generating the build system.
> [!WARNING]
> The compile options are not covered by semantic versioning and are subject to change without warning.
| Option | Default | Description |
| :----------------------- | :------ | :--------------------------------------- |
| BARE_FFMPEG_ENABLE_GPL | OFF` | Enable GPL-licensed features (e.g, x264) |
Apache-2.0