mp4

package
v0.21.2-0...-6e41e77 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT, MIT Imports: 16 Imported by: 0

README

Parsing and generation of MP4 (isobmff) boxes.

Background

The Box interfaces and some code in this directory is from the project https://github.com/jfbus/mp4. It has been vastly enhanced and the focus has changed from progessive mp4 files to segmented files.

Overall structure

Most boxes have their own file named after the box, but in some cases, there may be multiple boxes that have the same content, and the code is then having a generic name like visualsampleentry.go.

The Box interface is specified in box.go. It does not contain decode (parsing) methods which have distinct names for each box type and are dispatched in box.go.

Implement a new box

To implement a new box fooo, the following is needed.

Create a file fooo.go and create a struct type FoooBox.

Fooo should then implement the Box interface methods:

 Type()
 Size()
 Encode()
 Info()

but also its own decode method DecodeFooo, and register that method in the decoders map in box.go. For a simple example, look at the prft box in prft.go.

A test file fooo_test.go should have a test using the method boxDiffAfterEncodeAndDecodeto check that the box information is equal after encoding and decoding.

Container boxes like moof, have a list of all their children called Children, but also direct pointers to the children with appropriate names, like Mfhd and Traf. This makes it easy to chain box paths to reach an element like a TfhdBox as

file.Moof.Traf.Tfhd

When there may be multiple children with the same name, there may be both a slice Trafs with all boxes and Traf that points to the first.

To handle media sample data there are two structures:

  1. Sample stores the sample information used in trun
  2. FullSample extends this with the sample binary data and absolute decode time

A MediaSegment can be fragmented into multiple fragments by the method

func (s *MediaSegment) Fragmentify(timescale uint64, trex *TrexBox, duration uint32) ([]*Fragment, error)

License

See LICENSE.md

Documentation

Overview

Package mp4 - library for parsing and writing MP4/ISOBMFF files with a focus on fragmented files.

Most boxes have their own file named after the box four-letter name in the ISO/IEC 14996-12 standard, but in some cases, there may be multiple boxes that have the same content, and the code is then having a generic name like visualsampleentry.go.

The Box interface is specified in box.go. It decodes box size and type in the box header and dispatched decode for each individual box depending on its type.

Implement a new box

To implement a new box "fooo", the following is needed:

Create a file fooo.go and with struct type FoooBox.

FoooBox should then implement the Box interface methods:

Type()
Size()
Encode()
Info()

but also its own decode method `DecodeFooo`, and register that method in the `decoders` map in `box.go`. For a simple example, look at the `prft` box in `prft.go`.

Container Boxes

Container boxes like moof, have a list of all their children called Children, but also direct pointers to the children with appropriate names, like Mfhd and Traf. This makes it easy to chain box paths to reach an element like a TfhdBox as

file.Moof.Traf.Tfhd

When there may be multiple children with the same name, there may be both a pointer to a slice Trafs with all boxes and Traf that points to the first.

Media Sample Data Structures

To handle media sample data there are two structures:

1. `Sample` stores the sample information used in trun

2. `FullSample` also carries a slice with the samples binary data as well as decode time

Fragmenting segments

A MediaSegment can be fragmented into multiple fragments by the method

func (s *MediaSegment) Fragmentify(timescale uint64, trex *TrexBox, duration uint32) ([]*Fragment, error)

Index

Constants

View Source
const (
	UUID_PlayReady = "9a04f079-9840-4286-ab92-e65be0885f95"
	UUID_Widevine  = "edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"
	UUID_FairPlay  = "94CE86FB-07FF-4F43-ADB8-93D2FA968CA2"
	UUID_VCAS      = "9a27dd82-fde2-4725-8cbc-4234aa06ec09"
)
View Source
const DefaultTrakID = 1

DefaultTrakID - trakID used when generating new fragmented content

View Source
const NonSyncSampleFlags uint32 = 0x00010000

NonSyncSampleFlags - flags for non-sync sample

View Source
const SyncSampleFlags uint32 = 0x02000000

SyncSampleFlags - flags for I-frame or other sync sample

View Source
const UseSubSampleEncryption = 0x2

UseSubSampleEncryption - flag for subsample encryption

Variables

This section is empty.

Functions

func ContainerInfo

func ContainerInfo(c ContainerBox, w io.Writer, specificBoxLevels, indent, indentStep string) error

func EncodeContainer

func EncodeContainer(c ContainerBox, w io.Writer) error

EncodeContainer - marshal container c to w

func EncodeHeader

func EncodeHeader(b Box, w io.Writer) error

EncodeHeader - encode a box header to a writer

func EncodeHeaderWithSize

func EncodeHeaderWithSize(boxType string, boxSize uint64, largeSize bool, w io.Writer) error

EncodeHeaderWithSize - encode a box header to a writer and allow for largeSize

func GetVersion

func GetVersion() string

GetVersion - get version and also commitHash and commitDate if inserted via Makefile

func IsSyncSampleFlags

func IsSyncSampleFlags(flags uint32) bool

IsSyncSampleFlags - flags is set correctly for sync sample

func SetNonSyncSampleFlags

func SetNonSyncSampleFlags(flags uint32) uint32

SetNonSyncSampleFlags - return flags with nonsyncsample pattern

func SetSyncSampleFlags

func SetSyncSampleFlags(flags uint32) uint32

SetSyncSampleFlags - return flags with syncsample pattern

func WriteToFile

func WriteToFile(boxStructure BoxStructure, filePath string) error

WriteToFile - write a box structure to a file at filePath

Types

type AlstSampleGroupEntry

type AlstSampleGroupEntry struct {
	RollCount         uint16
	FirstOutputSample uint16
	SampleOffset      []uint32
	NumOutputSamples  []uint16
	NumTotalSamples   []uint16
}

AlstSampleGroupEntry - Alternative Startup Entry "alst"

ISO/IEC 14496-12 Ed. 6 2020 Section 10.3 - AlternativeStartupEntry

func (*AlstSampleGroupEntry) Encode

func (s *AlstSampleGroupEntry) Encode(sw *SliceWriter)

func (*AlstSampleGroupEntry) Info

func (s *AlstSampleGroupEntry) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*AlstSampleGroupEntry) Size

func (s *AlstSampleGroupEntry) Size() uint64

func (*AlstSampleGroupEntry) Type

func (s *AlstSampleGroupEntry) Type() string

type AudioSampleEntryBox

type AudioSampleEntryBox struct {
	DataReferenceIndex uint16
	ChannelCount       uint16
	SampleSize         uint16
	SampleRate         uint16 // Integer part
	Esds               *EsdsBox
	Children           []Box
	// contains filtered or unexported fields
}

AudioSampleEntryBox according to ISO/IEC 14496-12

func CreateAudioSampleEntryBox

func CreateAudioSampleEntryBox(name string, nrChannels, sampleSize, sampleRate uint16, child Box) *AudioSampleEntryBox

CreateAudioSampleEntryBox - Create new AudioSampleEntry such as mp4

func NewAudioSampleEntryBox

func NewAudioSampleEntryBox(name string) *AudioSampleEntryBox

NewAudioSampleEntryBox - Create new empty mp4a box

func (*AudioSampleEntryBox) AddChild

func (a *AudioSampleEntryBox) AddChild(b Box)

AddChild - add a child box (avcC normally, but clap and pasp could be part of visual entry)

func (*AudioSampleEntryBox) Encode

func (a *AudioSampleEntryBox) Encode(w io.Writer) error

Encode - write box to w

func (*AudioSampleEntryBox) Info

func (a *AudioSampleEntryBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*AudioSampleEntryBox) Size

func (a *AudioSampleEntryBox) Size() uint64

Size - return calculated size

func (*AudioSampleEntryBox) Type

func (a *AudioSampleEntryBox) Type() string

Type - return box type

type AvcCBox

type AvcCBox struct {
	avc.AVCDecConfRec
}

AvcCBox - AVCConfigurationBox (ISO/IEC 14496-15 5.4.2.1.2 and 5.3.3.1.2) Contains one AVCDecoderConfigurationRecord

func CreateAvcC

func CreateAvcC(spsNALUs [][]byte, ppsNALUs [][]byte) (*AvcCBox, error)

CreateAvcC - Create an avcC box based on SPS and PPS

func (*AvcCBox) Encode

func (a *AvcCBox) Encode(w io.Writer) error

Encode - write box to w

func (*AvcCBox) Info

func (a *AvcCBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*AvcCBox) Size

func (a *AvcCBox) Size() uint64

Size - return calculated size

func (*AvcCBox) Type

func (a *AvcCBox) Type() string

Type - return box type

type Box

type Box interface {
	// Type of box, normally 4 asccii characters, but is uint32 according to spec
	Type() string
	// Size of box including header and all children if any
	Size() uint64
	// Encode box to writer
	Encode(w io.Writer) error
	// Info - write box details
	//   spedificBoxLevels is a comma-separated list box:level or all:level where level >= 0.
	//   Higher levels give more details. 0 is default
	//   indent is indent at this box level.
	//   indentStep is how much to indent at each level
	Info(w io.Writer, specificBoxLevels, indent, indentStep string) error
}

Box is the general interface to any ISOBMFF box or similar

func DecodeAudioSampleEntry

