ffmpeg

package module
v0.0.0-...-04f1607 Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AVERROR_BSF_NOT_FOUND      = int(C.AVERROR_BSF_NOT_FOUND)
	AVERROR_BUG                = int(C.AVERROR_BUG)
	AVERROR_BUFFER_TOO_SMALL   = int(C.AVERROR_BUFFER_TOO_SMALL)
	AVERROR_DECODER_NOT_FOUND  = int(C.AVERROR_DECODER_NOT_FOUND)
	AVERROR_DEMUXER_NOT_FOUND  = int(C.AVERROR_DEMUXER_NOT_FOUND)
	AVERROR_ENCODER_NOT_FOUND  = int(C.AVERROR_ENCODER_NOT_FOUND)
	AVERROR_EOF                = int(C.AVERROR_EOF)
	AVERROR_EXIT               = int(C.AVERROR_EXIT)
	AVERROR_EXTERNAL           = int(C.AVERROR_EXTERNAL)
	AVERROR_FILTER_NOT_FOUND   = int(C.AVERROR_FILTER_NOT_FOUND)
	AVERROR_INVALIDDATA        = int(C.AVERROR_INVALIDDATA)
	AVERROR_MUXER_NOT_FOUND    = int(C.AVERROR_MUXER_NOT_FOUND)
	AVERROR_OPTION_NOT_FOUND   = int(C.AVERROR_OPTION_NOT_FOUND)
	AVERROR_PATCHWELCOME       = int(C.AVERROR_PATCHWELCOME)
	AVERROR_PROTOCOL_NOT_FOUND = int(C.AVERROR_PROTOCOL_NOT_FOUND)
	AVERROR_STREAM_NOT_FOUND   = int(C.AVERROR_STREAM_NOT_FOUND)
	AVERROR_BUG2               = int(C.AVERROR_BUG2)
	AVERROR_UNKNOWN            = int(C.AVERROR_UNKNOWN)
	AVERROR_EXPERIMENTAL       = int(C.AVERROR_EXPERIMENTAL)
	AVERROR_INPUT_CHANGED      = int(C.AVERROR_INPUT_CHANGED)
	AVERROR_OUTPUT_CHANGED     = int(C.AVERROR_OUTPUT_CHANGED)
	AVERROR_HTTP_BAD_REQUEST   = int(C.AVERROR_HTTP_BAD_REQUEST)
	AVERROR_HTTP_UNAUTHORIZED  = int(C.AVERROR_HTTP_UNAUTHORIZED)
	AVERROR_HTTP_FORBIDDEN     = int(C.AVERROR_HTTP_FORBIDDEN)
	AVERROR_HTTP_NOT_FOUND     = int(C.AVERROR_HTTP_NOT_FOUND)
	AVERROR_HTTP_OTHER_4XX     = int(C.AVERROR_HTTP_OTHER_4XX)
	AVERROR_HTTP_SERVER_ERROR  = int(C.AVERROR_HTTP_SERVER_ERROR)
)
View Source
const (
	AV_LOG_QUIET   = AV_LOG_LEVEL(C.AV_LOG_QUIET)
	AV_LOG_PANIC   = AV_LOG_LEVEL(C.AV_LOG_PANIC)
	AV_LOG_FATAL   = AV_LOG_LEVEL(C.AV_LOG_FATAL)
	AV_LOG_ERROR   = AV_LOG_LEVEL(C.AV_LOG_ERROR)
	AV_LOG_WARNING = AV_LOG_LEVEL(C.AV_LOG_WARNING)
	AV_LOG_INFO    = AV_LOG_LEVEL(C.AV_LOG_INFO)
	AV_LOG_VERBOSE = AV_LOG_LEVEL(C.AV_LOG_VERBOSE)
	AV_LOG_DEBUG   = AV_LOG_LEVEL(C.AV_LOG_DEBUG)
	AV_LOG_TRACE   = AV_LOG_LEVEL(C.AV_LOG_TRACE)
)
View Source
const (
	AV_OPT_FLAG_ENCODING_PARAM  = int(C.AV_OPT_FLAG_ENCODING_PARAM) ///< a generic parameter which can be set by the user for muxing or encoding
	AV_OPT_FLAG_DECODING_PARAM  = int(C.AV_OPT_FLAG_DECODING_PARAM) ///< a generic parameter which can be set by the user for demuxing or decoding
	AV_OPT_FLAG_AUDIO_PARAM     = int(C.AV_OPT_FLAG_AUDIO_PARAM)
	AV_OPT_FLAG_VIDEO_PARAM     = int(C.AV_OPT_FLAG_VIDEO_PARAM)
	AV_OPT_FLAG_SUBTITLE_PARAM  = int(C.AV_OPT_FLAG_SUBTITLE_PARAM)
	AV_OPT_FLAG_EXPORT          = int(C.AV_OPT_FLAG_EXPORT)
	AV_OPT_FLAG_READONLY        = int(C.AV_OPT_FLAG_READONLY)
	AV_OPT_FLAG_BSF_PARAM       = int(C.AV_OPT_FLAG_BSF_PARAM)       ///< a generic parameter which can be set by the user for bit stream filtering
	AV_OPT_FLAG_RUNTIME_PARAM   = int(C.AV_OPT_FLAG_RUNTIME_PARAM)   ///< a generic parameter which can be set by the user at runtime
	AV_OPT_FLAG_FILTERING_PARAM = int(C.AV_OPT_FLAG_FILTERING_PARAM) ///< a generic parameter which can be set by the user for filtering
	AV_OPT_FLAG_DEPRECATED      = int(C.AV_OPT_FLAG_DEPRECATED)      ///< set if option is deprecated, users should refer to AVOption.help text for more information
	AV_OPT_FLAG_CHILD_CONSTS    = int(C.AV_OPT_FLAG_CHILD_CONSTS)    ///< set if option constants can also reside in child objects
)
View Source
const (
	AV_OPT_SEARCH_CHILDREN       = int(C.AV_OPT_SEARCH_CHILDREN)
	AV_OPT_SEARCH_FAKE_OBJ       = int(C.AV_OPT_SEARCH_FAKE_OBJ)
	AV_OPT_ALLOW_NULL            = int(C.AV_OPT_ALLOW_NULL)
	AV_OPT_MULTI_COMPONENT_RANGE = int(C.AV_OPT_MULTI_COMPONENT_RANGE)
)
View Source
const (
	AVFMT_FLAG_GENPTS          = int(C.AVFMT_FLAG_GENPTS)          ///< Generate missing pts even if it requires parsing future frames.
	AVFMT_FLAG_IGNIDX          = int(C.AVFMT_FLAG_IGNIDX)          ///< Ignore index.
	AVFMT_FLAG_NONBLOCK        = int(C.AVFMT_FLAG_NONBLOCK)        ///< Do not block when reading packets from input.
	AVFMT_FLAG_IGNDTS          = int(C.AVFMT_FLAG_IGNDTS)          ///< Ignore DTS on frames that contain both DTS & PTS
	AVFMT_FLAG_NOFILLIN        = int(C.AVFMT_FLAG_NOFILLIN)        ///< Do not infer any values from other values, just return what is stored in the container
	AVFMT_FLAG_NOPARSE         = int(C.AVFMT_FLAG_NOPARSE)         ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
	AVFMT_FLAG_NOBUFFER        = int(C.AVFMT_FLAG_NOBUFFER)        ///< Do not buffer frames when possible
	AVFMT_FLAG_CUSTOM_IO       = int(C.AVFMT_FLAG_CUSTOM_IO)       ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
	AVFMT_FLAG_DISCARD_CORRUPT = int(C.AVFMT_FLAG_DISCARD_CORRUPT) ///< Discard frames marked corrupted
	AVFMT_FLAG_FLUSH_PACKETS   = int(C.AVFMT_FLAG_FLUSH_PACKETS)   ///< Flush the AVIOContext every packet.
	AVFMT_FLAG_BITEXACT        = int(C.AVFMT_FLAG_BITEXACT)        // When muxing, try to avoid writing any random/volatile data to the output. This includes any random IDs, real-time timestamps/dates, muxer version, etc. This flag is mainly intended for testing.
	AVFMT_FLAG_SORT_DTS        = int(C.AVFMT_FLAG_SORT_DTS)        ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
	AVFMT_FLAG_FAST_SEEK       = int(C.AVFMT_FLAG_FAST_SEEK)       ///< Enable fast, but inaccurate seeks for some formats
	AVFMT_FLAG_SHORTEST        = int(C.AVFMT_FLAG_SHORTEST)        ///< Stop muxing when the shortest stream stops.
	AVFMT_FLAG_AUTO_BSF        = int(C.AVFMT_FLAG_AUTO_BSF)        ///< Add bitstream filters as requested by the muxer
)
View Source
const (
	AVIO_FLAG_READ       = int(C.AVIO_FLAG_READ)
	AVIO_FLAG_WRITE      = int(C.AVIO_FLAG_WRITE)
	AVIO_FLAG_READ_WRITE = int(C.AVIO_FLAG_READ_WRITE)
)
View Source
const (
	AVMEDIA_TYPE_UNKNOWN    = AVMEDIA_TYPE(C.AVMEDIA_TYPE_UNKNOWN)
	AVMEDIA_TYPE_VIDEO      = AVMEDIA_TYPE(C.AVMEDIA_TYPE_VIDEO)
	AVMEDIA_TYPE_AUDIO      = AVMEDIA_TYPE(C.AVMEDIA_TYPE_AUDIO)
	AVMEDIA_TYPE_DATA       = AVMEDIA_TYPE(C.AVMEDIA_TYPE_DATA)
	AVMEDIA_TYPE_SUBTITLE   = AVMEDIA_TYPE(C.AVMEDIA_TYPE_SUBTITLE)
	AVMEDIA_TYPE_ATTACHMENT = AVMEDIA_TYPE(C.AVMEDIA_TYPE_ATTACHMENT)
)
View Source
const (
	AV_ROUND_ZERO        = uint32(C.AV_ROUND_ZERO)
	AV_ROUND_INF         = uint32(C.AV_ROUND_INF)
	AV_ROUND_DOWN        = uint32(C.AV_ROUND_DOWN)
	AV_ROUND_UP          = uint32(C.AV_ROUND_UP)
	AV_ROUND_NEAR_INF    = uint32(C.AV_ROUND_NEAR_INF)
	AV_ROUND_PASS_MINMAX = uint32(C.AV_ROUND_PASS_MINMAX)
)
View Source
const AV_NOPTS_VALUE = int64(C.AV_NOPTS_VALUE)
View Source
const IO_BUFFER_SIZE int = 32768 // 32 KB

