videoalpha

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 8 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 videoalpha reads whether a video file declares an alpha channel, for the backends whose players do not say so before they draw: VP8 and VP9 in Matroska or WebM with the track's AlphaMode set, and HEVC whose decoder configuration carries the alpha channel information SEI, as Apple's HEVC with alpha has it. It reads a local file's container headers alone, never its frames, within a bound, and imports nothing of the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Local

func Local(source, root string) (path string, ok bool)

Local returns the file a Video source names: an "asset:" path under root, a file URL or a file path. ok is false for other URLs and for an asset without a root.

Types

type Codec

type Codec uint8

Codec is the codec of a video track that declares an alpha channel, or None.

const (
	None Codec = iota
	// VP8 is VP8 with alpha in Matroska or WebM, its alpha coded as a second stream in each block's additions.
	VP8
	// VP9 is VP9 with alpha in Matroska or WebM, as VP8's.
	VP9
	// HEVC is HEVC with an alpha layer in a QuickTime or MPEG-4 file, as Apple's encoders write it.
	HEVC
)

func File

func File(path string) Codec

File returns the alpha codec of the video file at path, None when it declares none or cannot be read.

func Read

func Read(r io.ReaderAt, size int64) Codec

Read returns the alpha codec of a video file of size bytes read through r.

func Source

func Source(source, root string) Codec

Source returns the alpha codec of a Video source: an "asset:" path under root, a file URL or a file path. Other URLs are not read and give None.

func (Codec) String

func (c Codec) String() string

String names a codec with alpha for messages.

Directories

Path Synopsis
Package clips holds the tiny video files the backends' tests play.
Package clips holds the tiny video files the backends' tests play.

Jump to

Keyboard shortcuts

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