func (flvFile *File) WriteVideoTag(data []byte, timestamp uint32) (err error) {
	return flvFile.WriteTag(data, VIDEO_TAG, timestamp)
}
Data with video header
package flv
import (
	"encoding/binary"
	"errors"
	"io"
	"os"
)
type File struct {
	file              *os.File
	name              string
	readOnly          bool
	size              int64
	headerBuf         []byte
	duration          float64
	lastTimestamp     uint32
	firstTimestampSet bool
	firstTimestamp    uint32
}
type TagHeader struct {
	TagType   byte
	DataSize  uint32
	Timestamp uint32
}
func CreateFile(name string) (flvFile *File, err error) {
	var file *os.File
	if file, err = os.Create(name); err != nil {
		return
	}
	if _, err = file.Write(HEADER_BYTES); err != nil {
		file.Close()
		return
	}
	if err = file.Sync(); err != nil {
		file.Close()
		return
	}
	flvFile = &File{
		file:      file,
		name:      name,
		readOnly:  false,
		headerBuf: make([]byte, 11),
		duration:  0.0,
	}
	return
}
func OpenFile(name string) (flvFile *File, err error) {
	var file *os.File
	file, err = os.Open(name)
	if err != nil {
		return
	}
	var size int64
	if size, err = file.Seek(0, 2); err != nil {
		file.Close()
		return
	}
	if _, err = file.Seek(0, 0); err != nil {
		file.Close()
		return
	}
	flvFile = &File{
		file:      file,
		name:      name,
		readOnly:  true,
		size:      size,
		headerBuf: make([]byte, 11),
	}
	remain := HEADER_LEN
	flvHeader := make([]byte, remain)
	if _, err = io.ReadFull(file, flvHeader); err != nil {
		file.Close()
		return
	}
	if flvHeader[0] != 'F' ||
		flvHeader[1] != 'L' ||
		flvHeader[2] != 'V' {
		file.Close()
		return nil, errors.New("File format error")
	}
	return
}
func (flvFile *File) Close() {
	flvFile.file.Close()
}
func (flvFile *File) WriteAudioTag(data []byte, timestamp uint32) (err error) {
	return flvFile.WriteTag(data, AUDIO_TAG, timestamp)
}