flv

package
v0.0.0-...-607d97d Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Number AmfType = iota
	Boolean
	String
	Object
	MovieClip
	Null
	Undefined
	Reference
	MixedArray = 8
	EndOfObject
	Array
	Date
	LongString
	Unsupported
	Recordset
	XML
	TypedObject
	AMF3data
)
View Source
const (
	WIDTH         = "width"
	HEIGHT        = "height"
	DURATION      = "duration"
	VIDEODATARATE = "videodatarate"
	FRAMERATE     = "framerate"
	VIDEOCODECID  = "videocodecid"
)

Variables

This section is empty.

Functions

func CreateVideoInfoTag

func CreateVideoInfoTag(sps *h264.SPS, pps []byte, time uint32) []byte

func CreateVideoInfoTag2

func CreateVideoInfoTag2(SEI []byte, IDR []byte, time uint32) []byte

Types

type Amf

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

func CreateAmf

func CreateAmf(name string, parameters Parameters) *Amf

func NewAmf

func NewAmf() *Amf

func (*Amf) ReadAMF

func (a *Amf) ReadAMF(readStream *io.ReadStream) error

func (*Amf) ReadParam

func (a *Amf) ReadParam(key string) *Parameter

func (*Amf) ReadParams

func (a *Amf) ReadParams(readStream *io.ReadStream) error

func (*Amf) ToBytes

func (a *Amf) ToBytes() []byte

type AmfType

type AmfType byte

func (AmfType) ReadValue

func (t AmfType) ReadValue(readStream *io.ReadStream) ([]byte, error)

func (AmfType) Size

func (t AmfType) Size() int

type Decipher

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

func NewDecipher

func NewDecipher() *Decipher

func Open

func Open(path string) (*Decipher, error)

func (*Decipher) DumpInfo

func (d *Decipher) DumpInfo() (*media.VideoInfo, error)

func (*Decipher) Init

func (d *Decipher) Init(file *os.File)

func (*Decipher) Match

func (d *Decipher) Match() (bool, error)

func (*Decipher) ReadHeader

func (d *Decipher) ReadHeader() (*Header, error)

func (*Decipher) ReadTag

func (d *Decipher) ReadTag() (*Tag, error)

func (*Decipher) ReadZeroTag

func (d *Decipher) ReadZeroTag() (uint32, error)

type Encoder

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

func Create

func Create(path string) (*Encoder, error)

func (*Encoder) WriteHeaderAndZeroTag

func (e *Encoder) WriteHeaderAndZeroTag(audio bool, video bool)

func (*Encoder) WriteSEIAndIDR

func (e *Encoder) WriteSEIAndIDR(SEI []byte, IDR []byte)

func (*Encoder) WriteScript

func (e *Encoder) WriteScript(width float64, height float64, duration float64)

func (*Encoder) WriteVideoInfo

func (e *Encoder) WriteVideoInfo(sps *h264.SPS, pps []byte)
type Header struct {
	// contains filtered or unexported fields
}

func ParseHeader

func ParseHeader(reader *io.ReadStream) (*Header, error)

func (*Header) HasAudio

func (h *Header) HasAudio() bool

func (*Header) HasVideo

func (h *Header) HasVideo() bool

type Parameter

type Parameter struct {
	Name    string
	AmfType AmfType
	Value   []byte
}

func NewParameter

func NewParameter(Name string, AmfType AmfType, Value []byte) *Parameter

func NumberParameter

func NumberParameter(name string, value float64) *Parameter

func StringParameter

func StringParameter(name string, value string) *Parameter

type Parameters

type Parameters map[string]*Parameter

func (Parameters) Add

func (ps Parameters) Add(p *Parameter)

type Script

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

func ParseScript

func ParseScript(tag *Tag) (*Script, error)

func (*Script) Amf

func (s *Script) Amf() *Amf

type Tag

type Tag struct {
	Type      byte
	DataSize  uint32
	Timestamp uint32
	StreamID  uint32
	Data      []byte
	TagSize   uint32
	// contains filtered or unexported fields
}

func NewTag

func NewTag() *Tag

func ReadTag

func ReadTag(reader *io.ReadStream) (*Tag, error)

func (*Tag) IsAudio

func (t *Tag) IsAudio() bool

func (*Tag) IsScript

func (t *Tag) IsScript() bool

func (*Tag) IsVideo

func (t *Tag) IsVideo() bool

type Video

type Video struct {
	FrameType byte
	CodecID   byte
	VideoData []byte
	// contains filtered or unexported fields
}

func ParseVideo

func ParseVideo(tag *Tag) (*Video, error)

Jump to

Keyboard shortcuts

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