WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

holepunchto/bare-ffmpeg

Repository files navigation

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

Formats

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

Hardware Acceleration

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.

Option Default Description
BARE_FFMPEG_ENABLE_GPL OFF Enable GPL-licensed features (e.g, x264)

License

Apache-2.0

About

Low-level FFmpeg bindings for Bare

Resources

License

Stars

Watchers

Forks

Contributors 7