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, and the AAC track beside them, if there is one, as ADTS frames.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶ added in v0.2.8
type Audio struct {
Timescale uint32
// Start is when the first sample plays, in Timescale units, on the
// same footing as Track.Start.
Start int64
// Object is the MPEG-4 audio object type (2 is AAC-LC), Rate the
// sample rate in Hz, Channels the channel configuration.
Object, Rate, Channels int
Samples []Sample
// contains filtered or unexported fields
}
Audio is a file's AAC track.
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 access unit in the file.
type Track ¶
type Track struct {
Codec string // "H264" or "H265"
Timescale uint32
// Start is when the first sample shows, in Timescale units: its decode
// time less the edit list's skip. It is what lines the audio up with
// the picture.
Start int64
Params [][]byte // VPS/SPS/PPS or SPS/PPS, without start codes
Samples []Sample
// Audio is the file's AAC track, or nil when it has none, or one that
// ADTS cannot frame.
Audio *Audio
// contains filtered or unexported fields
}
Track is a file's video track.