Versions in this module Expand all Collapse all v0 v0.0.2 Aug 24, 2023 v0.0.1 Aug 23, 2023 Changes in this version + const AAC_RAW + const AAC_SEQUENCE_HEADER + const AVC_NALU + const AVC_SEQUENCE_HEADER + const FLVTAG_SIZE + const PacketTypeCodedFrames + const PacketTypeCodedFramesX + const PacketTypeMPEG2TSSequenceStart + const PacketTypeMetadata + const PacketTypeSequenceEnd + const PacketTypeSequenceStart + func CovertFlvAudioCodecId2MpegCodecId(cid FLV_SOUND_FORMAT) codec.CodecID + func CovertFlvVideoCodecId2MpegCodecId(cid FLV_VIDEO_CODEC_ID) codec.CodecID + func GetTagLenByAudioCodec(cid FLV_SOUND_FORMAT) int + func GetTagLenByVideoCodec(cid FLV_VIDEO_CODEC_ID) int + func GetUint24(b []byte) (v uint32) + func PutUint24(b []byte, v uint32) + func WriteAudioTag(data []byte, cid FLV_SOUND_FORMAT, sampleRate int, channelCount int, ...) []byte + func WriteVideoTag(data []byte, isKey bool, cid FLV_VIDEO_CODEC_ID, cts int32, ...) []byte + type AACMuxer struct + func NewAACMuxer() *AACMuxer + func (muxer *AACMuxer) Write(frames []byte, pts uint32, dts uint32) [][]byte + type AACTagDemuxer struct + func NewAACTagDemuxer() *AACTagDemuxer + func (demuxer *AACTagDemuxer) Decode(data []byte) error + func (demuxer *AACTagDemuxer) OnFrame(onframe OnAudioFrameCallBack) + type AVCMuxer struct + func NewAVCMuxer() *AVCMuxer + func (muxer *AVCMuxer) Write(frames []byte, pts uint32, dts uint32) [][]byte + type AVCTagDemuxer struct + func NewAVCTagDemuxer() *AVCTagDemuxer + func (demuxer *AVCTagDemuxer) Decode(data []byte) error + func (demuxer *AVCTagDemuxer) OnFrame(onframe OnVideoFrameCallBack) + type AVTagMuxer interface + Write func(frames []byte, pts uint32, dts uint32) [][]byte + func CreateAudioMuxer(cid FLV_SOUND_FORMAT) AVTagMuxer + func CreateVideoMuxer(cid FLV_VIDEO_CODEC_ID) AVTagMuxer + type AudioTag struct + AACPacketType uint8 + SoundFormat uint8 + SoundRate uint8 + SoundSize uint8 + SoundType uint8 + func (atag *AudioTag) Decode(data []byte) error + func (atag AudioTag) Encode() (tag []byte) + type AudioTagDemuxer interface + Decode func(data []byte) error + OnFrame func(onframe OnAudioFrameCallBack) + func CreateAudioTagDemuxer(formats FLV_SOUND_FORMAT) (demuxer AudioTagDemuxer) + type FLVSAMPLEINDEX int + const FLV_SAMPLE_11000 + const FLV_SAMPLE_22000 + const FLV_SAMPLE_44000 + const FLV_SAMPLE_5500 + type FLV_PARSER_STATE int + const FLV_PARSER_AUDIO_TAG + const FLV_PARSER_DETECT_AUDIO + const FLV_PARSER_DETECT_VIDEO + const FLV_PARSER_FILE_HEAD + const FLV_PARSER_FLV_TAG + const FLV_PARSER_INIT + const FLV_PARSER_SCRIPT_TAG + const FLV_PARSER_TAG_SIZE + const FLV_PARSER_VIDEO_TAG + type FLV_SOUND_FORMAT int + const FLV_AAC + const FLV_G711A + const FLV_G711U + const FLV_MP3 + func CovertCodecId2SoundFromat(cid codec.CodecID) FLV_SOUND_FORMAT + func (format FLV_SOUND_FORMAT) ToMpegCodecId() codec.CodecID + type FLV_VIDEO_CODEC_ID int + const FLV_AVC + const FLV_HEVC + func CovertCodecId2FlvVideoCodecId(cid codec.CodecID) FLV_VIDEO_CODEC_ID + func GetFLVVideoCodecId(data []byte) (cid FLV_VIDEO_CODEC_ID) + type FLV_VIDEO_FRAME_TYPE int + const INTER_FRAME + const KEY_FRAME + type FlvMuxer struct + func NewFlvMuxer(vid FLV_VIDEO_CODEC_ID, aid FLV_SOUND_FORMAT) *FlvMuxer + func (muxer *FlvMuxer) SetAudioCodeId(cid FLV_SOUND_FORMAT) + func (muxer *FlvMuxer) SetVideoCodeId(cid FLV_VIDEO_CODEC_ID) + func (muxer *FlvMuxer) WriteAudio(frames []byte, pts uint32, dts uint32) ([][]byte, error) + func (muxer *FlvMuxer) WriteFrames(frameType TagType, frames []byte, pts uint32, dts uint32) ([][]byte, error) + func (muxer *FlvMuxer) WriteVideo(frames []byte, pts uint32, dts uint32) ([][]byte, error) + type FlvReader struct + OnFrame func(cid codec.CodecID, frame []byte, pts uint32, dts uint32) + func CreateFlvReader() *FlvReader + func (f *FlvReader) Input(data []byte) (err error) + type FlvTag struct + DataSize uint32 + StreamID uint32 + TagType uint8 + Timestamp uint32 + TimestampExtended uint8 + func (ftag *FlvTag) Decode(data []byte) + func (ftag FlvTag) Encode() []byte + type FlvWriter struct + func CreateFlvWriter(writer io.Writer) *FlvWriter + func (f *FlvWriter) WriteAAC(data []byte, pts uint32, dts uint32) error + func (f *FlvWriter) WriteFlvHeader() (err error) + func (f *FlvWriter) WriteG711A(data []byte, pts uint32, dts uint32) error + func (f *FlvWriter) WriteG711U(data []byte, pts uint32, dts uint32) error + func (f *FlvWriter) WriteH264(data []byte, pts uint32, dts uint32) error + func (f *FlvWriter) WriteH265(data []byte, pts uint32, dts uint32) error + func (f *FlvWriter) WriteMp3(data []byte, pts uint32, dts uint32) error + type G711AMuxer struct + func NewG711AMuxer(channelCount int, sampleRate int) *G711AMuxer + func (muxer *G711AMuxer) Write(frames []byte, pts uint32, dts uint32) [][]byte + type G711Demuxer struct + func NewG711Demuxer(format FLV_SOUND_FORMAT) *G711Demuxer + func (demuxer *G711Demuxer) Decode(data []byte) error + func (demuxer *G711Demuxer) OnFrame(onframe OnAudioFrameCallBack) + type G711UMuxer struct + func NewG711UMuxer(channelCount int, sampleRate int) *G711UMuxer + func (muxer *G711UMuxer) Write(frames []byte, pts uint32, dts uint32) [][]byte + type HevcMuxer struct + func NewHevcMuxer() *HevcMuxer + func (muxer *HevcMuxer) Write(frames []byte, pts uint32, dts uint32) [][]byte + type HevcTagDemuxer struct + SpsPpsVps []byte + func NewHevcTagDemuxer() *HevcTagDemuxer + func (demuxer *HevcTagDemuxer) Decode(data []byte) error + func (demuxer *HevcTagDemuxer) OnFrame(onframe OnVideoFrameCallBack) + type Mp3Muxer struct + func (muxer *Mp3Muxer) Write(frames []byte, pts uint32, dts uint32) [][]byte + type OnAudioFrameCallBack func(codecid codec.CodecID, frame []byte) + type OnVideoFrameCallBack func(codecid codec.CodecID, frame []byte, cts int) + type TagType int + const AUDIO_TAG + const SCRIPT_TAG + const VIDEO_TAG + type VideoTag struct + AVCPacketType uint8 + CodecId uint8 + CompositionTime int32 + FrameType uint8 + func (vtag *VideoTag) Decode(data []byte) + func (vtag VideoTag) Encode() (tag []byte) + type VideoTagDemuxer interface + Decode func(data []byte) error + OnFrame func(onframe OnVideoFrameCallBack) + func CreateFlvVideoTagHandle(cid FLV_VIDEO_CODEC_ID) (demuxer VideoTagDemuxer)