npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

bare-ffmpeg

1.0.0

@tonygo

npmHomeRepoSnykSocket
Downloads:446
$ npm install bare-ffmpeg
DailyWeeklyMonthlyYearly

bare-ffmpeg

Low-level FFmpeg bindings for Bare.

Installation

npm i bare-ffmpeg

API Documentation

Complete API documentation for all components is available in the /docs directory:

Core Components

  • IOContext - Input/output context for media files with streaming support
  • Dictionary - Key-value pairs for FFmpeg options

Codecs & Streams

  • Codec - Access to FFmpeg codecs
  • CodecContext - Encoding/decoding functionality
  • CodecParameters - Codec parameter configuration
  • Stream - Media stream information and operations

Formats

  • InputFormat - Input format specification
  • OutputFormat - Output format specification
  • FormatContext - Base class for media file handling
  • InputFormatContext - Reading media files
  • OutputFormatContext - Writing media files

Data Structures

  • 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

Processing

  • 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

Hardware Acceleration

  • HWDeviceContext - Hardware device context for acceleration
  • HWFramesContext - Hardware frame pool management
  • HWFramesConstraints - Hardware capability information

Utilities

  • Constants - FFmpeg constants and utility functions

Building

https://github.com/holepunchto/bare-make is used for compiling the native bindings in binding.cc. Start by installing the tool globally:

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:

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:

bare-make generate [--debug] --no-cache

With a build system generated, the bindings can be compiled:

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:

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:

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.

Options

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.

OptionDefaultDescription
BARE_FFMPEG_ENABLE_GPLOFFEnable GPL-licensed features (e.g, x264)

License

Apache-2.0