probe

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package probe extracts container and stream level information from a media file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(
	data []byte,
) (*media.Info, error)

Parse converts ffprobe JSON output (-show_format -show_streams) into media.Info.

Types

type FFprobe

type FFprobe struct {
	// contains filtered or unexported fields
}

FFprobe implements Prober using the ffprobe binary. It is safe for concurrent use.

func NewFFprobe

func NewFFprobe(
	bin string,
) *FFprobe

NewFFprobe returns a Prober backed by the given ffprobe binary.

func (*FFprobe) Probe

func (f *FFprobe) Probe(
	ctx context.Context,
	path string,
) (*media.Info, error)

Probe implements Prober: ProbeStreams, then ProbeHDR.

func (*FFprobe) ProbeHDR

func (f *FFprobe) ProbeHDR(
	ctx context.Context,
	info *media.Info,
) error

ProbeHDR completes the HDR description of the primary video of info from the side data of its first frame. Containers often carry HDR10 metadata only in the bitstream (HEVC and AV1 SEI/metadata OBUs in MP4), and HDR10+ dynamic metadata never is at stream level. Only PQ, HLG and Dolby Vision streams pay for this second, one-frame call (about 65 ms, most of it ffprobe's start): SDR probing is unchanged. Callers with slower work to do (decoding the video) run it meanwhile.

func (*FFprobe) ProbeStreams

func (f *FFprobe) ProbeStreams(
	ctx context.Context,
	path string,
) (*media.Info, error)

ProbeStreams reads the container and its streams, with the HDR metadata the container signals, without reading any frame.

type Prober

type Prober interface {
	Probe(
		ctx context.Context,
		path string,
	) (*media.Info, error)
}

Prober reads stream information from a media file.

Jump to

Keyboard shortcuts

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