sofia

package module
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: OSL-3.0 Imports: 3 Imported by: 0

README

sofia

And, in the dream, I knew that he was, going on ahead. He was fixin' to make a fire somewhere out there in all that dark and cold. And I knew that whenever I got there, he'd be there. And then I woke up.

No Country for Old Men (2007)

ISOBMFF

library for reading and writing MP4

prior art

  1. https://github.com/mozilla/mp4parse-rust/issues/415
  2. https://github.com/Eyevinn/mp4ff/issues/311
  3. https://github.com/alfg/mp4-rust/issues/132
  4. https://github.com/yapingcat/gomedia/issues/115
  5. https://github.com/alfg/mp4/issues/27
  6. https://github.com/abema/go-mp4/issues/13
  7. https://github.com/garden4hu/fmp4parser-go/issues/4
  8. https://github.com/eswarantg/mp4box/issues/3
  9. https://github.com/miquels/mp4/issues/2

progress

  • enca, provides sinf
  • encv, provides sinf
  • frma, provides original format
  • mdat, provides media data
  • mdia, provides minf
  • minf, provides stbl
  • moof, provides traf
  • moov, provides trak
  • pssh, provides pssh data
  • schi, provides tenc
  • senc, provides initialization vector
  • sidx, provides segment indexes
  • sinf, provides frma
  • stbl, provides stsd
  • stsd, provides enca encv
  • tenc, provides default key ID
  • tfhd, provides default sample size
  • traf, provides senc
  • trak, provides mdia
  • trun, provides sample sizes

Documentation

Index

Constants

View Source
const PiffExtendedType = "a2394f525a9b4f14a2446c427c648df4"

Variables

This section is empty.

Functions

This section is empty.

Types

type Appender

type Appender interface {
	Append([]byte) ([]byte, error)
}

type Box

type Box struct {
	BoxHeader BoxHeader
	Payload   []byte
}

ISO/IEC 14496-12

aligned(8) class Box(
   unsigned int(32) boxtype,
   optional unsigned int(8)[16] extended_type
) {
   BoxHeader(boxtype, extended_type);
   // the remaining bytes are the BoxPayload
}

func (*Box) Append

func (b *Box) Append(data []byte) ([]byte, error)

func (*Box) Read

func (b *Box) Read(data []byte) error

type BoxError added in v1.6.9

type BoxError struct {
	Container BoxHeader
	Box       BoxHeader
}

func (*BoxError) Error added in v1.6.9

func (b *BoxError) Error() string

type BoxHeader

type BoxHeader struct {
	Size     uint32
	Type     Type
	UserType *Uuid
}

ISO/IEC 14496-12

aligned(8) class BoxHeader(
   unsigned int(32) boxtype,
   optional unsigned int(8)[16] extended_type
) {
   unsigned int(32) size;
   unsigned int(32) type = boxtype;
   if (size==1) {
      unsigned int(64) largesize;
   } else if (size==0) {
      // box extends to end of file
   }
   if (boxtype=='uuid') {
      unsigned int(8)[16] usertype = extended_type;
   }
}

func (*BoxHeader) Append

func (b *BoxHeader) Append(data []byte) ([]byte, error)

func (*BoxHeader) Decode

func (b *BoxHeader) Decode(data []byte) (int, error)

func (*BoxHeader) GetSize

func (b *BoxHeader) GetSize() int

type Decoder

type Decoder interface {
	Decode([]byte) (int, error)
}

type FullBoxHeader

type FullBoxHeader struct {
	Version uint8
	Flags   [3]byte
}

ISO/IEC 14496-12

aligned(8) class FullBoxHeader(unsigned int(8) v, bit(24) f) {
   unsigned int(8) version = v;
   bit(24) flags = f;
}

func (*FullBoxHeader) GetFlags

func (f *FullBoxHeader) GetFlags() uint32

type Reader

type Reader interface {
	Read([]byte) error
}

type SampleEntry

type SampleEntry struct {
	BoxHeader BoxHeader

	DataReferenceIndex uint16
	// contains filtered or unexported fields
}

ISO/IEC 14496-12

aligned(8) abstract class SampleEntry(
   unsigned int(32) format
) extends Box(format) {
   const unsigned int(8)[6] reserved = 0;
   unsigned int(16) data_reference_index;
}

func (*SampleEntry) Append

func (s *SampleEntry) Append(data []byte) ([]byte, error)

func (*SampleEntry) Decode

func (s *SampleEntry) Decode(data []byte) (int, error)

type SizeGetter

type SizeGetter interface {
	GetSize() int
}

type Type

type Type [4]uint8

func (Type) String

func (t Type) String() string

type Uuid

type Uuid [16]uint8

func (Uuid) String

func (u Uuid) String() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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