func DecodeAudioSampleEntry(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeAudioSampleEntry - decode mp4a... box

func DecodeAvcC

func DecodeAvcC(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeAvcC - box-specific decode

func DecodeBox

func DecodeBox(startPos uint64, r io.Reader) (Box, error)

DecodeBox decodes a box

func DecodeBoxLazyMdat

func DecodeBoxLazyMdat(startPos uint64, r io.ReadSeeker) (Box, error)

DecodeBox decodes a box but don't read mdat into memory

func DecodeBtrt

func DecodeBtrt(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeBtrt - box-specific decode

func DecodeCdat

func DecodeCdat(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeCdat - box-specific decode

func DecodeClap

func DecodeClap(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecideClap - box-specific decode

func DecodeCo64

func DecodeCo64(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStco - box-specific decode

func DecodeContainerChildren

func DecodeContainerChildren(hdr *boxHeader, startPos, endPos uint64, r io.Reader) ([]Box, error)

DecodeContainerChildren decodes a container box

func DecodeCtim

func DecodeCtim(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeCtim - box-specific decode

func DecodeCtts

func DecodeCtts(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeCtts - box-specific decode

func DecodeDinf

func DecodeDinf(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeDinf - box-specific decode

func DecodeDref

func DecodeDref(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeDref - box-specific decode

func DecodeEdts

func DecodeEdts(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeEdts - box-specific decode

func DecodeElng

func DecodeElng(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeElng - box-specific decode

func DecodeElst

func DecodeElst(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeElst - box-specific decode

func DecodeEmsg

func DecodeEmsg(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeEmsg - box-specific decode

func DecodeEsds

func DecodeEsds(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeEsds - box-specific decode

func DecodeFree

func DecodeFree(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeFree - box-specific decode

func DecodeFrma

func DecodeFrma(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSaio - box-specific decode

func DecodeFtyp

func DecodeFtyp(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeFtyp - box-specific decode

func DecodeHdlr

func DecodeHdlr(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeHdlr - box-specific decode

func DecodeHvcC

func DecodeHvcC(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeHvcC - box-specific decode

func DecodeIden

func DecodeIden(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeIden - box-specific decode

func DecodeIlst

func DecodeIlst(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeIlst - box-specific decode

func DecodeKind

func DecodeKind(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeKind - box-specific decode

func DecodeMdat

func DecodeMdat(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMdat - box-specific decode

func DecodeMdatLazily

func DecodeMdatLazily(hdr *boxHeader, startPos uint64) (Box, error)

func DecodeMdhd

func DecodeMdhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMdhd - Decode box

func DecodeMdia

func DecodeMdia(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMdia - box-specific decode

func DecodeMehd

func DecodeMehd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMehd - box-specific decode

func DecodeMeta

func DecodeMeta(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMinf - box-specific decode

func DecodeMfhd

func DecodeMfhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMfhd - box-specific decode

func DecodeMfra

func DecodeMfra(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMfra - box-specific decode

func DecodeMfro

func DecodeMfro(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMfro - box-specific decode

func DecodeMinf

func DecodeMinf(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMinf - box-specific decode

func DecodeMoof

func DecodeMoof(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMoof - box-specific decode

func DecodeMoov

func DecodeMoov(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMoov - box-specific decode

func DecodeMvex

func DecodeMvex(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMvex - box-specific decode

func DecodeMvhd

func DecodeMvhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeMvhd - box-specific decode

func DecodeNmhd

func DecodeNmhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeNmhd - box-specific decode

func DecodePasp

func DecodePasp(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecidePasp - box-specific decode

func DecodePayl

func DecodePayl(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodePayl - box-specific decode

func DecodePrft

func DecodePrft(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodePrft - box-specific decode

func DecodePssh

func DecodePssh(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodePssh - box-specific decode

func DecodeSaio

func DecodeSaio(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSaio - box-specific decode

func DecodeSaiz

func DecodeSaiz(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSaiz - box-specific decode

func DecodeSbgp

func DecodeSbgp(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSbgp - box-specific decode

func DecodeSchi

func DecodeSchi(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSchi - box-specific decode

func DecodeSchm

func DecodeSchm(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSchm - box-specific decode

func DecodeSdtp

func DecodeSdtp(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSdtp - box-specific decode

func DecodeSenc

func DecodeSenc(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSenc - box-specific decode

func DecodeSgpd

func DecodeSgpd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSgpd - box-specific decode

func DecodeSidx

func DecodeSidx(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSidx - box-specific decode

func DecodeSinf

func DecodeSinf(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSinf - box-specific decode

func DecodeSmhd

func DecodeSmhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSmhd - box-specific decode

func DecodeStbl

func DecodeStbl(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStbl - box-specific decode

func DecodeStco

func DecodeStco(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStco - box-specific decode

func DecodeSthd

func DecodeSthd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSthd - box-specific decode

func DecodeStpp

func DecodeStpp(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStpp - Decode XMLSubtitleSampleEntry (stpp)

func DecodeStsc

func DecodeStsc(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStsc - box-specific decode

func DecodeStsd

func DecodeStsd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStsd - box-specific decode

func DecodeStss

func DecodeStss(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStss - box-specific decode

func DecodeStsz

func DecodeStsz(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStsz - box-specific decode

func DecodeSttg

func DecodeSttg(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSttg - box-specific decode

func DecodeStts

func DecodeStts(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStts - box-specific decode

func DecodeStyp

func DecodeStyp(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeStyp - box-specific decode

func DecodeSubs

func DecodeSubs(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeSubs - box-specific decode

func DecodeTenc

func DecodeTenc(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTenc - box-specific decode

func DecodeTfdt

func DecodeTfdt(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTfdt - box-specific decode

func DecodeTfhd

func DecodeTfhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTfhd - box-specific decode

func DecodeTfra

func DecodeTfra(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTfra - box-specific decode

func DecodeTkhd

func DecodeTkhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTkhd - box-specific decode

func DecodeTraf

func DecodeTraf(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTraf - box-specific decode

func DecodeTrak

func DecodeTrak(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTrak - box-specific decode

func DecodeTrep

func DecodeTrep(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTrep - box-specific decode

func DecodeTrex

func DecodeTrex(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTrex - box-specific decode

func DecodeTrun

func DecodeTrun(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeTrun - box-specific decode

func DecodeURLBox

func DecodeURLBox(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeURLBox - box-specific decode

func DecodeUUID

func DecodeUUID(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeUUIDBox - decode a UUID box including tfxd or tfrf

func DecodeUdta

func DecodeUdta(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeUdta - box-specific decode

func DecodeUnknown

func DecodeUnknown(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeUnknown - decode an unknown box

func DecodeVisualSampleEntry

func DecodeVisualSampleEntry(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVisualSampleEntry - decode avc1/avc3/... box

func DecodeVlab

func DecodeVlab(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVlab - box-specific decode

func DecodeVmhd

func DecodeVmhd(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVmhd - box-specific decode

func DecodeVsid

func DecodeVsid(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVsid - box-specific decode

func DecodeVttC

func DecodeVttC(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVttC - box-specific decode

func DecodeVtta

func DecodeVtta(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVtta - box-specific decode

func DecodeVttc

func DecodeVttc(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVttc - box-specific decode

func DecodeVtte

func DecodeVtte(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeVtte - box-specific decode

func DecodeWvtt

func DecodeWvtt(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

DecodeWvtt - Decoder wvtt Sample Entry (wvtt)

type BoxDecoder

type BoxDecoder func(hdr *boxHeader, startPos uint64, r io.Reader) (Box, error)

BoxDecoder is function signature of the Box Decode method

type BoxStructure

type BoxStructure interface {
	Encode(w io.Writer) error
}

BoxStructure represent a box or similar entity such as a Segment

type BtrtBox

type BtrtBox struct {
	BufferSizeDB uint32
	MaxBitrate   uint32
	AvgBitrate   uint32
}

BtrtBox - BitRateBox - ISO/IEC 14496-12 Section 8.5.2.2

func (*BtrtBox) Encode

func (b *BtrtBox) Encode(w io.Writer) error

Encode - write box to w

func (*BtrtBox) Info

func (b *BtrtBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*BtrtBox) Size

func (b *BtrtBox) Size() uint64

Size - return calculated size

func (*BtrtBox) Type

func (b *BtrtBox) Type() string

Type - return box type

type CdatBox

type CdatBox struct {
	Data []byte
}

CdatBox - Closed Captioning Sample Data according to QuickTime spec: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-SW87

func (*CdatBox) Encode

func (b *CdatBox) Encode(w io.Writer) error

Encode - write box to w

func (*CdatBox) Info

func (b *CdatBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*CdatBox) Size

func (b *CdatBox) Size() uint64

Size - calculated size of box

func (*CdatBox) Type

func (b *CdatBox) Type() string

Type - box type

type ClapBox

type ClapBox struct {
	CleanApertureWidthN  uint32
	CleanApertureWidthD  uint32
	CleanApertureHeightN uint32
	CleanApertureHeightD uint32
	HorizOffN            uint32
	HorizOffD            uint32
	VertOffN             uint32
	VertOffD             uint32
}

ClapBox - Clean Aperture Box, ISO/IEC 14496-12 2020 Sec. 12.1.4

func (*ClapBox) Encode

func (b *ClapBox) Encode(w io.Writer) error

Encode - write box to w

func (*ClapBox) Info

func (b *ClapBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*ClapBox) Size

func (b *ClapBox) Size() uint64

Size - calculated size of box

func (*ClapBox) Type

func (b *ClapBox) Type() string

Type - box type

type Co64Box

type Co64Box struct {
	Version     byte
	Flags       uint32
	ChunkOffset []uint64
}

Co64Box - Chunk Large Offset Box

Contained in : Sample Table box (stbl)

64-bit version of StcoBox

func (*Co64Box) Encode

func (b *Co64Box) Encode(w io.Writer) error

Encode - box-specific encode

func (*Co64Box) Info

func (b *Co64Box) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*Co64Box) Size

func (b *Co64Box) Size() uint64

Size - box-specific size

func (*Co64Box) Type

func (b *Co64Box) Type() string

Type - box-specific type

type ContainerBox

type ContainerBox interface {
	Type() string
	Size() uint64
	Encode(w io.Writer) error
	GetChildren() []Box
	Info(w io.Writer, specificBoxLevels, indent, indentStep string) error
}

ContainerBox is interface for ContainerBoxes

type CtimBox

type CtimBox struct {
	CueCurrentTime string
}

CtimBox - CueTimeBox (ctim) CueCurrentTime is current time indication (for split cues)

func (*CtimBox) Encode

func (c *CtimBox) Encode(w io.Writer) error

Encode - write box to w

func (*CtimBox) Info

func (c *CtimBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*CtimBox) Size

func (c *CtimBox) Size() uint64

Size - calculated size of box

func (*CtimBox) Type

func (c *CtimBox) Type() string

Type - box-specific type

type CttsBox

type CttsBox struct {
	Version      byte
	Flags        uint32
	SampleCount  []uint32
	SampleOffset []int32 // int32 to handle version 1
}

CttsBox - Composition Time to Sample Box (ctts - optional)

Contained in: Sample Table Box (stbl)

func (*CttsBox) Encode

func (b *CttsBox) Encode(w io.Writer) error

Encode - write box to w

func (*CttsBox) GetCompositionTimeOffset

func (b *CttsBox) GetCompositionTimeOffset(sampleNr uint32) int32

GetCompositionTimeOffset - composition time offset for (one-based) sampleNr in track timescale

func (*CttsBox) Info

func (b *CttsBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - get all info with specificBoxLevels ctts:1 or higher

func (*CttsBox) Size

func (b *CttsBox) Size() uint64

Size - calculated size of box

func (*CttsBox) Type

func (b *CttsBox) Type() string

Type - box type

type DinfBox

type DinfBox struct {
	Dref     *DrefBox
	Children []Box
}

DinfBox - Data Information Box (dinf - mandatory)

Contained in : Media Information Box (minf) or Meta Box (meta)

func (*DinfBox) AddChild

func (d *DinfBox) AddChild(box Box)

AddChild - Add a child box

func (*DinfBox) Encode

func (d *DinfBox) Encode(w io.Writer) error

Encode - write dinf container to w

func (*DinfBox) GetChildren

func (d *DinfBox) GetChildren() []Box

GetChildren - list of child boxes

func (*DinfBox) Info

func (d *DinfBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*DinfBox) Size

func (d *DinfBox) Size() uint64

Size - box-specific size

func (*DinfBox) Type

func (d *DinfBox) Type() string

Type - box-specific type

type DrefBox

type DrefBox struct {
	Version    byte
	Flags      uint32
	EntryCount int
	Children   []Box
}

DrefBox - Data Reference Box (dref - mandatory)

Contained id: Data Information Box (dinf)

Defines the location of the media data. If the data for the track is located in the same file it contains nothing useful.

func CreateDref

func CreateDref() *DrefBox

CreateDref - Create an DataReferenceBox for selfcontained content

func (*DrefBox) AddChild

func (d *DrefBox) AddChild(box Box)

AddChild - Add a child box and update EntryCount

func (*DrefBox) Encode

func (d *DrefBox) Encode(w io.Writer) error

Encode - write dref box to w including children

func (*DrefBox) Info

func (d *DrefBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*DrefBox) Size

func (d *DrefBox) Size() uint64

Size - calculated size of box

func (*DrefBox) Type

func (d *DrefBox) Type() string

Type - box type

type EdtsBox

type EdtsBox struct {
	Elst     []*ElstBox
	Children []Box
}

EdtsBox - Edit Box (edts - optional)

Contained in: Track Box ("trak")

The edit box maps the presentation timeline to the media-time line

func (*EdtsBox) Encode

func (b *EdtsBox) Encode(w io.Writer) error

Encode - write edts container to w

func (*EdtsBox) GetChildren

func (b *EdtsBox) GetChildren() []Box

GetChildren - list of child boxes

func (*EdtsBox) Info

func (b *EdtsBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*EdtsBox) Size

func (b *EdtsBox) Size() uint64

Size - calculated size of box

func (*EdtsBox) Type

func (b *EdtsBox) Type() string

Type - box type

type ElngBox

type ElngBox struct {
	Language string
}

ElngBox - Extended Language Box

func CreateElng

func CreateElng(language string) *ElngBox

CreateElng - Create an Extended Language Box

func (*ElngBox) Encode

func (b *ElngBox) Encode(w io.Writer) error

Encode - write box to w

func (*ElngBox) Info

func (b *ElngBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*ElngBox) Size

func (b *ElngBox) Size() uint64

Size - calculated size of box

func (*ElngBox) Type

func (b *ElngBox) Type() string

Type - box type

type ElstBox

type ElstBox struct {
	Version           byte
	Flags             uint32
	SegmentDuration   []uint64
	MediaTime         []int64
	MediaRateInteger  []int16
	MediaRateFraction []int16
}

ElstBox - Edit List Box (elst - optional)

Contained in : Edit Box (edts)

func (*ElstBox) Encode

func (b *ElstBox) Encode(w io.Writer) error

Encode - write box to w

func (*ElstBox) Info

func (b *ElstBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*ElstBox) Size

func (b *ElstBox) Size() uint64

Size - calculated size of box

func (*ElstBox) Type

func (b *ElstBox) Type() string

Type - box type

type EmsgBox

type EmsgBox struct {
	Version               byte
	Flags                 uint32
	TimeScale             uint32
	PresentationTimeDelta uint32
	PresentationTime      uint64
	EventDuration         uint32
	Id                    uint32
	SchemeIdURI           string
	Value                 string
}

EmsgBox - DASHEventMessageBox as defined in ISO/IEC 23009-1

func (*EmsgBox) Encode

func (b *EmsgBox) Encode(w io.Writer) error

Encode - write box to w

func (*EmsgBox) Info

func (b *EmsgBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*EmsgBox) Size

func (b *EmsgBox) Size() uint64

Size - calculated size of box

func (*EmsgBox) Type

func (b *EmsgBox) Type() string

Type - box type

type EsdsBox

type EsdsBox struct {
	Version               byte
	Flags                 uint32
	EsDescrTag            byte
	EsID                  uint16
	FlagsAndPriority      byte
	DecoderConfigDescrTag byte
	ObjectType            byte
	StreamType            byte
	BufferSizeDB          uint32
	MaxBitrate            uint32
	AvgBitrate            uint32
	DecSpecificInfoTag    byte
	DecConfig             []byte
	SLConfigDescrTag      byte
	SLConfigValue         byte
	// contains filtered or unexported fields
}

EsdsBox as used for MPEG-audio, see ISO 14496-1 Section 7.2.6.6 for DecoderConfigDescriptor

func CreateEsdsBox

func CreateEsdsBox(decConfig []byte) *EsdsBox

CreateEsdsBox - Create an EsdsBox geiven decConfig

func (*EsdsBox) Encode

func (e *EsdsBox) Encode(w io.Writer) error

Encode - write box to w

func (*EsdsBox) Info

func (e *EsdsBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*EsdsBox) Size

func (e *EsdsBox) Size() uint64

Size - calculated size of box

func (*EsdsBox) Type

func (e *EsdsBox) Type() string

Type - box type

type File

type File struct {
	Ftyp           *FtypBox
	Moov           *MoovBox
	Mdat           *MdatBox        // Only used for non-fragmented files
	Init           *InitSegment    // Init data (ftyp + moov for fragmented file)
	Sidx           *SidxBox        // SidxBox for a DASH OnDemand file
	Segments       []*MediaSegment // Media segments
	Children       []Box           // All top-level boxes in order
	EncodeVerbatim bool            // Set to encode box by box without fragment optimizations
	// contains filtered or unexported fields
}

File - an MPEG-4 file asset

A progressive MPEG-4 file contains three main boxes:

ftyp : the file type box
moov : the movie box (meta-data)
mdat : the media data (chunks and samples). Only used for pror

where mdat may come before moov. If fragmented, there are many more boxes and they are collected in the InitSegment, Segment and Segments structures. The sample metadata in thefragments in the Segments will be optimized unless EncodeVerbatim is set. To Encode the same data as Decoded, this flag must therefore be set. In all cases, Children contain all top-level boxes

func DecodeFile

func DecodeFile(r io.Reader) (*File, error)

DecodeFile - parse and decode a file from reader r

func DecodeFileLazyMdat

func DecodeFileLazyMdat(r io.ReadSeeker) (*File, error)

func NewFile

func NewFile() *File

NewFile - create MP4 file

func ReadMP4File

func ReadMP4File(path string) (*File, error)

ReadMP4File - read an mp4 file from path

func (*File) AddChild

func (f *File) AddChild(box Box, boxStartPos uint64)

AddChild - add child with start position

func (*File) AddMediaSegment

func (f *File) AddMediaSegment(m *MediaSegment)

AddMediaSegment - add a mediasegment to file f

func (*File) DumpWithSampleData

func (f *File) DumpWithSampleData(w io.Writer, specificBoxLevels string) error

DumpWithSampleData - print information about file and its children boxes

func (*File) Encode

func (f *File) Encode(w io.Writer) error

Encode - encode a file to a Writer Fragmented files are encoded based on InitSegment and MediaSegments, unless EncodeVerbatim is set.

func (*File) Info

func (f *File) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - write box tree with indent for each level

func (*File) IsFragmented

func (f *File) IsFragmented() bool

IsFragmented - is file made of multiple segments (Mp4 fragments)

func (*File) LastSegment

func (f *File) LastSegment() *MediaSegment

LastSegment - Currently last segment

type Fixed16

type Fixed16 uint16

Fixed16 - An 8.8 fixed point number

func (Fixed16) String

func (f Fixed16) String() string

type Fixed32

type Fixed32 uint32

Fixed32 - A 16.16 fixed point number

func (Fixed32) String

func (f Fixed32) String() string

type Fragment

type Fragment struct {
	Prft     *PrftBox
	Moof     *MoofBox
	Mdat     *MdatBox
	Children []Box // All top-level boxes in order
	// contains filtered or unexported fields
}

Fragment - MP4 Fragment ([prft] + moof + mdat)

func CreateFragment

func CreateFragment(seqNumber uint32, trackID uint32) (*Fragment, error)

CreateFragment - create single track empty fragment

func CreateMultiTrackFragment

func CreateMultiTrackFragment(seqNumber uint32, trackIDs []uint32) (*Fragment, error)

CreateFragment - create multi-track empty fragment without trun

func NewFragment

func NewFragment() *Fragment

NewFragment - New emtpy one-track MP4 Fragment

func (*Fragment) AddChild

func (f *Fragment) AddChild(b Box)

AddChild - Add a top-level box to Fragment

func (*Fragment) AddFullSample

func (f *Fragment) AddFullSample(s *FullSample)

AddFullSample - add a full sample to first (and only) trun of a track AddFullSampleToTrack is the more general function

func (*Fragment) AddFullSampleToTrack

func (f *Fragment) AddFullSampleToTrack(s *FullSample, trackID uint32) error

AddFullSampleToTrack - allows for adding samples to any track New trun boxes will be created if latest trun of fragment is not in this track

func (*Fragment) DumpSampleData

func (f *Fragment) DumpSampleData(w io.Writer, trex *TrexBox) error

DumpSampleData - Get Sample data and print out

func (*Fragment) Encode

func (f *Fragment) Encode(w io.Writer) error

Encode - write fragment via writer

func (*Fragment) EncodeVerbatim

func (f *Fragment) EncodeVerbatim(w io.Writer) error

EncodeVerbatim - write fragment without trun optimization via writer

func (*Fragment) GetChildren

func (f *Fragment) GetChildren() []Box

GetChildren - return children boxes

func (*Fragment) GetFullSamples

func (f *Fragment) GetFullSamples(trex *TrexBox) ([]*FullSample, error)

GetFullSamples - Get full samples including media and accumulated time

func (*Fragment) Info

func (f *Fragment) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*Fragment) SetTrunDataOffsets

func (f *Fragment) SetTrunDataOffsets()

SetTrunDataOffsets - set DataOffset in trun depending on size and writeOrder

type FreeBox

type FreeBox struct {
	Name string
	// contains filtered or unexported fields
}

FreeBox - Free Space Box (free or skip)

func (*FreeBox) Encode

func (b *FreeBox) Encode(w io.Writer) error

Encode - write box to w

func (*FreeBox) Info

func (b *FreeBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*FreeBox) Size

func (b *FreeBox) Size() uint64

Size - calculated size of box

func (*FreeBox) Type

func (b *FreeBox) Type() string

Type - box type

type FrmaBox

type FrmaBox struct {
	DataFormat string // uint32 - original box type
}

FrmaBox - Original Format Box

func (*FrmaBox) Encode

func (b *FrmaBox) Encode(w io.Writer) error

Encode - write box to w

func (*FrmaBox) Info

func (b *FrmaBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*FrmaBox) Size

func (b *FrmaBox) Size() uint64

Size - return calculated size

func (*FrmaBox) Type

func (b *FrmaBox) Type() string

Type - return box type

type FtypBox

type FtypBox struct {
	MajorBrand       string
	MinorVersion     uint32
	CompatibleBrands []string
}

FtypBox - File Type Box (ftyp - mandatory)

func CreateFtyp

func CreateFtyp() *FtypBox

CreateFtyp - Create an Ftyp box suitable for DASH/CMAF

func (*FtypBox) Encode

func (b *FtypBox) Encode(w io.Writer) error

Encode - write box to w

func (*FtypBox) Info

func (b *FtypBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*FtypBox) Size

func (b *FtypBox) Size() uint64

Size - return calculated size

func (*FtypBox) Type

func (b *FtypBox) Type() string

Type - return box type

type FullSample

type FullSample struct {
	Sample
	DecodeTime uint64 // Absolute decode time (offset + accumulated sample Dur)
	Data       []byte // Sample data
}

FullSample - include accumulated time and data. Times in mdhd timescale

func (*FullSample) PresentationTime

func (s *FullSample) PresentationTime() uint64

PresentationTime - DecodeTime displaced by composition time offset (possibly negative)

type HdlrBox

type HdlrBox struct {
	Version     byte
	Flags       uint32
	PreDefined  uint32
	HandlerType string
	Name        string
}

HdlrBox - Handler Reference Box (hdlr - mandatory)

Contained in: Media Box (mdia) or Meta Box (meta)

This box describes the type of data contained in the trak. HandlerType can be : "vide" (video track), "soun" (audio track), "subt" (subtitle track) Other types are: "hint" (hint track), "meta" (timed Metadata track), "auxv" (auxiliary video track). clcp (Closed Captions (QuickTime))

func CreateHdlr

func CreateHdlr(mediaOrHdlrType string) (*HdlrBox, error)

CreateHdlr - create mediaType-specific hdlr box

func (*HdlrBox) Encode

func (b *HdlrBox) Encode(w io.Writer) error

Encode - write box to w

func (*HdlrBox) Info

func (b *HdlrBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*HdlrBox) Size

func (b *HdlrBox) Size() uint64

Size - calculated size of box

func (*HdlrBox) Type

func (b *HdlrBox) Type() string

Type - box type

type HvcCBox

type HvcCBox struct {
	hevc.HEVCDecConfRec
}

HvcCBox - HEVCConfigurationBox (ISO/IEC 14496-15 8.4.1.1.2) Contains one HEVCDecoderConfigurationRecord

func CreateHvcC

func CreateHvcC(vpsNalus, spsNalus, ppsNalus [][]byte, vpsComplete, spsComplete, ppsComplete bool) (*HvcCBox, error)

CreateHvcC- Create an hvcC box based on VPS, SPS and PPS and signal completeness

func (*HvcCBox) Encode

func (b *HvcCBox) Encode(w io.Writer) error

Encode - write box to w

func (*HvcCBox) Info

func (b *HvcCBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - box-specific Info

func (*HvcCBox) Size

func (b *HvcCBox) Size() uint64

Size - return calculated size

func (*HvcCBox) Type

func (b *HvcCBox) Type() string

Type - return box type

type IdenBox

type IdenBox struct {
	CueID string
}

IdenBox - CueIDBox (iden)

func (*IdenBox) Encode

func (i *IdenBox) Encode(w io.Writer) error

Encode - write box to w

func (*IdenBox) Info

func (i *IdenBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*IdenBox) Size

func (i *IdenBox) Size() uint64

Size - calculated size of box

func (*IdenBox) Type

func (i *IdenBox) Type() string

Type - box-specific type

type IlstBox

type IlstBox struct {
	Children []Box
}

IlstBox - iTunes Metadata Item List Atom (ilst) See https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/Metadata/Metadata.html

func (*IlstBox) AddChild

func (s *IlstBox) AddChild(child Box)

AddChild - Add a child box and update SampleCount

func (*IlstBox) Encode

func (b *IlstBox) Encode(w io.Writer) error

Encode - box-specific encode of stsd - not a usual container

func (*IlstBox) GetChildren

func (b *IlstBox) GetChildren() []Box

GetChildren - list of child boxes

func (*IlstBox) Info

func (b *IlstBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*IlstBox) Size

func (b *IlstBox) Size() uint64

Size - box-specific type

func (*IlstBox) Type

func (s *IlstBox) Type() string

Type - box-specific type

type Informer

type Informer interface {
	// Info - write details via Info method
	//   spedificBoxLevels is a comma-separated list box:level or all:level where level >= 0.
	//   Higher levels give more details. 0 is default
	//   indent is indent at this box level.
	//   indentStep is how much to indent at each level
	Info(w io.Writer, specificBoxLevels, indent, indentStep string) error
}

Informer - write box, segment or file details

type InitSegment

type InitSegment struct {
	MediaType string
	Ftyp      *FtypBox
	Moov      *MoovBox
	Children  []Box // All top-level boxes in order
}

InitSegment - MP4/CMAF init segment

func CreateEmptyInit

func CreateEmptyInit() *InitSegment

CreateEmptyInit - create an init segment for fragmented files

func NewMP4Init

func NewMP4Init() *InitSegment

NewMP4Init - Create MP4Init

func (*InitSegment) AddChild

func (s *InitSegment) AddChild(b Box)

AddChild - Add a top-level box to InitSegment

func (*InitSegment) AddEmptyTrack

func (i *InitSegment) AddEmptyTrack(timeScale uint32, mediaType, language string)

AddEmptyTrack - add trak + trex box with appropriate trackID value

func (*InitSegment) Encode

func (s *InitSegment) Encode(w io.Writer) error

Encode - encode an initsegment to a Writer

func (*InitSegment) GetMediaType

func (s *InitSegment) GetMediaType() string

GetMediaType - should return video or audio (at present)

func (*InitSegment) Info

func (i *InitSegment) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - write box tree with indent for each level

type InitializationVector

type InitializationVector []byte

InitializationVector (8 or 16 bytes)

type KindBox

type KindBox struct {
	SchemeURI string
	Value     string
}

KindBox - Track Kind Box

func (*KindBox) Encode

func (b *KindBox) Encode(w io.Writer) error

Encode - write box to w

func (*KindBox) Info

func (b *KindBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*KindBox) Size

func (b *KindBox) Size() uint64

Size - calculated size of box

func (*KindBox) Type

func (b *KindBox) Type() string

Type - box type

type MdatBox

type MdatBox struct {
	StartPos uint64
	Data     []byte

	LargeSize bool
	// contains filtered or unexported fields
}

MdatBox - Media Data Box (mdat) The mdat box contains media chunks/samples.

func (*MdatBox) AddSampleData

func (m *MdatBox) AddSampleData(s []byte)

AddSampleData - a sample data to an mdat box

func (*MdatBox) Encode

func (m *MdatBox) Encode(w io.Writer) error

Encode - write box to w

func (*MdatBox) HeaderSize

func (m *MdatBox) HeaderSize() uint64

func (*MdatBox) Info

func (m *MdatBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MdatBox) PayloadAbsoluteOffset

func (m *MdatBox) PayloadAbsoluteOffset() uint64

PayloadAbsoluteOffset - position of mdat payload start (works after header)

func (*MdatBox) Size

func (m *MdatBox) Size() uint64

Size - return calculated size, depending on largeSize set or not

func (*MdatBox) Type

func (m *MdatBox) Type() string

Type - return box type

type MdhdBox

type MdhdBox struct {
	Version          byte // Only version 0
	Flags            uint32
	CreationTime     uint64 // Typically not set
	ModificationTime uint64 // Typically not set
	Timescale        uint32 // Media timescale for this track
	Duration         uint64 // Trak duration, 0 for fragmented files
	Language         uint16 // Three-letter ISO-639-2/T language code
}

MdhdBox - Media Header Box (mdhd - mandatory)

Contained in : Media Box (mdia)

Timescale defines the timescale used for this track. Language is a ISO-639-2/T language code stored as 1bit padding + [3]int5

func (*MdhdBox) Encode

func (m *MdhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*MdhdBox) GetLanguage

func (m *MdhdBox) GetLanguage() string

GetLanguage - Get three-byte language string

func (*MdhdBox) Info

func (m *MdhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MdhdBox) SetLanguage

func (m *MdhdBox) SetLanguage(lang string)

SetLanguage - Set three-byte language string

func (*MdhdBox) Size

func (m *MdhdBox) Size() uint64

Size - calculated size of box

func (*MdhdBox) Type

func (m *MdhdBox) Type() string

Type - box type

type MdiaBox

type MdiaBox struct {
	Mdhd     *MdhdBox
	Hdlr     *HdlrBox
	Elng     *ElngBox
	Minf     *MinfBox
	Elst     *ElstBox
	Children []Box
}

MdiaBox - Media Box (mdia)

Contained in : Track Box (trak) Contains all information about the media data.

func NewMdiaBox

func NewMdiaBox() *MdiaBox

NewMdiaBox - Generate a new empty mdia box

func (*MdiaBox) AddChild

func (m *MdiaBox) AddChild(box Box)

AddChild - Add a child box

func (*MdiaBox) Encode

func (m *MdiaBox) Encode(w io.Writer) error

Encode - write mdia container to w

func (*MdiaBox) GetChildren

func (m *MdiaBox) GetChildren() []Box

GetChildren - list of child boxes

func (*MdiaBox) Info

func (m *MdiaBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MdiaBox) Size

func (m *MdiaBox) Size() uint64

Size - return calculated size

func (*MdiaBox) Type

func (m *MdiaBox) Type() string

Type - return box type

type MediaSegment

type MediaSegment struct {
	Styp      *StypBox
	Sidx      *SidxBox // Sidx for a segment
	Fragments []*Fragment
}

MediaSegment - MP4 Media Segment

func NewMediaSegment

func NewMediaSegment() *MediaSegment

NewMediaSegment - New empty MediaSegment

func (*MediaSegment) AddFragment

func (s *MediaSegment) AddFragment(f *Fragment)

AddFragment - Add a fragment to a MediaSegment

func (*MediaSegment) Encode

func (s *MediaSegment) Encode(w io.Writer) error

Encode - Write MediaSegment via writer

func (*MediaSegment) EncodeVerbatim

func (s *MediaSegment) EncodeVerbatim(w io.Writer) error

EncodeVerbatim - Write MediaSegment via writer with verbatim Fragments

func (*MediaSegment) Fragmentify

func (s *MediaSegment) Fragmentify(timescale uint64, trex *TrexBox, duration uint32) ([]*Fragment, error)

Fragmentify - Split into multiple fragments. Assume single mdat and trun for now

func (*MediaSegment) Info

func (m *MediaSegment) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - write box tree with indent for each level

func (*MediaSegment) LastFragment

func (s *MediaSegment) LastFragment() *Fragment

LastFragment - Currently last fragment

type MehdBox

type MehdBox struct {
	Version          byte
	Flags            uint32
	FragmentDuration int64
}

MehdBox - Movie Extends Header Box Optional, provides overall duration of a fragmented movie

func (*MehdBox) Encode

func (b *MehdBox) Encode(w io.Writer) error

Encode - write box to w

func (*MehdBox) Info

func (b *MehdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Dump - write MehBox details.

func (*MehdBox) Size

func (b *MehdBox) Size() uint64

Size - return calculated size

func (*MehdBox) Type

func (b *MehdBox) Type() string

Type - return box type

type MetaBox

type MetaBox struct {
	Version  byte
	Flags    uint32
	Hdlr     *HdlrBox
	Children []Box
}

MetaBox - MetaBox meta ISO/IEC 14496-12 Ed. 6 2020 Section 8.11

func CreateMetaBox

func CreateMetaBox(version byte, hdlr *HdlrBox) *MetaBox

CreateMetaBox - Create a new MetaBox

func (*MetaBox) AddChild

func (b *MetaBox) AddChild(box Box)

AddChild - Add a child box

func (*MetaBox) Encode

func (b *MetaBox) Encode(w io.Writer) error

Encode - write minf container to w

func (*MetaBox) GetChildren

func (b *MetaBox) GetChildren() []Box

GetChildren - list of child boxes

func (*MetaBox) Info

func (b *MetaBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MetaBox) Size

func (b *MetaBox) Size() uint64

Size - calculated size of box

func (*MetaBox) Type

func (b *MetaBox) Type() string

Type - box type

type MfhdBox

type MfhdBox struct {
	Version        byte
	Flags          uint32
	SequenceNumber uint32
}

MfhdBox - Media Fragment Header Box (mfhd)

Contained in : Movie Fragment box (moof))

func CreateMfhd

func CreateMfhd(sequenceNumber uint32) *MfhdBox

CreateMfhd - create an MfhdBox

func (*MfhdBox) Encode

func (m *MfhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*MfhdBox) Info

func (m *MfhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MfhdBox) Size

func (m *MfhdBox) Size() uint64

Size - calculated size of box

func (*MfhdBox) Type

func (m *MfhdBox) Type() string

Type - box type

type MfraBox

type MfraBox struct {
	Tfra     *TfraBox
	Tfras    []*TfraBox
	Mfro     *MfroBox
	Children []Box
	StartPos uint64
}

MfraBox - Movie Fragment Random Access Box (mfra) Container for TfraBox(es) that can be used to find sync samples

func (*MfraBox) AddChild

func (m *MfraBox) AddChild(child Box) error

AddChild - add child box

func (*MfraBox) Encode

func (m *MfraBox) Encode(w io.Writer) error

Encode - byte-specific encode

func (*MfraBox) GetChildren

func (m *MfraBox) GetChildren() []Box

GetChildren - list of child boxes

func (*MfraBox) Info

func (m *MfraBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MfraBox) Size

func (m *MfraBox) Size() uint64

Size - returns calculated size

func (*MfraBox) Type

func (m *MfraBox) Type() string

Type - returns box type

type MfroBox

type MfroBox struct {
	Version    byte
	Flags      uint32
	ParentSize uint32
}

MfroBox - Movie Fragment Random Access Offset Box (mfro) Contained in : MfraBox (mfra)

func (*MfroBox) Encode

func (b *MfroBox) Encode(w io.Writer) error

Encode - write box to w

func (*MfroBox) Info

func (t *MfroBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MfroBox) Size

func (b *MfroBox) Size() uint64

Size - return calculated size

func (*MfroBox) Type

func (b *MfroBox) Type() string

Type - return box type

type MinfBox

type MinfBox struct {
	Vmhd     *VmhdBox
	Smhd     *SmhdBox
	Stbl     *StblBox
	Dinf     *DinfBox
	Hdlr     *HdlrBox
	Children []Box
}

MinfBox - Media Information Box (minf - mandatory)

Contained in : Media Box (mdia)

func NewMinfBox

func NewMinfBox() *MinfBox

NewMinfBox - Generate a new empty minf box

func (*MinfBox) AddChild

func (m *MinfBox) AddChild(box Box)

AddChild - Add a child box

func (*MinfBox) Encode

func (m *MinfBox) Encode(w io.Writer) error

Encode - write minf container to w

func (*MinfBox) GetChildren

func (m *MinfBox) GetChildren() []Box

GetChildren - list of child boxes

func (*MinfBox) Info

func (m *MinfBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MinfBox) Size

func (m *MinfBox) Size() uint64

Size - calculated size of box

func (*MinfBox) Type

func (m *MinfBox) Type() string

Type - box type

type MoofBox

type MoofBox struct {
	Mfhd     *MfhdBox
	Traf     *TrafBox // The first traf child box
	Trafs    []*TrafBox
	Children []Box
	StartPos uint64
}

MoofBox - Movie Fragment Box (moof)

Contains all meta-data. To be able to stream a file, the moov box should be placed before the mdat box.

func (*MoofBox) AddChild

func (m *MoofBox) AddChild(b Box) error

AddChild - add child box

func (*MoofBox) Encode

func (m *MoofBox) Encode(w io.Writer) error

Encode - write moof after updating trun dataoffset

func (*MoofBox) GetChildren

func (m *MoofBox) GetChildren() []Box

GetChildren - list of child boxes

func (*MoofBox) Info

func (m *MoofBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MoofBox) Size

func (m *MoofBox) Size() uint64

Size - returns calculated size

func (*MoofBox) Type

func (m *MoofBox) Type() string

Type - returns box type

type MoovBox

type MoovBox struct {
	Mvhd     *MvhdBox
	Trak     *TrakBox // The first trak box
	Traks    []*TrakBox
	Mvex     *MvexBox
	Children []Box
}

MoovBox - Movie Box (moov - mandatory)

Contains all meta-data. To be able to stream a file, the moov box should be placed before the mdat box.

func NewMoovBox

func NewMoovBox() *MoovBox

NewMoovBox - Generate a new empty moov box

func (*MoovBox) AddChild

func (m *MoovBox) AddChild(box Box)

AddChild - Add a child box

func (*MoovBox) Encode

func (m *MoovBox) Encode(w io.Writer) error

Encode - write moov container to w

func (*MoovBox) GetChildren

func (m *MoovBox) GetChildren() []Box

GetChildren - list of child boxes

func (*MoovBox) Info

func (m *MoovBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MoovBox) Size

func (m *MoovBox) Size() uint64

Size - calculated size of box

func (*MoovBox) Type

func (m *MoovBox) Type() string

Type - box type

type MvexBox

type MvexBox struct {
	Mehd     *MehdBox
	Trex     *TrexBox
	Trexs    []*TrexBox
	Children []Box
}

MvexBox - MovieExtendsBox (mevx)

Contained in : Movie Box (moov)

Its presence signals a fragmented asset

func NewMvexBox

func NewMvexBox() *MvexBox

NewMvexBox - Generate a new empty mvex box

func (*MvexBox) AddChild

func (m *MvexBox) AddChild(box Box)

AddChild - Add a child box

func (*MvexBox) Encode

func (m *MvexBox) Encode(w io.Writer) error

Encode - write mvex container to w

func (*MvexBox) GetChildren

func (t *MvexBox) GetChildren() []Box

GetChildren - list of child boxes

func (*MvexBox) Info

func (m *MvexBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MvexBox) Size

func (m *MvexBox) Size() uint64

Size - return calculated size

func (*MvexBox) Type

func (m *MvexBox) Type() string

Type - return box type

type MvhdBox

type MvhdBox struct {
	Version          byte
	Flags            uint32
	CreationTime     uint64
	ModificationTime uint64
	Timescale        uint32
	Duration         uint64
	NextTrackID      uint32
	Rate             Fixed32
	Volume           Fixed16
}

MvhdBox - Movie Header Box (mvhd - mandatory)

Contained in : Movie Box (‘moov’)

Contains all media information (duration, ...).

Duration is measured in "time units", and timescale defines the number of time units per second.

func CreateMvhd

func CreateMvhd() *MvhdBox

CreateMvhd - create mvhd box with reasonable values

func (*MvhdBox) Encode

func (b *MvhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*MvhdBox) Info

func (b *MvhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*MvhdBox) Size

func (b *MvhdBox) Size() uint64

Size - return calculated size

func (*MvhdBox) Type

func (b *MvhdBox) Type() string

Type - return box type

type NmhdBox

type NmhdBox struct {
	Version byte
	Flags   uint32
}

NmhdBox - Null Media Header Box (nmhd - often used instead ofsthd for subtitle tracks)

func (*NmhdBox) Encode

func (b *NmhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*NmhdBox) Info

func (b *NmhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*NmhdBox) Size

func (b *NmhdBox) Size() uint64

Size - calculated size of box

func (*NmhdBox) Type

func (b *NmhdBox) Type() string

Type - box-specific type

type PaspBox

type PaspBox struct {
	HSpacing uint32
	VSpacing uint32
}

PaspBox - Pixel Aspect Ratio Box, ISO/IEC 14496-12 2020 Sec. 12.1.4

func (*PaspBox) Encode

func (b *PaspBox) Encode(w io.Writer) error

Encode - write box to w

func (*PaspBox) Info

func (b *PaspBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*PaspBox) Size

func (b *PaspBox) Size() uint64

Size - calculated size of box

func (*PaspBox) Type

func (b *PaspBox) Type() string

Type - box type

type PaylBox

type PaylBox struct {
	CueText string
}

PaylBox - CuePayloadBox (payl)

func (*PaylBox) Encode

func (p *PaylBox) Encode(w io.Writer) error

Encode - write box to w

func (*PaylBox) Info

func (p *PaylBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*PaylBox) Size

func (p *PaylBox) Size() uint64

Size - calculated size of box

func (*PaylBox) Type

func (p *PaylBox) Type() string

Type - box-specific type

type PrftBox

type PrftBox struct {
	Version      byte
	Flags        uint32
	NTPTimestamp uint64
	MediaTime    uint64
}

PrftBox - Producer Reference Box (prft)

Contained in File before moof box

func CreatePrftBox

func CreatePrftBox(version byte, ntp uint64, mediatime uint64) *PrftBox

CreatePrftBox - Create a new PrftBox

func (*PrftBox) Encode

func (p *PrftBox) Encode(w io.Writer) error

Encode - write box to w

func (*PrftBox) Info

func (p *PrftBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*PrftBox) Size

func (p *PrftBox) Size() uint64

Size - return calculated size

func (*PrftBox) Type

func (p *PrftBox) Type() string

Type - return box type

type PsshBox

type PsshBox struct {
	Version  byte
	Flags    uint32
	SystemID UUID
	KIDs     []UUID
	Data     []byte
}

PsshBox - Protection System Specific Header Box Defined in ISO/IEC 23001-7 Secion 8.1

func (*PsshBox) Encode

func (b *PsshBox) Encode(w io.Writer) error

Encode - write box to w

func (*PsshBox) Info

func (b *PsshBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*PsshBox) Size

func (b *PsshBox) Size() uint64

Size - return calculated size

func (*PsshBox) Type

func (b *PsshBox) Type() string

Type - return box type

type RapSampleGroupEntry

type RapSampleGroupEntry struct {
	NumLeadingSamplesKnown uint8
	NumLeadingSamples      uint8
}

RapSampleGroupEntry - Random Access Point "rap "

ISO/IEC 14496-12 Ed. 6 2020 Section 10.4 - VisualRandomAccessEntry

func (*RapSampleGroupEntry) Encode

func (s *RapSampleGroupEntry) Encode(sw *SliceWriter)

func (*RapSampleGroupEntry) Info

func (s *RapSampleGroupEntry) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*RapSampleGroupEntry) Size

func (s *RapSampleGroupEntry) Size() uint64

func (*RapSampleGroupEntry) Type

func (s *RapSampleGroupEntry) Type() string

type RollSampleGroupEntry

type RollSampleGroupEntry struct {
	RollDistance int16
}

RollSampleGroupEntry - Gradual Decoding Refresh "roll"

ISO/IEC 14496-12 Ed. 6 2020 Section 10.1

VisualRollRecoveryEntry / AudioRollRecoveryEntry / AudioPreRollEntry

func (*RollSampleGroupEntry) Encode

func (s *RollSampleGroupEntry) Encode(sw *SliceWriter)

func (*RollSampleGroupEntry) Info

func (s *RollSampleGroupEntry) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*RollSampleGroupEntry) Size

func (s *RollSampleGroupEntry) Size() uint64

func (*RollSampleGroupEntry) Type

func (s *RollSampleGroupEntry) Type() string

type SaioBox

type SaioBox struct {
	Version              byte
	Flags                uint32
	AuxInfoType          string // Used for Common Encryption Scheme (4-bytes uint32 according to spec)
	AuxInfoTypeParameter uint32
	Offset               []int64
}

SaioBox - Sample Auxiliary Information Offsets Box (saiz)

func (*SaioBox) Encode

func (b *SaioBox) Encode(w io.Writer) error

Encode - write box to w

func (*SaioBox) Info

func (b *SaioBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write SaioBox details. Get offset list with level >= 1

func (*SaioBox) Size

func (b *SaioBox) Size() uint64

Size - return calculated size

func (*SaioBox) Type

func (b *SaioBox) Type() string

Type - return box type

type SaizBox

type SaizBox struct {
	Version               byte
	Flags                 uint32
	AuxInfoType           string // Used for Common Encryption Scheme (4-bytes uint32 according to spec)
	AuxInfoTypeParameter  uint32
	SampleCount           uint32
	SampleInfo            []byte
	DefaultSampleInfoSize byte
}

SaizBox - Sample Auxiliary Information Sizes Box (saiz)

func (*SaizBox) Encode

func (b *SaizBox) Encode(w io.Writer) error

Encode - write box to w

func (*SaizBox) Info

func (b *SaizBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write SaizBox details. Get sampleInfo list with level >= 1

func (*SaizBox) Size

func (b *SaizBox) Size() uint64

Size - return calculated size

func (*SaizBox) Type

func (b *SaizBox) Type() string

Type - return box type

type Sample

type Sample struct {
	Flags uint32 // interpreted as SampleFlags
	Dur   uint32 // Sample duration in mdhd timescale
	Size  uint32 // Size of sample data
	Cto   int32  // Signed composition time offset
}

Sample - sample as used in trun box (mdhd timescale)

func NewSample

func NewSample(flags uint32, dur uint32, size uint32, cto int32) *Sample

NewSample - create Sample with trun data

func (*Sample) IsSync

func (s *Sample) IsSync() bool

IsSync - check sync by masking flags including dependsOn

type SampleFlags

type SampleFlags struct {
	IsLeading                 byte
	SampleDependsOn           byte
	SampleIsDependedOn        byte
	SampleHasRedundancy       byte
	SamplePaddingValue        byte
	SampleIsNonSync           bool
	SampleDegradationPriority uint16
}

SampleFlags according to 14496-12 Sec. 8.8.3.1

func DecodeSampleFlags

func DecodeSampleFlags(u uint32) SampleFlags

DecodeSampleFlags - decode a uint32 flags field

func (SampleFlags) Encode

func (sf SampleFlags) Encode() uint32

func (SampleFlags) String

func (sf SampleFlags) String() string

type SampleGroupEntry

type SampleGroupEntry interface {
	// GroupingType SampleGroupEntry (uint32 according to spec)
	Type() string // actually
	// Size of SampleGroup Entry
	Size() uint64
	// Encode SampleGroupEntry to SliceWriter
	Encode(sw *SliceWriter)
	// Info - description of content.
	Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)
}

SampleGroupEntry - like a box, but size and type are not in a header

func DecodeAlstSampleGroupEntry

func DecodeAlstSampleGroupEntry(name string, length uint32, sr *SliceReader) (SampleGroupEntry, error)

func DecodeRapSampleGroupEntry

func DecodeRapSampleGroupEntry(name string, length uint32, sr *SliceReader) (SampleGroupEntry, error)

func DecodeRollSampleGroupEntry

func DecodeRollSampleGroupEntry(name string, length uint32, sr *SliceReader) (SampleGroupEntry, error)

func DecodeSeigSampleGroupEntry

func DecodeSeigSampleGroupEntry(name string, length uint32, sr *SliceReader) (SampleGroupEntry, error)

DecodeSeigSampleGroupEntry - decode Commone Encryption Sample Group Entry

func DecodeUnknownSampleGroupEntry

func DecodeUnknownSampleGroupEntry(name string, length uint32, sr *SliceReader) (SampleGroupEntry, error)

type SampleGroupEntryDecoder

type SampleGroupEntryDecoder func(name string, length uint32, sr *SliceReader) (SampleGroupEntry, error)

SampleGroupEntryDecoder is function signature of the SampleGroupEntry Decode method

type SbgpBox

type SbgpBox struct {
	Version                 byte
	Flags                   uint32
	GroupingType            string // uint32, but takes values such as seig
	GroupingTypeParameter   uint32
	SampleCounts            []uint32
	GroupDescriptionIndices []uint32
}

SbgpBox - Sample To Group Box, ISO/IEC 14496-12 6'th edition 2020 Section 8.9.2

func (*SbgpBox) Encode

func (b *SbgpBox) Encode(w io.Writer) error

Encode - write box to w

func (*SbgpBox) Info

func (b *SbgpBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*SbgpBox) Size

func (b *SbgpBox) Size() uint64

Size - return calculated size

func (*SbgpBox) Type

func (b *SbgpBox) Type() string

Type - return box type

type SchiBox

type SchiBox struct {
	Children []Box
}

SchiBox - Schema Information Box

func (*SchiBox) AddChild

func (b *SchiBox) AddChild(box Box)

AddChild - Add a child box

func (*SchiBox) Encode

func (b *SchiBox) Encode(w io.Writer) error

Encode - write minf container to w

func (*SchiBox) GetChildren

func (b *SchiBox) GetChildren() []Box

GetChildren - list of child boxes

func (*SchiBox) Info

func (b *SchiBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SchiBox) Size

func (b *SchiBox) Size() uint64

Size - calculated size of box

func (*SchiBox) Type

func (b *SchiBox) Type() string

Type - box type

type SchmBox

type SchmBox struct {
	Version       byte
	Flags         uint32
	SchemeType    string // 4CC represented as uint32
	SchemeVersion uint32
	SchemeUri     string // Absolute null-terminated URL
}

SchmBox - Scheme Type Box

func (*SchmBox) Encode

func (b *SchmBox) Encode(w io.Writer) error

Encode - write box to w

func (*SchmBox) Info

func (b *SchmBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*SchmBox) Size

func (b *SchmBox) Size() uint64

Size - return calculated size

func (*SchmBox) Type

func (b *SchmBox) Type() string

Type - return box type

type SdtpBox

type SdtpBox struct {
	Version byte
	Flags   uint32
	Entries []SdtpEntry
}

SdtpBox - Sample Dependency Box (sdtp - optional)

ISO/IEC 14496-12 Ed. 6 2020 Section 8.6.4 Contained in Sample Table Box (stbl)

Table to determine whether a sample depends or is depended on by other samples

func CreateSdtpBox

func CreateSdtpBox(entries []SdtpEntry) *SdtpBox

CreateSdtpBox - Create a new SdtpBox

func (*SdtpBox) Encode

func (b *SdtpBox) Encode(w io.Writer) error

Encode - write box to w

func (*SdtpBox) Info

func (b *SdtpBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SdtpBox) Size

func (b *SdtpBox) Size() uint64

Size - return calculated size

func (*SdtpBox) Type

func (b *SdtpBox) Type() string

Type - return box type

type SdtpEntry

type SdtpEntry uint8

SdtpEntry (uint8)

ISO/IEC 14496-12 Ed. 6 2020 Section 8.6.4.2

func NewSdtpEntry

func NewSdtpEntry(isLeading, sampleDependsOn, sampleDependedOn, hasRedundancy uint8) SdtpEntry

NewSdtpEntry - make new SdtpEntry from 2-bit parameters

func (SdtpEntry) IsLeading

func (entry SdtpEntry) IsLeading() uint8

IsLeading (bits 0-1) 0: Leading unknown 1: Has dependency before referenced I-picture (not decodable) 2: Not a leading sample 3: Has no dependency before referenced I-picture (decodable)

func (SdtpEntry) SampleDependsOn

func (entry SdtpEntry) SampleDependsOn() uint8

SampleDependsOn (bits 2-3) 0: Dependency is unknown 1: Depends on others (not an I-picture) 2: Does not depend on others (I-picture) 3: Reservced

func (SdtpEntry) SampleHasRedundancy

func (entry SdtpEntry) SampleHasRedundancy() uint8

SampleIsDependedOn (bits 6-7) 0: Redundant coding unknown 1: Redundant coding in this sample 2: No redundant coding in this sample 3: Reserved

func (SdtpEntry) SampleIsDependedOn

func (entry SdtpEntry) SampleIsDependedOn() uint8

SampleIsDependedOn (bits 4-5) 0: Dependency unknown 1: Other samples may depend on this (not disposable) 2: No other samples depend on this (disposable) 3: Reserved

type SeigSampleGroupEntry

type SeigSampleGroupEntry struct {
	CryptByteBlock  byte
	SkipByteBlock   byte
	IsProtected     byte
	PerSampleIVSize byte
	KID             UUID
	// ConstantIVSize byte given by len(ConstantIV)
	ConstantIV []byte
}

SeigSampleGroupEntry - CencSampleEncryptionInformationGroupEntry as defined in CEF ISO/IEC 23001-7 3rd edition 2016

func (*SeigSampleGroupEntry) Encode

func (s *SeigSampleGroupEntry) Encode(sw *SliceWriter)

func (*SeigSampleGroupEntry) Info

func (s *SeigSampleGroupEntry) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*SeigSampleGroupEntry) Size

func (s *SeigSampleGroupEntry) Size() uint64

func (*SeigSampleGroupEntry) Type

func (s *SeigSampleGroupEntry) Type() string

type SencBox

type SencBox struct {
	Version     byte
	Flags       uint32
	SampleCount uint32
	IVs         []InitializationVector // 8 or 16 bytes if present
	SubSamples  [][]SubSamplePattern
}

SencBox - Sample Encryption Box (senc) See ISO/IEC 23001-7 Section 7.2 Full Box + SampleCount

func CreateSencBox

func CreateSencBox() *SencBox

CreateSendBox - create an empty SencBox

func (*SencBox) AddSample

func (s *SencBox) AddSample(sample SencSample) error

AddSample - add a senc sample with possible IV and subsamples

func (*SencBox) Encode

func (s *SencBox) Encode(w io.Writer) error

Encode - box-specific encode

func (*SencBox) GetPerSampleIVSize

func (s *SencBox) GetPerSampleIVSize() int

func (*SencBox) Info

func (s *SencBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SencBox) Size

func (s *SencBox) Size() uint64

Size - box-specific type

func (*SencBox) Type

func (s *SencBox) Type() string

Type - box-specific type

type SencSample

type SencSample struct {
	IV         InitializationVector // 0,8,16 byte length
	SubSamples []SubSamplePattern
}

SencSample - sample in SencBox

type SgpdBox

type SgpdBox struct {
	Version                      byte
	Flags                        uint32
	GroupingType                 string // uint32, but takes values such as seig
	DefaultLength                uint32
	DefaultGroupDescriptionIndex uint32
	DescriptionLengths           []uint32
	SampleGroupEntries           []SampleGroupEntry
}

SgpdBox - Sample Group Description Box, ISO/IEC 14496-12 6'th edition 2020 Section 8.9.3 Version 0 is deprecated

func (*SgpdBox) Encode

func (b *SgpdBox) Encode(w io.Writer) error

Encode - write box to w

func (*SgpdBox) Info

func (b *SgpdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*SgpdBox) Size

func (b *SgpdBox) Size() uint64

Size - return calculated size

func (*SgpdBox) Type

func (b *SgpdBox) Type() string

Type - return box type

type SidxBox

type SidxBox struct {
	Version                  byte
	Flags                    uint32
	ReferenceID              uint32
	Timescale                uint32
	EarliestPresentationTime uint64
	FirstOffset              uint64
	SidxRefs                 []SidxRef
}

SidxBox - SegmentIndexBox

func CreateSidx

func CreateSidx(baseMediaDecodeTime uint64) *SidxBox

CreateSidx - Create a new TfdtBox with baseMediaDecodeTime

func (*SidxBox) Encode

func (b *SidxBox) Encode(w io.Writer) error

Encode - write box to w

func (*SidxBox) Info

func (b *SidxBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - more info for level 1

func (*SidxBox) Size

func (b *SidxBox) Size() uint64

Size - return calculated size

func (*SidxBox) Type

func (b *SidxBox) Type() string

Type - return box type

type SidxRef

type SidxRef struct {
	ReferencedSize     uint32
	SubSegmentDuration uint32
	SAPDeltaTime       uint32
	ReferenceType      uint8 // 1-bit
	StartsWithSAP      uint8 // 1-bit
	SAPType            uint8
}

SidxRef - reference as used inside SidxBox

type SinfBox

type SinfBox struct {
	Frma     *FrmaBox // Mandatory
	Schm     *SchmBox // Optional
	Schi     *SchiBox // Optional
	Children []Box
}

SchiBox - Protection Scheme Information Box

func (*SinfBox) AddChild

func (b *SinfBox) AddChild(box Box)

AddChild - Add a child box

func (*SinfBox) Encode

func (b *SinfBox) Encode(w io.Writer) error

Encode - write minf container to w

func (*SinfBox) GetChildren

func (b *SinfBox) GetChildren() []Box

GetChildren - list of child boxes

func (*SinfBox) Info

func (b *SinfBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SinfBox) Size

func (b *SinfBox) Size() uint64

Size - calculated size of box

func (*SinfBox) Type

func (b *SinfBox) Type() string

Type - box type

type SliceReader

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

SliceReader - read integers from a slice

func NewSliceReader

func NewSliceReader(data []byte) *SliceReader

NewSliceReader - create a new slice reader reading from data

func (*SliceReader) GetPos

func (s *SliceReader) GetPos() int

GetPos - get read position is slice

func (*SliceReader) Length

func (s *SliceReader) Length() int

Length - get length of slice

func (*SliceReader) NrRemainingBytes

func (s *SliceReader) NrRemainingBytes() int

NrRemaingingByts - return number of bytes remaining

func (*SliceReader) ReadBytes

func (s *SliceReader) ReadBytes(n int) []byte

ReadBytes - read a slice of bytes

func (*SliceReader) ReadFixedLengthString

func (s *SliceReader) ReadFixedLengthString(length int) string

ReadFixedLengthString - read string of specified length

func (*SliceReader) ReadInt16

func (s *SliceReader) ReadInt16() int16

ReadInt16 - read int16 from slice

func (*SliceReader) ReadInt32

func (s *SliceReader) ReadInt32() int32

ReadInt32 - read int32 from slice

func (*SliceReader) ReadInt64

func (s *SliceReader) ReadInt64() int64

ReadInt64 - read int64 from slice

func (*SliceReader) ReadUint16

func (s *SliceReader) ReadUint16() uint16

ReadUint16 - read uint16 from slice

func (*SliceReader) ReadUint24

func (s *SliceReader) ReadUint24() uint32

ReadUint24 - read uint24 from slice

func (*SliceReader) ReadUint32

func (s *SliceReader) ReadUint32() uint32

ReadUint32 - read uint32 from slice

func (*SliceReader) ReadUint64

func (s *SliceReader) ReadUint64() uint64

ReadUint64 - read uint64 from slice

func (*SliceReader) ReadUint8

func (s *SliceReader) ReadUint8() byte

ReadUint8 - read uint8 from slice

func (*SliceReader) ReadZeroTerminatedString

func (s *SliceReader) ReadZeroTerminatedString() (string, error)

ReadZeroTerminatedString - read string until zero

func (*SliceReader) RemainingBytes

func (s *SliceReader) RemainingBytes() []byte

RemainingBytes - return remaining bytes of this slice

func (*SliceReader) SetPos

func (s *SliceReader) SetPos(pos int)

SetPos - set read position is slice

func (*SliceReader) SkipBytes

func (s *SliceReader) SkipBytes(n int)

SkipBytes - skip passed n bytes

type SliceWriter

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

SliceWriter - write numbers to a []byte slice

func NewSliceWriter

func NewSliceWriter(data []byte) *SliceWriter

NewSliceWriter - create writer around slice

func (*SliceWriter) WriteBytes

func (b *SliceWriter) WriteBytes(byteSlice []byte)

WriteBytes - write []byte

func (*SliceWriter) WriteInt16

func (b *SliceWriter) WriteInt16(n int16)

WriteInt16 - write int16 to slice

func (*SliceWriter) WriteInt32

func (b *SliceWriter) WriteInt32(n int32)

WriteInt32 - write int32 to slice

func (*SliceWriter) WriteInt64

func (b *SliceWriter) WriteInt64(n int64)

WriteInt64 - write int64 to slice

func (*SliceWriter) WriteString

func (b *SliceWriter) WriteString(s string, addZeroEnd bool)

WriteString - write string to slice with or without zero end

func (*SliceWriter) WriteUint16

func (b *SliceWriter) WriteUint16(n uint16)

WriteUint16 - write uint16 to slice

func (*SliceWriter) WriteUint24

func (b *SliceWriter) WriteUint24(n uint32)

WriteUint24 - write uint24 to slice

func (*SliceWriter) WriteUint32

func (b *SliceWriter) WriteUint32(n uint32)

WriteUint32 - write uint32 to slice

func (*SliceWriter) WriteUint64

func (b *SliceWriter) WriteUint64(n uint64)

WriteUint64 - write uint64 to slice

func (*SliceWriter) WriteUint8

func (b *SliceWriter) WriteUint8(n byte)

WriteUint8 - write byte to slice

func (*SliceWriter) WriteUnityMatrix

func (b *SliceWriter) WriteUnityMatrix()

WriteUnityMatrix - write a unity matrix for mvhd or tkhd

func (*SliceWriter) WriteZeroBytes

func (b *SliceWriter) WriteZeroBytes(n int)

WriteZeroBytes - write n byte of zeroes

type SmhdBox

type SmhdBox struct {
	Version byte
	Flags   uint32
	Balance uint16 // should be int16
}

SmhdBox - Sound Media Header Box (smhd - mandatory for sound tracks)

Contained in : Media Information Box (minf)

func CreateSmhd

func CreateSmhd() *SmhdBox

CreateSmhd - Create Sound Media Header Box (all is zero)

func (*SmhdBox) Encode

func (b *SmhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*SmhdBox) Info

func (b *SmhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SmhdBox) Size

func (b *SmhdBox) Size() uint64

Size - calculated size of box

func (*SmhdBox) Type

func (b *SmhdBox) Type() string

Type - box type

type StblBox

type StblBox struct {
	// Same order as in Table 1 in ISO/IEC 14496-12 Ed.6 2020
	Stsd  *StsdBox
	Stts  *SttsBox
	Ctts  *CttsBox
	Stsc  *StscBox
	Stsz  *StszBox
	Stss  *StssBox
	Stco  *StcoBox
	Co64  *Co64Box
	Sdtp  *SdtpBox
	Sbgp  *SbgpBox   // The first
	Sbgps []*SbgpBox // All
	Sgpd  *SgpdBox   // The first
	Sgpds []*SgpdBox // All
	Subs  *SubsBox
	Saiz  *SaizBox
	Saio  *SaioBox

	Children []Box
}

StblBox - Sample Table Box (stbl - mandatory)

Contained in : Media Information Box (minf)

The table contains all information relevant to data samples (times, chunks, sizes, ...)

func NewStblBox

func NewStblBox() *StblBox

NewStblBox - Generate a new empty stbl box

func (*StblBox) AddChild

func (s *StblBox) AddChild(box Box)

AddChild - Add a child box

func (*StblBox) Encode

func (s *StblBox) Encode(w io.Writer) error

Encode - write stbl container to w

func (*StblBox) GetChildren

func (s *StblBox) GetChildren() []Box

GetChildren - list of child boxes

func (*StblBox) Info

func (s *StblBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StblBox) Size

func (s *StblBox) Size() uint64

Size - box-specific size

func (*StblBox) Type

func (s *StblBox) Type() string

Type - box-specific type

type StcoBox

type StcoBox struct {
	Version     byte
	Flags       uint32
	ChunkOffset []uint32
}

StcoBox - Chunk Offset Box (stco - mandatory)

Contained in : Sample Table box (stbl)

This is the 32bits version of the box, the 64bits version (co64) is not decoded.

The table contains the offsets (starting at the beginning of the file) for each chunk of data for the current track. A chunk contains samples, the table defining the allocation of samples to each chunk is stsc.

func (*StcoBox) Encode

func (b *StcoBox) Encode(w io.Writer) error

Encode - box-specific encode

func (*StcoBox) Info

func (b *StcoBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StcoBox) Size

func (b *StcoBox) Size() uint64

Size - box-specific size

func (*StcoBox) Type

func (b *StcoBox) Type() string

Type - box-specific type

type SthdBox

type SthdBox struct {
	Version byte
	Flags   uint32
}

SthdBox - Subtitle Media Header Box (sthd - for subtitle tracks)

func (*SthdBox) Encode

func (b *SthdBox) Encode(w io.Writer) error

Encode - write box to w

func (*SthdBox) Info

func (b *SthdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SthdBox) Size

func (b *SthdBox) Size() uint64

Size - calculated size of box

func (*SthdBox) Type

func (b *SthdBox) Type() string

Type - box-specific type

type StppBox

type StppBox struct {
	Namespace          string   // Mandatory
	SchemaLocation     string   // Optional
	AuxiliaryMimeTypes string   // Required if auxiliary types present
	Btrt               *BtrtBox // Optional
	Children           []Box
	DataReferenceIndex uint16
}

StppBox - XMLSubtitleSampleEntryr Box (stpp)

Contained in : Media Information Box (minf)

func NewStppBox

func NewStppBox(namespace, schemaLocation, auxiliaryMimeTypes string) *StppBox

NewStppBox - Create new stpp box

func (*StppBox) AddChild

func (w *StppBox) AddChild(box Box)

AddChild - add a child box (avcC normally, but clap and pasp could be part of visual entry)

func (*StppBox) Encode

func (s *StppBox) Encode(w io.Writer) error

Encode - write box to w

func (*StppBox) Info

func (s *StppBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StppBox) Size

func (s *StppBox) Size() uint64

Size - return calculated size

func (*StppBox) Type

func (s *StppBox) Type() string

Type - return box type

type StscBox

type StscBox struct {
	Version             byte
	Flags               uint32
	FirstChunk          []uint32
	SamplesPerChunk     []uint32
	SampleDescriptionID []uint32
}

StscBox - Sample To Chunk Box (stsc - mandatory)

A chunk contains samples. This table defines to which chunk a sample is associated. Each entry is defined by :

  • first chunk : all chunks starting at this index up to the next first chunk have the same sample count/description
  • samples per chunk : number of samples in the chunk
  • description id : description (see the sample description box - stsd)

func (*StscBox) ChunkNrFromSampleNr

func (b *StscBox) ChunkNrFromSampleNr(sampleNr int) (chunkNr, firstSampleInChunk int, err error)

ChunkNrFromSampleNr - get chunk number from sampleNr (one-based)

func (*StscBox) Encode

func (b *StscBox) Encode(w io.Writer) error

Encode - box-specific encode

func (*StscBox) Info

func (b *StscBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StscBox) Size

func (b *StscBox) Size() uint64

Size - box-specfic size

func (*StscBox) Type

func (b *StscBox) Type() string

Type box-specific type

type StsdBox

type StsdBox struct {
	Version     byte
	Flags       uint32
	SampleCount uint32
	AvcX        *VisualSampleEntryBox
	HvcX        *VisualSampleEntryBox
	Mp4a        *AudioSampleEntryBox
	Wvtt        *WvttBox
	Children    []Box
}

StsdBox - Sample Description Box (stsd - manatory) See ISO/IEC 14496-12 Section 8.5.2.2 Full Box + SampleCount All Children are sampleEntries

func NewStsdBox

func NewStsdBox() *StsdBox

NewStsdBox - Generate a new empty stsd box

func (*StsdBox) AddChild

func (s *StsdBox) AddChild(box Box)

AddChild - Add a child box and update SampleCount

func (*StsdBox) Encode

func (s *StsdBox) Encode(w io.Writer) error

Encode - box-specific encode of stsd - not a usual container

func (*StsdBox) GetSampleDescription

func (s *StsdBox) GetSampleDescription(index int) (Box, error)

GetSampleDescription - get one of multiple descriptions

func (*StsdBox) Info

func (s *StsdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StsdBox) ReplaceChild

func (s *StsdBox) ReplaceChild(box Box)

AddChild - Replace a child box with one of the same type

func (*StsdBox) Size

func (s *StsdBox) Size() uint64

Size - box-specific type

func (*StsdBox) Type

func (s *StsdBox) Type() string

Type - box-specific type

type StssBox

type StssBox struct {
	Version      byte
	Flags        uint32
	SampleNumber []uint32
	// contains filtered or unexported fields
}

StssBox - Sync Sample Box (stss - optional)

Contained in : Sample Table box (stbl)

This lists all sync samples (key frames for video tracks) in the data. If absent, all samples are sync samples.

func (*StssBox) Encode

func (b *StssBox) Encode(w io.Writer) error

Encode - box-specific encode

func (*StssBox) Info

func (b *StssBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StssBox) IsSyncSample

func (b *StssBox) IsSyncSample(sampleNr uint32) (isSync bool)

IsSyncSample - check if sample (one-based) sampleNr is a sync sample

func (*StssBox) Size

func (b *StssBox) Size() uint64

Size - box-specfic size

func (*StssBox) Type

func (b *StssBox) Type() string

Type - box-specfic type

type StszBox

type StszBox struct {
	Version           byte
	Flags             uint32
	SampleUniformSize uint32
	SampleNumber      uint32
	SampleSize        []uint32
}

StszBox - Sample Size Box (stsz - mandatory)

Contained in : Sample Table box (stbl)

For each track, either stsz of the more compact stz2 must be present. stz2 variant is not supported.

This table lists the size of each sample. If all samples have the same size, it can be defined in the SampleUniformSize attribute.

func (*StszBox) Encode

func (b *StszBox) Encode(w io.Writer) error

Encode - write box to w

func (*StszBox) GetSampleSize

func (b *StszBox) GetSampleSize(i int) uint32

GetSampleSize returns the size (in bytes) of a sample

func (*StszBox) Info

func (b *StszBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StszBox) Size

func (b *StszBox) Size() uint64

Size - box-specific size

func (*StszBox) Type

func (b *StszBox) Type() string

Type - box-specific type

type SttgBox

type SttgBox struct {
	Settings string
}

SttgBox - CueSettingsBox (sttg)

func (*SttgBox) Encode

func (s *SttgBox) Encode(w io.Writer) error

Encode - write box to w

func (*SttgBox) Info

func (s *SttgBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SttgBox) Size

func (s *SttgBox) Size() uint64

Size - calculated size of box

func (*SttgBox) Type

func (s *SttgBox) Type() string

Type - box-specific type

type SttsBox

type SttsBox struct {
	Version         byte
	Flags           uint32
	SampleCount     []uint32
	SampleTimeDelta []uint32
}

SttsBox - Decoding Time to Sample Box (stts - mandatory)

This table contains the duration in time units for each sample.

  • SampleCount : the number of consecutive samples having the same duration
  • SampleTimeDelta : duration in time units

func (*SttsBox) Encode

func (b *SttsBox) Encode(w io.Writer) error

Encode - write box to w

func (*SttsBox) GetDecodeTime

func (b *SttsBox) GetDecodeTime(sampleNr uint32) (decTime uint64, dur uint32)

GetDecodeTime - decode time and duration for (one-based) sampleNr in track timescale

func (*SttsBox) GetTimeCode

func (b *SttsBox) GetTimeCode(sample, timescale uint32) time.Duration

GetTimeCode - return the timecode (duration since the beginning of the media) of the beginning of a sample

func (*SttsBox) Info

func (b *SttsBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*SttsBox) Size

func (b *SttsBox) Size() uint64

Size - return calculated size

func (*SttsBox) Type

func (b *SttsBox) Type() string

Type - return box type

type StypBox

type StypBox struct {
	MajorBrand       string
	MinorVersion     uint32
	CompatibleBrands []string
}

StypBox Segment Type Box (styp)

func CreateStyp

func CreateStyp() *StypBox

CreateStyp - Create an Styp box suitable for DASH/CMAF

func (*StypBox) Encode

func (b *StypBox) Encode(w io.Writer) error

Encode - write box to w

func (*StypBox) Info

func (b *StypBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*StypBox) Size

func (b *StypBox) Size() uint64

Size - return calculated size

func (*StypBox) Type

func (b *StypBox) Type() string

Type - return box type

type SubSamplePattern

type SubSamplePattern struct {
	BytesOfClearData     uint16
	BytesOfProtectedData uint32
}

SubSamplePattern - pattern of subsample encryption

type SubsBox

type SubsBox struct {
	Version byte
	Flags   uint32
	Entries []SubsEntry
}

SubsBox - SubSampleInformationBox

func (*SubsBox) Encode

func (b *SubsBox) Encode(w io.Writer) error

Encode - write box to w

func (*SubsBox) Info

func (b *SubsBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - specificBoxLevels dump:1 gives details

func (*SubsBox) Size

func (b *SubsBox) Size() uint64

Size - return calculated size

func (*SubsBox) Type

func (b *SubsBox) Type() string

Type - return box type

type SubsEntry

type SubsEntry struct {
	SampleDelta uint32
	SubSamples  []SubsSample
}

SubsEntry - entry in SubsBox

type SubsSample

type SubsSample struct {
	SubsampleSize           uint32
	CodecSpecificParameters uint32
	SubsamplePriority       uint8
	Discardable             uint8
}

SubsSample - sample in SubsEntry

type TencBox

type TencBox struct {
	Version                byte
	Flags                  uint32
	DefaultCryptByteBlock  byte
	DefaultSkipByteBlock   byte
	DefaultIsProtected     byte
	DefaultPerSampleIVSize byte
	DefaultKID             UUID
	// BDefaultConstantIVSize  byte given by len(DefaultContantIV)
	DefaultConstantIV []byte
}

TencBox - Track Encryption Box Defined in ISO/IEC 23001-7 Secion 8.2

func (*TencBox) Encode

func (b *TencBox) Encode(w io.Writer) error

Encode - write box to w

func (*TencBox) Info

func (b *TencBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*TencBox) Size

func (b *TencBox) Size() uint64

Size - return calculated size

func (*TencBox) Type

func (b *TencBox) Type() string

Type - return box type

type TfdtBox

type TfdtBox struct {
	Version             byte
	Flags               uint32
	BaseMediaDecodeTime uint64
}

TfdtBox - Track Fragment Decode Time (tfdt)

Contained in : Track Fragment box (traf)

func CreateTfdt

func CreateTfdt(baseMediaDecodeTime uint64) *TfdtBox

CreateTfdt - Create a new TfdtBox with baseMediaDecodeTime

func (*TfdtBox) Encode

func (t *TfdtBox) Encode(w io.Writer) error

Encode - write box to w

func (*TfdtBox) Info

func (t *TfdtBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

func (*TfdtBox) SetBaseMediaDecodeTime

func (t *TfdtBox) SetBaseMediaDecodeTime(bTime uint64)

SetBaseMediaDecodeTime - Set time of TfdtBox

func (*TfdtBox) Size

func (t *TfdtBox) Size() uint64

Size - return calculated size

func (*TfdtBox) Type

func (t *TfdtBox) Type() string

Type - return box type

type TfhdBox

type TfhdBox struct {
	Version                byte
	Flags                  uint32
	TrackID                uint32
	BaseDataOffset         uint64
	SampleDescriptionIndex uint32
	DefaultSampleDuration  uint32
	DefaultSampleSize      uint32
	DefaultSampleFlags     uint32
}

TfhdBox - Track Fragment Header Box (tfhd)

Contained in : Track Fragment box (traf))

func CreateTfhd

func CreateTfhd(trackID uint32) *TfhdBox

CreateTfhd - Create a new TfdtBox with baseMediaDecodeTime

func (*TfhdBox) DefaultBaseIfMoof

func (t *TfhdBox) DefaultBaseIfMoof() bool

DefaultBaseIfMoof - interpreted flags value

func (*TfhdBox) DurationIsEmpty

func (t *TfhdBox) DurationIsEmpty() bool

DurationIsEmpty - interpreted flags value

func (*TfhdBox) Encode

func (t *TfhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*TfhdBox) HasBaseDataOffset

func (t *TfhdBox) HasBaseDataOffset() bool

HasBaseDataOffset - interpreted flags value

func (*TfhdBox) HasDefaultSampleDuration

func (t *TfhdBox) HasDefaultSampleDuration() bool

HasDefaultSampleDuration - interpreted flags value

func (*TfhdBox) HasDefaultSampleFlags

func (t *TfhdBox) HasDefaultSampleFlags() bool

HasDefaultSampleFlags - interpreted flags value

func (*TfhdBox) HasDefaultSampleSize

func (t *TfhdBox) HasDefaultSampleSize() bool

HasDefaultSampleSize - interpreted flags value

func (*TfhdBox) HasSampleDescriptionIndex

func (t *TfhdBox) HasSampleDescriptionIndex() bool

HasSampleDescriptionIndex - interpreted flags value

func (*TfhdBox) Info

func (t *TfhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*TfhdBox) Size

func (t *TfhdBox) Size() uint64

Size - returns calculated size

func (*TfhdBox) Type

func (t *TfhdBox) Type() string

Type - returns box type

type TfraBox

type TfraBox struct {
	Version               byte
	Flags                 uint32
	TrackID               uint32
	LengthSizeOfTrafNum   byte
	LengthSizeOfTrunNum   byte
	LengthSizeOfSampleNum byte
	Entries               []TrafEntry
}

TfraBox - Track Fragment Random Access Box (tfra) Contained it MfraBox (mfra)

func (*TfraBox) Encode

func (b *TfraBox) Encode(w io.Writer) error

Encode - write box to w

func (*TfraBox) Info

func (b *TfraBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - more info for level 1

func (*TfraBox) Size

func (b *TfraBox) Size() uint64

Size - return calculated size

func (*TfraBox) Type

func (b *TfraBox) Type() string

Type - return box type

type TfrfData

type TfrfData struct {
	Version                   byte
	Flags                     uint32
	FragmentCount             byte
	FragmentAbsoluteTimes     []uint64
	FragmentAbsoluteDurations []uint64
}

TfrfData - MSS TfrfBox data after UUID part Defined in MSS-SSTR v20180912 section 2.2.4.5

type TfxdData

type TfxdData struct {
	Version                  byte
	Flags                    uint32
	FragmentAbsoluteTime     uint64
	FragmentAbsoluteDuration uint64
}

TfxdData - MSS TfxdBox data after UUID part Defined in MSS-SSTR v20180912 section 2.2.4.4

type TkhdBox

type TkhdBox struct {
	Version          byte
	Flags            uint32
	CreationTime     uint64
	ModificationTime uint64
	TrackID          uint32
	Duration         uint64
	Layer            int16
	AlternateGroup   int16 // should be int16
	Volume           Fixed16
	Width, Height    Fixed32
}

TkhdBox - Track Header Box (tkhd - mandatory)

This box describes the track. Duration is measured in time units (according to the time scale defined in the movie header box). Duration is 0 for fragmented files.

Volume (relevant for audio tracks) is a fixed point number (8 bits + 8 bits). Full volume is 1.0. Width and Height (relevant for video tracks) are fixed point numbers (16 bits + 16 bits). Video pixels are not necessarily square.

func CreateTkhd

func CreateTkhd() *TkhdBox

CreateTkhd - create tkhd box with common settings

func (*TkhdBox) Encode

func (b *TkhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*TkhdBox) Info

func (b *TkhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*TkhdBox) Size

func (b *TkhdBox) Size() uint64

Size - calculated size of box

func (*TkhdBox) Type

func (b *TkhdBox) Type() string

Type - box type

type TrafBox

type TrafBox struct {
	Tfhd     *TfhdBox
	Tfdt     *TfdtBox
	Trun     *TrunBox // The first TrunBox
	Truns    []*TrunBox
	Children []Box
}

TrafBox - Track Fragment Box (traf)

Contained in : Movie Fragment Box (moof)

func (*TrafBox) AddChild

func (t *TrafBox) AddChild(b Box) error

AddChild - add child box

func (*TrafBox) Encode

func (t *TrafBox) Encode(w io.Writer) error

Encode - write box to w

func (*TrafBox) GetChildren

func (t *TrafBox) GetChildren() []Box

GetChildren - list of child boxes

func (*TrafBox) Info

func (t *TrafBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*TrafBox) OptimizeTfhdTrun

func (t *TrafBox) OptimizeTfhdTrun() error

OptimizeTfhdTrun - optimize trun by default values in tfhd box Only look at first trun, even if there is more than one Don't optimize again, if already done so that no data is present

func (*TrafBox) Size

func (t *TrafBox) Size() uint64

Size - return calculated size

func (*TrafBox) Type

func (t *TrafBox) Type() string

Type - return box type

type TrafEntry

type TrafEntry struct {
	Time        int64
	MoofOffset  int64
	TrafNumber  uint32
	TrunNumber  uint32
	SampleDelta uint32
}

Tfrabox - reference as used inside SidxBox

type TrakBox

type TrakBox struct {
	Tkhd     *TkhdBox
	Mdia     *MdiaBox
	Edts     *EdtsBox
	Children []Box
}

TrakBox - Track Box (tkhd - mandatory)

Contained in : Movie Box (moov)

A media file can contain one or more tracks.

func CreateEmptyTrak

func CreateEmptyTrak(trackID, timeScale uint32, mediaType, language string) *TrakBox

Create a full Trak tree for an empty (fragmented) track with no samples or stsd content

func NewTrakBox

func NewTrakBox() *TrakBox

NewTrakBox - Make a new empty TrakBox

func (*TrakBox) AddChild

func (t *TrakBox) AddChild(box Box)

AddChild - Add a child box

func (*TrakBox) Encode

func (t *TrakBox) Encode(w io.Writer) error

Encode - write trak container to w

func (*TrakBox) GetChildren

func (t *TrakBox) GetChildren() []Box

GetChildren - list of child boxes

func (*TrakBox) Info

func (t *TrakBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*TrakBox) SetAACDescriptor

func (t *TrakBox) SetAACDescriptor(objType byte, samplingFrequency int) error

SetAACDescriptor - Modify a TrakBox by adding AAC SampleDescriptor objType is one of AAClc, HEAACv1, HEAACv2 For HEAAC, the samplingFrequency is the base frequency (normally 24000)

func (*TrakBox) SetAVCDescriptor

func (t *TrakBox) SetAVCDescriptor(sampleDescriptorType string, spsNALUs, ppsNALUs [][]byte) error

SetAVCDescriptor - Set AVC SampleDescriptor based on SPS and PPS

func (*TrakBox) SetHEVCDescriptor

func (t *TrakBox) SetHEVCDescriptor(sampleDescriptorType string, vpsNALUs, spsNALUs, ppsNALUs [][]byte) error

SetHEVCDescriptor - Set HEVC SampleDescriptor based on VPS, SPS, and PPS

func (*TrakBox) Size

func (t *TrakBox) Size() uint64

Size - calculated size of box

func (*TrakBox) Type

func (t *TrakBox) Type() string

Type - box type

type TrepBox

type TrepBox struct {
	Version  byte
	Flags    uint32
	TrackID  uint32
	Children []Box
}

TrepBox - Track Extension Properties Box (trep) Contained in mvex

func (*TrepBox) AddChild

func (s *TrepBox) AddChild(child Box)

AddChild - Add a child box and update SampleCount

func (*TrepBox) Encode

func (b *TrepBox) Encode(w io.Writer) error

Encode - box-specific encode of stsd - not a usual container

func (*TrepBox) Info

func (b *TrepBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*TrepBox) Size

func (b *TrepBox) Size() uint64

Size - box-specific type

func (*TrepBox) Type

func (s *TrepBox) Type() string

Type - box-specific type

type TrexBox

type TrexBox struct {
	Version                       byte
	Flags                         uint32
	TrackID                       uint32
	DefaultSampleDescriptionIndex uint32
	DefaultSampleDuration         uint32
	DefaultSampleSize             uint32
	DefaultSampleFlags            uint32
}

TrexBox - Track Extends Box

Contained in : Mvex Box (mvex)

func CreateTrex

func CreateTrex(trackID uint32) *TrexBox

CreateTrex - create trex box with trackID

func (*TrexBox) Encode

func (t *TrexBox) Encode(w io.Writer) error

Encode - write box to w

func (*TrexBox) Info

func (t *TrexBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*TrexBox) Size

func (t *TrexBox) Size() uint64

Size - return calculated size

func (*TrexBox) Type

func (t *TrexBox) Type() string

Type - return box type

type TrunBox

type TrunBox struct {
	Version byte

	DataOffset int32

	Samples []*Sample
	// contains filtered or unexported fields
}

TrunBox - Track Fragment Run Box (trun)

Contained in : Track Fragmnet Box (traf)

func CreateTrun

func CreateTrun(writeOrderNr uint32) *TrunBox

CreateTrun - create a TrunBox for filling up with samples

func (*TrunBox) AddFullSample

func (t *TrunBox) AddFullSample(s *FullSample)

AddFullSample - add Sample part of FullSample

func (*TrunBox) AddSample

func (t *TrunBox) AddSample(s *Sample)

AddSample - add a Sample

func (*TrunBox) AddSampleDefaultValues

func (t *TrunBox) AddSampleDefaultValues(tfhd *TfhdBox, trex *TrexBox) (totalDur uint64)

AddSampleDefaultValues - add values from tfhd and trex boxes if needed Return total duration

func (*TrunBox) Duration

func (t *TrunBox) Duration(defaultSampleDuration uint32) uint64

Duration - calculated duration given defaultSampleDuration

func (*TrunBox) Encode

func (t *TrunBox) Encode(w io.Writer) error

Encode - write box to w

func (*TrunBox) GetFullSamples

func (t *TrunBox) GetFullSamples(baseOffset uint32, baseTime uint64, mdat *MdatBox) []*FullSample

GetFullSamples - get all sample data including accumulated time and binary media baseOffset is offset in mdat (normally 8) baseTime is offset in track timescale (from mfhd) To fill missing individual values from thd and trex defaults, call AddSampleDefaultValues() before this call

func (*TrunBox) GetSamples

func (t *TrunBox) GetSamples() []*Sample

GetSamples - get all trun sample data To fill missing individual values from thd and trex defaults, call AddSampleDefaultValues() before this call

func (*TrunBox) HasDataOffset

func (t *TrunBox) HasDataOffset() bool

HasDataOffset - interpreted dataOffsetPresent flag

func (*TrunBox) HasFirstSampleFlags

func (t *TrunBox) HasFirstSampleFlags() bool

HasFirstSampleFlags - interpreted firstSampleFlagsPresent flag

func (*TrunBox) HasSampleCTO

func (t *TrunBox) HasSampleCTO() bool

HasSampleCTO - interpreted sampleCompositionTimeOffset flag

func (*TrunBox) HasSampleDuration

func (t *TrunBox) HasSampleDuration() bool

HasSampleDuration - interpreted sampleDurationPresent flag

func (*TrunBox) HasSampleFlags

func (t *TrunBox) HasSampleFlags() bool

HasSampleFlags - interpreted sampleFlagsPresent flag

func (*TrunBox) HasSampleSize

func (t *TrunBox) HasSampleSize() bool

HasSampleSize - interpreted sampleSizePresent flag

func (*TrunBox) Info

func (t *TrunBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

Info - specificBoxLevels trun:1 gives details

func (*TrunBox) SampleCount

func (t *TrunBox) SampleCount() uint32

SampleCount - return how many samples are defined

func (*TrunBox) Size

func (t *TrunBox) Size() uint64

Size - return calculated size

func (*TrunBox) SizeOfData

func (t *TrunBox) SizeOfData() (totalSize uint64)

SizeOfData - size of mediasamples in bytes

func (*TrunBox) Type

func (t *TrunBox) Type() string

Type - return box type

type URLBox

type URLBox struct {
	Version  byte
	Flags    uint32
	Location string // Zero-terminated string
}

URLBox - DataEntryUrlBox ('url ')

Contained in : DrefBox (dref

func CreateURLBox

func CreateURLBox() *URLBox

CreateURLBox - Create a self-referencing URL box

func (*URLBox) Encode

func (u *URLBox) Encode(w io.Writer) error

Encode - write box to w

func (*URLBox) Info

func (u *URLBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*URLBox) Size

func (u *URLBox) Size() uint64

Size - return calculated size

func (*URLBox) Type

func (u *URLBox) Type() string

Type - return box type

type UUID

type UUID []byte

UUID - 16-byte KeyID or SystemID

func (UUID) String

func (u UUID) String() string

type UUIDBox

type UUIDBox struct {
	UUID    string // 16 bytes
	SubType string
	Tfxd    *TfxdData
	Tfrf    *TfrfData
}

UUIDBox - Used as container for MSS boxes tfxd and tfrf

func (*UUIDBox) Encode

func (u *UUIDBox) Encode(w io.Writer) error

Encode - write UUIDBox including tfxd or tfrf to w

func (*UUIDBox) Info

func (u *UUIDBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*UUIDBox) Size

func (u *UUIDBox) Size() uint64

Size - return calculated size including tfxd/tfrf

func (*UUIDBox) Type

func (u *UUIDBox) Type() string

Type - return box type

type UdtaBox

type UdtaBox struct {
	Children []Box
}

User Data Box - container for User Data

Contained in : moov, trak, moof, or traf

func (*UdtaBox) AddChild

func (b *UdtaBox) AddChild(box Box)

AddChild - Add a child box

func (*UdtaBox) Encode

func (b *UdtaBox) Encode(w io.Writer) error

Encode - write udta container to w

func (*UdtaBox) GetChildren

func (b *UdtaBox) GetChildren() []Box

GetChildren - list of child boxes

func (*UdtaBox) Info

func (b *UdtaBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*UdtaBox) Size

func (b *UdtaBox) Size() uint64

Size - calculated size of box

func (*UdtaBox) Type

func (b *UdtaBox) Type() string

Type - box type

type UnknownBox

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

UnknownBox - box that we don't know how to parse

func (*UnknownBox) Encode

func (b *UnknownBox) Encode(w io.Writer) error

Encode - write box to w

func (*UnknownBox) Info

func (b *UnknownBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*UnknownBox) Size

func (b *UnknownBox) Size() uint64

Size - return calculated size

func (*UnknownBox) Type

func (b *UnknownBox) Type() string

Type - return box type

type UnknownSampleGroupEntry

type UnknownSampleGroupEntry struct {
	Name   string
	Length uint32
	Data   []byte
}

Unknown or not implemented SampleGroupEntry

func (*UnknownSampleGroupEntry) Encode

func (s *UnknownSampleGroupEntry) Encode(sw *SliceWriter)

func (*UnknownSampleGroupEntry) Info

func (s *UnknownSampleGroupEntry) Info(w io.Writer, specificBoxLevels, indent, indentStep string) (err error)

Info - write box info to w

func (*UnknownSampleGroupEntry) Size

func (s *UnknownSampleGroupEntry) Size() uint64

func (*UnknownSampleGroupEntry) Type

func (s *UnknownSampleGroupEntry) Type() string

type VisualSampleEntryBox

type VisualSampleEntryBox struct {
	DataReferenceIndex uint16
	Width              uint16
	Height             uint16
	Horizresolution    uint32
	Vertresolution     uint32
	FrameCount         uint16
	CompressorName     string
	AvcC               *AvcCBox
	HvcC               *HvcCBox
	Btrt               *BtrtBox
	Clap               *ClapBox
	Pasp               *PaspBox
	Children           []Box
	// contains filtered or unexported fields
}

VisualSampleEntryBox - Video Sample Description box (avc1/avc3)

func CreateVisualSampleEntryBox

func CreateVisualSampleEntryBox(name string, width, height uint16, sampleEntry Box) *VisualSampleEntryBox

CreateVisualSampleEntryBox - Create new VisualSampleEntry such as avc1, avc3, hev1, hvc1

func NewVisualSampleEntryBox

func NewVisualSampleEntryBox(name string) *VisualSampleEntryBox

NewVisualSampleEntryBox - Create new empty avc1 or avc3 box

func (*VisualSampleEntryBox) AddChild

func (b *VisualSampleEntryBox) AddChild(child Box)

AddChild - add a child box (avcC normally, but clap and pasp could be part of visual entry)

func (*VisualSampleEntryBox) Encode

func (b *VisualSampleEntryBox) Encode(w io.Writer) error

Encode - write box to w

func (*VisualSampleEntryBox) Info

func (b *VisualSampleEntryBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VisualSampleEntryBox) Size

func (b *VisualSampleEntryBox) Size() uint64

Size - return calculated size

func (*VisualSampleEntryBox) Type

func (b *VisualSampleEntryBox) Type() string

Type - return box type

type VlabBox

type VlabBox struct {
	SourceLabel string
}

VlabBox - WebVTTSourceLabelBox (vlab)

func (*VlabBox) Encode

func (v *VlabBox) Encode(w io.Writer) error

Encode - write box to w

func (*VlabBox) Info

func (v *VlabBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VlabBox) Size

func (v *VlabBox) Size() uint64

Size - calculated size of box

func (*VlabBox) Type

func (v *VlabBox) Type() string

Type - box-specific type

type VmhdBox

type VmhdBox struct {
	Version      byte
	Flags        uint32
	GraphicsMode uint16
	OpColor      [3]uint16
}

VmhdBox - Video Media Header Box (vhmd - mandatory for video tracks)

Contained in : Media Information Box (minf)

func CreateVmhd

func CreateVmhd() *VmhdBox

CreateVmhd - Create Video Media Header Box

func (*VmhdBox) Encode

func (b *VmhdBox) Encode(w io.Writer) error

Encode - write box to w

func (*VmhdBox) Info

func (b *VmhdBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VmhdBox) Size

func (b *VmhdBox) Size() uint64

Size - calculated size of box

func (*VmhdBox) Type

func (b *VmhdBox) Type() string

Type - box-specific type

type VsidBox

type VsidBox struct {
	SourceID uint32
}

VsidBox - CueSourceIDBox (vsid)

func (*VsidBox) Encode

func (v *VsidBox) Encode(w io.Writer) error

Encode - write box to w

func (*VsidBox) Info

func (v *VsidBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VsidBox) Size

func (v *VsidBox) Size() uint64

Size - calculated size of box

func (*VsidBox) Type

func (v *VsidBox) Type() string

Type - box-specific type

type VttCBox

type VttCBox struct {
	Config string
}

VttCBox - WebVTTConfigurationBox (vttC)

func (*VttCBox) Encode

func (v *VttCBox) Encode(w io.Writer) error

Encode - write box to w

func (*VttCBox) Info

func (v *VttCBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VttCBox) Size

func (v *VttCBox) Size() uint64

Size - calculated size of box

func (*VttCBox) Type

func (v *VttCBox) Type() string

Type - box-specific type

type VttaBox

type VttaBox struct {
	CueAdditionalText string
}

VttaBox - VTTAdditionalTextBox (vtta) (corresponds to NOTE in WebVTT)

func (*VttaBox) Encode

func (v *VttaBox) Encode(w io.Writer) error

Encode - write box to w

func (*VttaBox) Info

func (v *VttaBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VttaBox) Size

func (v *VttaBox) Size() uint64

Size - calculated size of box

func (*VttaBox) Type

func (v *VttaBox) Type() string

Type - box-specific type

type VttcBox

type VttcBox struct {
	Vsid     *VsidBox
	Iden     *IdenBox
	Ctim     *CtimBox
	Sttg     *SttgBox
	Payl     *PaylBox
	Children []Box
}

VttcBox - VTTCueBox (vttc)

func (*VttcBox) AddChild

func (v *VttcBox) AddChild(box Box)

AddChild - Add a child box

func (*VttcBox) Encode

func (v *VttcBox) Encode(w io.Writer) error

Encode - write mvex container to w

func (*VttcBox) GetChildren

func (v *VttcBox) GetChildren() []Box

GetChildren - list of child boxes

func (*VttcBox) Info

func (v *VttcBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VttcBox) Size

func (v *VttcBox) Size() uint64

Size - return calculated size

func (*VttcBox) Type

func (v *VttcBox) Type() string

Type - return box type

type VtteBox

type VtteBox struct {
}

VtteBox - VTTEmptyBox (vtte)

func (*VtteBox) Encode

func (v *VtteBox) Encode(w io.Writer) error

Encode - write box to w

func (*VtteBox) Info

func (v *VtteBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*VtteBox) Size

func (v *VtteBox) Size() uint64

Size - calculated size of box

func (*VtteBox) Type

func (v *VtteBox) Type() string

Type - box-specific type

type WvttBox

type WvttBox struct {
	VttC               *VttCBox
	Vlab               *VlabBox
	Btrt               *BtrtBox
	Children           []Box
	DataReferenceIndex uint16
}

WvttBox - WVTTSampleEntry (wvtt) Extends PlainTextSampleEntry which extends SampleEntry

func NewWvttBox

func NewWvttBox() *WvttBox

NewAudioSampleEntryBox - Create new empty mp4a box

func (*WvttBox) AddChild

func (w *WvttBox) AddChild(box Box)

AddChild - add a child box (avcC normally, but clap and pasp could be part of visual entry)

func (*WvttBox) Encode

func (a *WvttBox) Encode(w io.Writer) error

Encode - write box to w

func (*WvttBox) Info

func (a *WvttBox) Info(w io.Writer, specificBoxLevels, indent, indentStep string) error

func (*WvttBox) Size

func (a *WvttBox) Size() uint64

Size - return calculated size

func (*WvttBox) Type

func (a *WvttBox) Type() string

Type - return box type

Jump to

Keyboard shortcuts

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