Variables

View Source
var (
	ErrInvalidParam  = errors.New("invalid parameter")
	ErrMemoryFailure = errors.New("memory failure")
)

Functions

func AVCodecParametersCopy

func AVCodecParametersCopy(dst, src *AVCodecParameters) (err error)

func AVLogSetLevel

func AVLogSetLevel(level AV_LOG_LEVEL)

func AVRescaleQ

func AVRescaleQ(a int64, bq, cq AVRational) int64

func AVRescaleQRnd

func AVRescaleQRnd(a int64, bq, cq AVRational, rnd uint32) int64

func AVTs2Str

func AVTs2Str(ts int64) string

func AVTs2TimeStr

func AVTs2TimeStr(ts int64, timebase AVRational) string

func CompareAVRational

func CompareAVRational(a, b AVRational) int

func GetAVError

func GetAVError(cerr C.int) (err error)

Types

type AVClass

type AVClass interface {
	AVClass() AVClassObject
}

type AVClassObject

type AVClassObject struct {
	AVClass unsafe.Pointer
}

func (AVClassObject) AVLog

func (avcl AVClassObject) AVLog(level AV_LOG_LEVEL, format string, a ...interface{})

func (AVClassObject) AVOptSet

func (avcl AVClassObject) AVOptSet(key, value string, searchFlags int) (err error)

