Documentation
¶
Overview ¶
Package fakeclip builds small MP4 clips for tests, shaped like a battery camera's motion clips: H.264 video and, optionally, AAC-LC at 16 kHz mono, either as a plain file (sample tables in the moov, one mdat) or a fragmented one (an empty moov, then a moof+mdat pair per keyframe interval), the way a battery doorbell writes them.
Each sample carries its own index, so a test can tell which one it is looking at: see VideoIndex and AudioIndex.
Index ¶
Constants ¶
const ( VideoScale = 90_000 AudioScale = 16_000 )
The tracks' timescales: the video's, and the audio's (its sample rate).
Variables ¶
This section is empty.
Functions ¶
func AudioIndex ¶
AudioIndex reads which AAC frame an ADTS frame is, or -1.
func VideoIndex ¶
VideoIndex reads which picture an Annex-B access unit is, from the last NAL in it (the picture; parameter sets go in front), or -1.
Types ¶
type Clip ¶
type Clip struct {
Fragmented bool
// FPS is the picture rate; Frames pictures, a keyframe every KeyEvery.
FPS, Frames, KeyEvery int
// Stretch is how much longer than the rest, in VideoScale units, the
// first picture lasts, as ffmpeg writes a fragmented file whose AAC
// encoder primed: every picture after it starts that much later.
Stretch int
// AudioFrames is how many 1024 sample AAC frames there are, none for a
// clip without sound. AudioDelay is how many samples after the first
// picture the sound starts: an empty edit in a plain file, the first
// tfdt in a fragmented one.
AudioFrames, AudioDelay int
}
Clip describes the file Build makes.