flv

package
v0.0.0-...-0b3a51d Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2016 License: MIT, MIT Imports: 4 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	AUDIO_TAG       = byte(0x08)
	VIDEO_TAG       = byte(0x09)
	SCRIPT_DATA_TAG = byte(0x12)
	DURATION_OFFSET = 53
	HEADER_LEN      = 13
)

Variables

View Source
var (
	HEADER_BYTES = []byte{'F', 'L', 'V', 0x01, 0x05, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00,
		0x12, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x02, 0x00, 0x0a, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x44, 0x61, 0x74, 0x61,
		0x08, 0x00, 0x00, 0x00, 0x01,
		0x00, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6F, 0x6E,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x09,
		0x00, 0x00, 0x00, 0x33}
)

Functions

This section is empty.

Types

type File

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

func CreateFile

func CreateFile(name string) (flvFile *File, err error)

func OpenFile

func OpenFile(name string) (flvFile *File, err error)

func (*File) Close

func (flvFile *File) Close()

func (*File) FilePath

func (flvFile *File) FilePath() string

func (*File) IsFinished

func (flvFile *File) IsFinished() bool

func (*File) LoopBack

func (flvFile *File) LoopBack()

func (*File) ReadTag

func (flvFile *File) ReadTag() (header *TagHeader, data []byte, err error)

func (*File) SetDuration

func (flvFile *File) SetDuration(duration float64)

func (*File) Size

func (flvFile *File) Size() (size int64)

func (*File) Sync

func (flvFile *File) Sync() (err error)

func (*File) WriteAudioTag

func (flvFile *File) WriteAudioTag(data []byte, timestamp uint32) (err error)

Data with audio header

func (*File) WriteTag

func (flvFile *File) WriteTag(data []byte, tagType byte, timestamp uint32) (err error)

Write tag

func (*File) WriteVideoTag

func (flvFile *File) WriteVideoTag(data []byte, timestamp uint32) (err error)

Data with video header

type TagHeader

type TagHeader struct {
	TagType   byte
	DataSize  uint32
	Timestamp uint32
}

Jump to

Keyboard shortcuts

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