codec

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioMeta

type AudioMeta struct {
	Codec      string  `json:"codec"`
	SampleRate int     `json:"samplerate,omitempty"`
	SampleSize int     `json:"samplesize,omitempty"`
	Channels   int     `json:"channels,omitempty"`
	DataRate   float64 `json:"datarate,omitempty"`
	Sps        []byte  `json:"-"` // sps

}

AudioMeta 音频元数据

type Frame

type Frame struct {
	MediaType        // 媒体类型
	Dts       int64  // DTS,单位为 ns
	Pts       int64  // PTS,单位为 ns
	Payload   []byte // 媒体数据载荷
}

Frame 音视频完整帧

type FrameWriter

type FrameWriter interface {
	WriteFrame(frame *Frame) error
}

FrameWriter 包装 WriteFrame 方法的接口

type MediaType

type MediaType int

MediaType 媒体类型

const (
	MediaTypeUnknown MediaType = iota - 1 // Usually treated as MediaTypeData
	MediaTypeVideo
	MediaTypeAudio
	MediaTypeData // Opaque data information usually continuous
	MediaTypeSubtitle
	MediaTypeAttachment // Opaque data information usually sparse
	MediaTypeNB
)

媒体类型常量

func (*MediaType) MarshalText

func (mt *MediaType) MarshalText() ([]byte, error)

MarshalText marshals the MediaType to text.

func (MediaType) String

func (mt MediaType) String() string

String returns a lower-case ASCII representation of the media type.

func (*MediaType) UnmarshalText

func (mt *MediaType) UnmarshalText(text []byte) error

UnmarshalText unmarshals text to a MediaType.

type VideoMeta

type VideoMeta struct {
	Codec          string  `json:"codec"`
	Width          int     `json:"width,omitempty"`
	Height         int     `json:"height,omitempty"`
	FixedFrameRate bool    `json:"fixedframerate,omitempty"`
	FrameRate      float64 `json:"framerate,omitempty"`
	DataRate       float64 `json:"datarate,omitempty"`
	ClockRate      int     `json:"clockrate,omitempty"`
	Sps            []byte  `json:"-"`
	Pps            []byte  `json:"-"`
	Vps            []byte  `json:"-"`
}

VideoMeta 视频元数据

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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