mp4read

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: AGPL-3.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 mp4read reads the video track of the MP4 files Reolink cameras write (to their SD card, and over FTP): a plain moov with an avc1 or hvc1 track, or a fragmented file (battery doorbells) whose moov is empty and whose samples sit in moof+mdat pairs. Just enough to hand the samples back as Annex-B access units, parameter sets in front of each keyframe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sample

type Sample struct {
	Offset int64
	Size   uint32
	// Dur is how long it shows, in Track.Timescale units.
	Dur uint32
	Key bool
}

Sample is one video access unit in the file.

type Track

type Track struct {
	Codec     string // "H264" or "H265"
	Timescale uint32
	Params    [][]byte // VPS/SPS/PPS or SPS/PPS, without start codes
	Samples   []Sample
	// contains filtered or unexported fields
}

Track is a file's video track.

func Open

func Open(path string) (*Track, error)

Open reads path's video track. Close the track when done.

func (*Track) AnnexB

func (t *Track) AnnexB(i int) ([]byte, error)

AnnexB reads sample i as Annex-B, with the parameter sets in front of a keyframe so a decoder can start there.

func (*Track) Close

func (t *Track) Close() error

Close closes the file.

func (*Track) LastKey

func (t *Track) LastKey() int

LastKey is the index of the last keyframe, or -1.

Jump to

Keyboard shortcuts

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