func (AVClassObject) AVOptSetBytes

func (avcl AVClassObject) AVOptSetBytes(key string, value []byte, searchFlags int) (err error)

func (AVClassObject) AVOptSetDefaults

func (avcl AVClassObject) AVOptSetDefaults()

func (AVClassObject) AVOptSetDefaults2

func (avcl AVClassObject) AVOptSetDefaults2(mask, flags int)

func (AVClassObject) AVOptSetDict

func (avcl AVClassObject) AVOptSetDict(avdict *AVDictionary, searchFlags int) (err error)

func (AVClassObject) AVOptSetDictVal

func (avcl AVClassObject) AVOptSetDictVal(key string, avdict *AVDictionary, searchFlags int) (err error)

func (AVClassObject) AVOptSetFloat64

func (avcl AVClassObject) AVOptSetFloat64(key string, value float64, searchFlags int) (err error)

func (AVClassObject) AVOptSetImageSize

func (avcl AVClassObject) AVOptSetImageSize(key string, width, height int, searchFlags int) (err error)

func (AVClassObject) AVOptSetInt64

func (avcl AVClassObject) AVOptSetInt64(key string, value int64, searchFlags int) (err error)

func (AVClassObject) SetAVClass

func (avcl AVClassObject) SetAVClass(cls *C.AVClass)

