libcodec

package module
v0.0.0-...-ea046e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package libcodec registers codecs that run in shared libraries and OS frameworks, bound at run time through purego, so builds keep CGO_ENABLED=0:

rt, err := bundle.New(libcodec.VideoToolbox(), libcodec.AudioToolbox(), libcodec.OpenH264())

They join the pure-Go codecs in one registry. A request takes the backend it names (codec.Backend("openh264"), or backend=openh264 in a program), else the most preferred one that fits: hardware, then shared libraries, then pure Go (see runconfig.WithCodecPreference). A library loads when the runtime is built, never in init. One that is missing, outside the releases its backend mirrors, or turned off registers its backend descriptor-only, with a status (not-installed, outside-window, disabled) and the fix; selection passes it over, and kit.Probe reports it.

Settings come in three tiers: the common knobs (bitrate, rc, quality, qp, speed, threads, tune, gop), each backend's own (openh264.entropy=cabac scopes one to a backend), and raw library parameters (openh264-params="iMaxQp=40:iMinQp=10"). Explain lists a backend's knobs.

Licenses travel with the backends: Declarations returns each one's license class, notice, terms, and published releases as plain values. Cisco's patent license for its OpenH264 binaries asks a program to show "OpenH264 Video Codec provided by Cisco Systems, Inc." (Explain reports it as the encoder's Notice), to reproduce Cisco's terms (License.Terms), and to let the end user turn the codec off: GOAV_LIBCODEC_DISABLE=openh264 does, in any goav program, as it does for any backend (a comma-separated list, or all).

The kit subpackage is how anyone adds a backend, from any module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AudioToolbox

func AudioToolbox() runconfig.Option

AudioToolbox registers Apple's AAC-LC encoder and decoder (aac/audiotoolbox, lib) on macOS; elsewhere it registers as not-installed and selection passes it over.

func Declarations

func Declarations() []kit.Codec

Declarations are the backends this module offers, as plain values: their identities, knobs, licenses, and releases, read without loading anything. Installers, lockfiles, and license pages read them.

func OpenH264

func OpenH264(opts ...Option) runconfig.Option

OpenH264 registers Cisco's OpenH264 as an h264 encoder and decoder (h264/openh264, lib). A libopenh264 from 2.3 up to 3 binds when the runtime is built; without it the backend registers as not-installed and selection passes it over.

func VideoToolbox

func VideoToolbox() runconfig.Option

VideoToolbox registers the hardware H.264 and HEVC encoders and decoders of macOS (h264/videotoolbox and hevc/videotoolbox, hardware). Each checks for its hardware when the runtime is built; a Mac without it, or another OS, registers it not-installed and selection passes it over.

Types

type Option

type Option func(*options)

Option configures one backend.

func Library

func Library(path string) Option

Library loads the backend's library from path, which must be absolute, instead of the system install: a downloaded Cisco OpenH264 binary, say.

Directories

Path Synopsis
Package codectest is the conformance suite for codec backends.
Package codectest is the conformance suite for codec backends.
internal
audiotoolbox
Package audiotoolbox is the AudioToolbox backend: Apple's AAC-LC encoder and decoder, driven through AudioConverter.
Package audiotoolbox is the AudioToolbox backend: Apple's AAC-LC encoder and decoder, driven through AudioConverter.
openh264
Package openh264 is the OpenH264 backend: Cisco's BSD-licensed H.264 encoder and decoder, bound at run time through its C API.
Package openh264 is the OpenH264 backend: Cisco's BSD-licensed H.264 encoder and decoder, bound at run time through its C API.
videotoolbox
Package videotoolbox is the VideoToolbox backend: the hardware H.264 and HEVC encoders and decoders of macOS, driven through VideoToolbox, CoreMedia, CoreVideo, and CoreFoundation.
Package videotoolbox is the VideoToolbox backend: the hardware H.264 and HEVC encoders and decoders of macOS, driven through VideoToolbox, CoreMedia, CoreVideo, and CoreFoundation.
Package kit is how a codec in a shared library or OS framework becomes a goav backend, from any module, with no cgo: a Codec declares the backend (its identity, capabilities, knobs, libraries, license, and releases) and a session per mode; Register adds it to a runtime.
Package kit is how a codec in a shared library or OS framework becomes a goav backend, from any module, with no cgo: a Codec declares the backend (its identity, capabilities, knobs, libraries, license, and releases) and a session per mode; Register adds it to a runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL