ivfreader

package
v2.2.27-0...-5dabb11 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package ivfreader implements IVF media container reader

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWith

func NewWith(in io.Reader) (*IVFReader, *IVFFileHeader, error)

NewWith returns a new IVF reader and IVF file header with an io.Reader input

Types

type IVFFileHeader

type IVFFileHeader struct {
	FourCC              string // 8-11
	Width               uint16 // 12-13
	Height              uint16 // 14-15
	TimebaseDenominator uint32 // 16-19
	TimebaseNumerator   uint32 // 20-23
	NumFrames           uint32 // 24-27
	// contains filtered or unexported fields
}

IVFFileHeader 32-byte header for IVF files https://wiki.multimedia.cx/index.php/IVF

type IVFFrameHeader

type IVFFrameHeader struct {
	FrameSize uint32 // 0-3
	Timestamp uint64 // 4-11
}

IVFFrameHeader 12-byte header for IVF frames https://wiki.multimedia.cx/index.php/IVF

type IVFReader

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

IVFReader is used to read IVF files and return frame payloads

func (*IVFReader) ParseNextFrame

func (i *IVFReader) ParseNextFrame() ([]byte, *IVFFrameHeader, error)

ParseNextFrame reads from stream and returns IVF frame payload, header, and an error if there is incomplete frame data. Returns all nil values when no more frames are available.

func (*IVFReader) ResetReader

func (i *IVFReader) ResetReader(reset func(bytesRead int64) io.Reader)

ResetReader resets the internal stream of IVFReader. This is useful for live streams, where the end of the file might be read without the data being finished.

Jump to

Keyboard shortcuts

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