esinfo

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 2 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 esinfo reads the headers of the elementary streams a Blu-ray carries — enough to describe a track the way a listing does: codec flavour, channels, sample rate, bitrate, picture size and frame rate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Audio

type Audio struct {
	// Codec is the human label: "AC3", "E-AC3 (DD+)", "TRUE-HD", "DTS",
	// "DTS-HD Master Audio", "DTS-HD High Resolution", "LPCM".
	Codec string
	// Channels is the channel count including the LFE; LFE says whether one
	// of them is the LFE, so 6 channels with LFE is "5.1".
	Channels   int
	LFE        bool
	SampleRate int
	// Bitrate is in kbit/s; for TrueHD it is the peak, with the AC-3 core's
	// in CoreBitrate. 0 when the stream does not say (lossless DTS, LPCM).
	Bitrate     int
	CoreBitrate int
	// Atmos is set for a TrueHD stream carrying the Atmos substream.
	Atmos bool
	// Core says which core a TrueHD or DTS-HD stream wraps ("AC3", "DTS").
	Core string
	// Bits is the sample size of LPCM.
	Bits int
}

Audio describes an audio stream from its first frames.

func ParseAC3

func ParseAC3(b []byte, eac3 bool) (Audio, bool)

ParseAC3 reads the first frame set of an AC-3 or E-AC-3 stream. An E-AC-3 7.1 track on a Blu-ray is an AC-3 (or E-AC-3) 5.1 independent substream plus an E-AC-3 dependent one carrying the extra channels, so every substream of the first frame set is counted. eac3 says the PMT announced E-AC-3, which decides the label when the first frame is plain AC-3.

func ParseDTS

func ParseDTS(b []byte, hd string) (Audio, bool)

ParseDTS reads a DTS core frame and, when one follows, the DTS-HD substream header: the extension's channel count and sample rate are what a Master Audio track really has, the core being a 5.1 downmix.

func ParseLPCM

func ParseLPCM(payload []byte) (Audio, bool)

ParseLPCM reads the 4-byte header of a Blu-ray LPCM PES payload.

func ParseTrueHD

func ParseTrueHD(b []byte) (Audio, bool)

ParseTrueHD reads a Blu-ray TrueHD stream: MLP access units with an AC-3 core interleaved. The major sync gives the channel assignment and the peak rate; the AC-3 frames give the core's.

func (Audio) Describe

func (a Audio) Describe() string

Describe renders the stream the way a track listing shows it.

func (Audio) Layout

func (a Audio) Layout() string

Layout renders the channel count as "7.1", "5.1", "2.0".

Jump to

Keyboard shortcuts

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