type AVCodec

type AVCodec struct {
	AVCodec *C.AVCodec
}

type AVCodecParameters

type AVCodecParameters struct {
	AVCodecParameters *C.AVCodecParameters
}

func (*AVCodecParameters) AVCodecType

func (p *AVCodecParameters) AVCodecType() AVMEDIA_TYPE

func (*AVCodecParameters) SetAVCodecTag

func (p *AVCodecParameters) SetAVCodecTag(codecTag uint32)

type AVDictionary

type AVDictionary struct {
	GoMap        map[string]string
	AVDictionary *C.struct_AVDictionary
}

func NewDict

func NewDict(values map[string]string) (avdict *AVDictionary, err error)

func (*AVDictionary) Del

func (avdict *AVDictionary) Del(key string) (err error)

func (*AVDictionary) Set

func (avdict *AVDictionary) Set(key, value string) (err error)

type AVError

type AVError struct {
	Code int
	// contains filtered or unexported fields
}

func (AVError) Error

func (err AVError) Error() string

type AVFormatContext

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

func AVFormatOpenInput

func AVFormatOpenInput(c *AVFormatContext, avioctx *AVIOContext, url string, inputFormat *AVInputFormat, options *AVDictionary) (ctx *AVFormatContext, err error)

func AVFormatOpenOutput

func AVFormatOpenOutput(c *AVFormatContext, avioctx *AVIOContext, url string, outputFormat *AVOutputFormat, options *AVDictionary) (ctx *AVFormatContext, err error)

func NewAVFormatContext

func NewAVFormatContext() (avfmtctx *AVFormatContext, err error)

func (*AVFormatContext) AVClass

func (c *AVFormatContext) AVClass() AVClassObject

func (*AVFormatContext) AVFindStreamInfo

func (c *AVFormatContext) AVFindStreamInfo() (err error)

func (*AVFormatContext) AVFormatWriteHeader

func (c *AVFormatContext) AVFormatWriteHeader() (err error)

func (*AVFormatContext) AVInterleavedWriteFrame

func (c *AVFormatContext) AVInterleavedWriteFrame(packet *AVPacket) (err error)

func (*AVFormatContext) AVReadFrame

func (c *AVFormatContext) AVReadFrame() (packet *AVPacket, err error)

func (*AVFormatContext) AVStreamAtIndex

func (c *AVFormatContext) AVStreamAtIndex(index int) (stream *AVStream)

func (*AVFormatContext) AVStreams

func (c *AVFormatContext) AVStreams() (streams []*AVStream)

func (*AVFormatContext) AVWriteTrailer

func (c *AVFormatContext) AVWriteTrailer() (err error)

func (*AVFormatContext) Close

func (c *AVFormatContext) Close() (err error)

func (*AVFormatContext) DumpFormat

func (c *AVFormatContext) DumpFormat(index int, url string, isOutput bool)

func (*AVFormatContext) Flags

func (c *AVFormatContext) Flags() int

func (*AVFormatContext) NewAVStream

func (c *AVFormatContext) NewAVStream(codec *AVCodec) (stream *AVStream, err error)

func (*AVFormatContext) SetAVIOContext

func (c *AVFormatContext) SetAVIOContext(avioctx *AVIOContext)

func (*AVFormatContext) SetAVInputFormat

func (c *AVFormatContext) SetAVInputFormat(avfmt *AVInputFormat) (err error)

func (*AVFormatContext) SetAVOutputFormat

func (c *AVFormatContext) SetAVOutputFormat(avfmt *AVOutputFormat) (err error)

func (*AVFormatContext) SetFlag

func (c *AVFormatContext) SetFlag(flag int)

func (*AVFormatContext) SetURL

func (c *AVFormatContext) SetURL(url string) (err error)

func (*AVFormatContext) UnsetFlag

func (c *AVFormatContext) UnsetFlag(flag int)

type AVIOContext

type AVIOContext struct {
	AVIOContext *C.AVIOContext
	Handlers    AVIOHandlers
	CgoHandle   cgo.Handle
}

func AVIOOpen

func AVIOOpen(url string, flags int) (avioctx *AVIOContext, err error)

func NewAVIOContext

func NewAVIOContext(handlers *AVIOHandlers) (avioctx *AVIOContext, err error)

AVIOContext constructor. Use it only if You need custom IO behaviour!

