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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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. |