func (*AVIOContext) AVClass

func (c *AVIOContext) AVClass() AVClassObject

func (*AVIOContext) Close

func (c *AVIOContext) Close() (err error)

func (*AVIOContext) Flush

func (c *AVIOContext) Flush()

type AVIOHandlers

type AVIOHandlers struct {
	Read  func(p []byte) (n int, err error)
	Write func(p []byte) (n int, err error)
	Seek  func(offset int64, whence int) (int64, error)
}

Functions prototypes for custom IO. Implement necessary prototypes and pass instance pointer to NewAVIOContext.

E.g.:

var reader io.Reader

avioctx := NewAVIOContext(ctx, &AVIOHandlers{Read: reader.Read})

type AVInputFormat

type AVInputFormat struct {
	AVInputFormat *C.AVInputFormat
}

func AVFindInputFormat

func AVFindInputFormat(shortName string) *AVInputFormat

func (AVInputFormat) LongName

func (avfmt AVInputFormat) LongName() string

func (AVInputFormat) ShortNames

func (avfmt AVInputFormat) ShortNames() []string

type AVMEDIA_TYPE

type AVMEDIA_TYPE int

type AVOutputFormat

type AVOutputFormat struct {
	AVOutputFormat *C.AVOutputFormat
}

func AVFindOutputFormat

func AVFindOutputFormat(shortName, filename, mimeType string) *AVOutputFormat

func (AVOutputFormat) LongName

func (avfmt AVOutputFormat) LongName() string

func (AVOutputFormat) ShortNames

func (avfmt AVOutputFormat) ShortNames() []string

type AVPacket

type AVPacket struct {
	AVPacket *C.AVPacket
}

func NewAVPacket

func NewAVPacket() (packet *AVPacket, err error)

func NewAVPacketWithCBytes

func NewAVPacketWithCBytes(data *C.uint8_t, size C.int) (packet *AVPacket, err error)

func NewAVPacketWithSize

func NewAVPacketWithSize(size int) (packet *AVPacket, err error)

func (*AVPacket) Clone

func (packet *AVPacket) Clone() (ref *AVPacket, err error)

func (*AVPacket) Close

func (packet *AVPacket) Close() (err error)

func (*AVPacket) CopyProps

func (packet *AVPacket) CopyProps(dst *AVPacket) (err error)

func (*AVPacket) DTS

func (packet *AVPacket) DTS() (dts int64)

func (*AVPacket) Duration

func (packet *AVPacket) Duration() (duration int64)

func (*AVPacket) Grow

func (packet *AVPacket) Grow(growBy int) (err error)

func (*AVPacket) MoveRef

func (packet *AVPacket) MoveRef(dst *AVPacket)

func (*AVPacket) PTS

func (packet *AVPacket) PTS() (pts int64)

func (*AVPacket) Pos

func (packet *AVPacket) Pos() (pos int64)

func (*AVPacket) Ref

func (packet *AVPacket) Ref(dst *AVPacket) (err error)

func (*AVPacket) SetDTS

func (packet *AVPacket) SetDTS(dts int64)

func (*AVPacket) SetDuration

func (packet *AVPacket) SetDuration(duration int64)

func (*AVPacket) SetPTS

func (packet *AVPacket) SetPTS(pts int64)

func (*AVPacket) SetPos

func (packet *AVPacket) SetPos(pos int64)

func (*AVPacket) SetStreamIndex

func (packet *AVPacket) SetStreamIndex(index int)

func (*AVPacket) Shrink

func (packet *AVPacket) Shrink(size int)

func (*AVPacket) StreamIndex

func (packet *AVPacket) StreamIndex() (index int)

func (*AVPacket) Unref

func (packet *AVPacket) Unref()

type AVRational

type AVRational C.AVRational

func NewAVRational

func NewAVRational(numerator, demoninator int) AVRational

func (AVRational) Denominator

func (r AVRational) Denominator() int

func (AVRational) Numerator

func (r AVRational) Numerator() int

type AVStream

type AVStream struct {
	AVStream *C.AVStream
}

func (*AVStream) AVCodecParameters

func (s *AVStream) AVCodecParameters() *AVCodecParameters

func (*AVStream) SetTimeBase

func (s *AVStream) SetTimeBase(timebase AVRational)

func (*AVStream) TimeBase

func (s *AVStream) TimeBase() AVRational

type AV_LOG_LEVEL

type AV_LOG_LEVEL int

Jump to

Keyboard shortcuts

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