gmf

package module
v0.0.0-...-a4d7a9a Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2017 License: MIT Imports: 9 Imported by: 0

README

Go FFmpeg Bindings

This is a forked version from github.com/3d0c/gmf without references to pkgconfig.

Status: beta

It covers very basic avformat, avcodec and swscale features.
More bindings and cool features are coming soon.

Installation

Prerequisites

Current master branch requires go 1.6.
Older versions available in branches go1.2 and go1.5.

Build

build lastest version of ffmpeg, obtained from https://github.com/FFmpeg/FFmpeg
There is one required option, which is disabled by default, you should turn on: --enable-shared

E.g.:

./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-libvorbis
make -j4
make install

Run exporting CGO paths:

export CGO_CFLAGS="-I/usr/local/ffmpeg/include"
export CGO_LDFLAGS="-L/usr/local/ffmpeg/lib -lavcodec -lavutil -lavformat -lavdevice -lavfilter -lswresample -lswscale"

Then just run

go get github.com/aimlabmu/gmf

Usage

Please see examples and tests.

Credits

Abandoned project on code.google.com/p/gmf. Original code is available at github.com/3d0c/gmf in intitial commit from 03 Apr 2013.

Documentation

Overview

Format.

2015 Sleepy Programmer <hunan@emsym.com>

Index

Constants

View Source
const (
	// Logging levels
	AV_LOG_QUIET   int = C.AV_LOG_QUIET
	AV_LOG_PANIC   int = C.AV_LOG_PANIC
	AV_LOG_FATAL   int = C.AV_LOG_FATAL
	AV_LOG_ERROR   int = C.AV_LOG_ERROR
	AV_LOG_WARNING int = C.AV_LOG_WARNING
	AV_LOG_INFO    int = C.AV_LOG_INFO
	AV_LOG_VERBOSE int = C.AV_LOG_VERBOSE
	AV_LOG_DEBUG   int = C.AV_LOG_DEBUG
)

Variables

View Source
var (
	AVMEDIA_TYPE_AUDIO int32 = C.AVMEDIA_TYPE_AUDIO
	AVMEDIA_TYPE_VIDEO int32 = C.AVMEDIA_TYPE_VIDEO

	AV_PIX_FMT_BGR24    int32 = C.AV_PIX_FMT_BGR24
	AV_PIX_FMT_BGR32    int32 = C.AV_PIX_FMT_BGR32
	AV_PIX_FMT_GRAY8    int32 = C.AV_PIX_FMT_GRAY8
	AV_PIX_FMT_RGB24    int32 = C.AV_PIX_FMT_RGB24
	AV_PIX_FMT_RGB32    int32 = C.AV_PIX_FMT_RGB32
	AV_PIX_FMT_YUV410P  int32 = C.AV_PIX_FMT_YUV410P
	AV_PIX_FMT_YUV411P  int32 = C.AV_PIX_FMT_YUV411P
	AV_PIX_FMT_YUV420P  int32 = C.AV_PIX_FMT_YUV420P
	AV_PIX_FMT_YUV422P  int32 = C.AV_PIX_FMT_YUV422P
	AV_PIX_FMT_YUV444P  int32 = C.AV_PIX_FMT_YUV444P
	AV_PIX_FMT_YUVJ420P int32 = C.AV_PIX_FMT_YUVJ420P
	AV_PIX_FMT_YUYV422  int32 = C.AV_PIX_FMT_YUYV422
	AV_PIX_FMT_NONE     int32 = C.AV_PIX_FMT_NONE

	FF_PROFILE_AAC_MAIN      int = C.FF_PROFILE_AAC_MAIN
	FF_PROFILE_AAC_LOW       int = C.FF_PROFILE_AAC_LOW
	FF_PROFILE_AAC_SSR       int = C.FF_PROFILE_AAC_SSR
	FF_PROFILE_AAC_LTP       int = C.FF_PROFILE_AAC_LTP
	FF_PROFILE_AAC_HE        int = C.FF_PROFILE_AAC_HE
	FF_PROFILE_AAC_HE_V2     int = C.FF_PROFILE_AAC_HE_V2
	FF_PROFILE_AAC_LD        int = C.FF_PROFILE_AAC_LD
	FF_PROFILE_AAC_ELD       int = C.FF_PROFILE_AAC_ELD
	FF_PROFILE_MPEG2_AAC_LOW int = C.FF_PROFILE_MPEG2_AAC_LOW
	FF_PROFILE_MPEG2_AAC_HE  int = C.FF_PROFILE_MPEG2_AAC_HE

	FF_PROFILE_DTS         int = C.FF_PROFILE_DTS
	FF_PROFILE_DTS_ES      int = C.FF_PROFILE_DTS_ES
	FF_PROFILE_DTS_96_24   int = C.FF_PROFILE_DTS_96_24
	FF_PROFILE_DTS_HD_HRA  int = C.FF_PROFILE_DTS_HD_HRA
	FF_PROFILE_DTS_HD_MA   int = C.FF_PROFILE_DTS_HD_MA
	FF_PROFILE_DTS_EXPRESS int = C.FF_PROFILE_DTS_EXPRESS

	FF_PROFILE_MPEG2_422          int = C.FF_PROFILE_MPEG2_422
	FF_PROFILE_MPEG2_HIGH         int = C.FF_PROFILE_MPEG2_HIGH
	FF_PROFILE_MPEG2_SS           int = C.FF_PROFILE_MPEG2_SS
	FF_PROFILE_MPEG2_SNR_SCALABLE int = C.FF_PROFILE_MPEG2_SNR_SCALABLE
	FF_PROFILE_MPEG2_MAIN         int = C.FF_PROFILE_MPEG2_MAIN
	FF_PROFILE_MPEG2_SIMPLE       int = C.FF_PROFILE_MPEG2_SIMPLE

	FF_PROFILE_H264_BASELINE            int = C.FF_PROFILE_H264_BASELINE
	FF_PROFILE_H264_MAIN                int = C.FF_PROFILE_H264_MAIN
	FF_PROFILE_H264_EXTENDED            int = C.FF_PROFILE_H264_EXTENDED
	FF_PROFILE_H264_HIGH                int = C.FF_PROFILE_H264_HIGH
	FF_PROFILE_H264_HIGH_10             int = C.FF_PROFILE_H264_HIGH_10
	FF_PROFILE_H264_HIGH_422            int = C.FF_PROFILE_H264_HIGH_422
	FF_PROFILE_H264_HIGH_444            int = C.FF_PROFILE_H264_HIGH_444
	FF_PROFILE_H264_HIGH_444_PREDICTIVE int = C.FF_PROFILE_H264_HIGH_444_PREDICTIVE
	FF_PROFILE_H264_CAVLC_444           int = C.FF_PROFILE_H264_CAVLC_444

	FF_PROFILE_VC1_SIMPLE   int = C.FF_PROFILE_VC1_SIMPLE
	FF_PROFILE_VC1_MAIN     int = C.FF_PROFILE_VC1_MAIN
	FF_PROFILE_VC1_COMPLEX  int = C.FF_PROFILE_VC1_COMPLEX
	FF_PROFILE_VC1_ADVANCED int = C.FF_PROFILE_VC1_ADVANCED

	FF_PROFILE_MPEG4_SIMPLE                    int = C.FF_PROFILE_MPEG4_SIMPLE
	FF_PROFILE_MPEG4_SIMPLE_SCALABLE           int = C.FF_PROFILE_MPEG4_SIMPLE_SCALABLE
	FF_PROFILE_MPEG4_CORE                      int = C.FF_PROFILE_MPEG4_CORE
	FF_PROFILE_MPEG4_MAIN                      int = C.FF_PROFILE_MPEG4_MAIN
	FF_PROFILE_MPEG4_N_BIT                     int = C.FF_PROFILE_MPEG4_N_BIT
	FF_PROFILE_MPEG4_SCALABLE_TEXTURE          int = C.FF_PROFILE_MPEG4_SCALABLE_TEXTURE
	FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION     int = C.FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION
	FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE    int = C.FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE
	FF_PROFILE_MPEG4_HYBRID                    int = C.FF_PROFILE_MPEG4_HYBRID
	FF_PROFILE_MPEG4_ADVANCED_REAL_TIME        int = C.FF_PROFILE_MPEG4_ADVANCED_REAL_TIME
	FF_PROFILE_MPEG4_CORE_SCALABLE             int = C.FF_PROFILE_MPEG4_CORE_SCALABLE
	FF_PROFILE_MPEG4_ADVANCED_CODING           int = C.FF_PROFILE_MPEG4_ADVANCED_CODING
	FF_PROFILE_MPEG4_ADVANCED_CORE             int = C.FF_PROFILE_MPEG4_ADVANCED_CORE
	FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE int = C.FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE
	FF_PROFILE_MPEG4_SIMPLE_STUDIO             int = C.FF_PROFILE_MPEG4_SIMPLE_STUDIO
	FF_PROFILE_MPEG4_ADVANCED_SIMPLE           int = C.FF_PROFILE_MPEG4_ADVANCED_SIMPLE

	AV_NOPTS_VALUE int64 = C.AV_NOPTS_VALUE

	FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0  int = C.FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0
	FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1  int = C.FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1
	FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION int = C.FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION
	FF_PROFILE_JPEG2000_DCINEMA_2K             int = C.FF_PROFILE_JPEG2000_DCINEMA_2K
	FF_PROFILE_JPEG2000_DCINEMA_4K             int = C.FF_PROFILE_JPEG2000_DCINEMA_4K

	FF_PROFILE_VP9_0 int = C.FF_PROFILE_VP9_0
	FF_PROFILE_VP9_1 int = C.FF_PROFILE_VP9_1
	FF_PROFILE_VP9_2 int = C.FF_PROFILE_VP9_2
	FF_PROFILE_VP9_3 int = C.FF_PROFILE_VP9_3

	FF_PROFILE_HEVC_MAIN               int = C.FF_PROFILE_HEVC_MAIN
	FF_PROFILE_HEVC_MAIN_10            int = C.FF_PROFILE_HEVC_MAIN_10
	FF_PROFILE_HEVC_MAIN_STILL_PICTURE int = C.FF_PROFILE_HEVC_MAIN_STILL_PICTURE
	FF_PROFILE_HEVC_REXT               int = C.FF_PROFILE_HEVC_REXT
)
View Source
var (
	AV_CODEC_ID_MPEG1VIDEO int = C.AV_CODEC_ID_MPEG1VIDEO
	AV_CODEC_ID_MPEG2VIDEO int = C.AV_CODEC_ID_MPEG2VIDEO
	AV_CODEC_ID_H264       int = C.AV_CODEC_ID_H264
	AV_CODEC_ID_MPEG4      int = C.AV_CODEC_ID_MPEG4
	AV_CODEC_ID_JPEG2000   int = C.AV_CODEC_ID_JPEG2000
	AV_CODEC_ID_MJPEG      int = C.AV_CODEC_ID_MJPEG
	AV_CODEC_ID_MSMPEG4V1  int = C.AV_CODEC_ID_MSMPEG4V1
	AV_CODEC_ID_MSMPEG4V2  int = C.AV_CODEC_ID_MSMPEG4V2
	AV_CODEC_ID_MSMPEG4V3  int = C.AV_CODEC_ID_MSMPEG4V3
	AV_CODEC_ID_WMV1       int = C.AV_CODEC_ID_WMV1
	AV_CODEC_ID_WMV2       int = C.AV_CODEC_ID_WMV2
	AV_CODEC_ID_FLV1       int = C.AV_CODEC_ID_FLV1
	AV_CODEC_ID_PNG        int = C.AV_CODEC_ID_PNG
	AV_CODEC_ID_TIFF       int = C.AV_CODEC_ID_TIFF
	AV_CODEC_ID_GIF        int = C.AV_CODEC_ID_GIF
	AV_CODEC_ID_RAWVIDEO   int = C.AV_CODEC_ID_RAWVIDEO

	CODEC_FLAG_GLOBAL_HEADER int = C.AV_CODEC_FLAG_GLOBAL_HEADER
	FF_MB_DECISION_SIMPLE    int = C.FF_MB_DECISION_SIMPLE
	FF_MB_DECISION_BITS      int = C.FF_MB_DECISION_BITS
	FF_MB_DECISION_RD        int = C.FF_MB_DECISION_RD

	AV_SAMPLE_FMT_U8  int32 = C.AV_SAMPLE_FMT_U8
	AV_SAMPLE_FMT_S16 int32 = C.AV_SAMPLE_FMT_S16
	AV_SAMPLE_FMT_S32 int32 = C.AV_SAMPLE_FMT_S32
	AV_SAMPLE_FMT_FLT int32 = C.AV_SAMPLE_FMT_FLT
	AV_SAMPLE_FMT_DBL int32 = C.AV_SAMPLE_FMT_DBL

	AV_SAMPLE_FMT_U8P  int32 = C.AV_SAMPLE_FMT_U8P
	AV_SAMPLE_FMT_S16P int32 = C.AV_SAMPLE_FMT_S16P
	AV_SAMPLE_FMT_S32P int32 = C.AV_SAMPLE_FMT_S32P
	AV_SAMPLE_FMT_FLTP int32 = C.AV_SAMPLE_FMT_FLTP
	AV_SAMPLE_FMT_DBLP int32 = C.AV_SAMPLE_FMT_DBLP
)
View Source
var (
	FF_COMPLIANCE_VERY_STRICT  int = C.FF_COMPLIANCE_VERY_STRICT
	FF_COMPLIANCE_STRICT       int = C.FF_COMPLIANCE_STRICT
	FF_COMPLIANCE_NORMAL       int = C.FF_COMPLIANCE_NORMAL
	FF_COMPLIANCE_UNOFFICIAL   int = C.FF_COMPLIANCE_UNOFFICIAL
	FF_COMPLIANCE_EXPERIMENTAL int = C.FF_COMPLIANCE_EXPERIMENTAL
)
View Source
var (
	AVFMT_FLAG_GENPTS int = C.AVFMT_FLAG_GENPTS
	AVFMTCTX_NOHEADER int = C.AVFMTCTX_NOHEADER
)
View Source
var (
	SWS_FAST_BILINEAR int = C.SWS_FAST_BILINEAR
	SWS_BILINEAR      int = C.SWS_BILINEAR
	SWS_BICUBIC       int = C.SWS_BICUBIC
	SWS_X             int = C.SWS_X
	SWS_POINT         int = C.SWS_POINT
	SWS_AREA          int = C.SWS_AREA
	SWS_BICUBLIN      int = C.SWS_BICUBLIN
	SWS_GAUSS         int = C.SWS_GAUSS
	SWS_SINC          int = C.SWS_SINC
	SWS_LANCZOS       int = C.SWS_LANCZOS
	SWS_SPLINE        int = C.SWS_SPLINE
)
View Source
var (
	AV_TIME_BASE   int        = C.AV_TIME_BASE
	AV_TIME_BASE_Q AVRational = AVRational{1, C.int(AV_TIME_BASE)}
)
View Source
var (
	IO_BUFFER_SIZE int = 32768
)

Functions

func AvError

func AvError(averr int) error

func CompareTimeStamp

func CompareTimeStamp(aTimestamp int, aTimebase AVRational, bTimestamp int, bTimebase AVRational) int

func GenSyntVideoNewFrame

func GenSyntVideoNewFrame(w, h int, fmt int32) chan *Frame

Synthetic video generator. It produces 25 iteratable frames. Used for tests.

func GetSampleFmtName

func GetSampleFmtName(fmt int32) string

func InitDesc

func InitDesc()

func LogSetLevel

func LogSetLevel(level int)

func NewSample

func NewSample(nbSamples, nbChannels int, format SampleFmt) error

func Release

func Release(i CgoMemoryManager)

func Rescale

func Rescale(a, b, c int64) int64

func RescaleDelta

func RescaleDelta(inTb AVRational, inTs int64, fsTb AVRational, duration int, last *int64, outTb AVRational) int64

func RescaleQ

func RescaleQ(a int64, encBase AVRational, stBase AVRational) int64

Types

type AVAudioFifo

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

func NewAVAudioFifo

func NewAVAudioFifo(sampleFormat int32, channels int, nb_samples int) *AVAudioFifo

func (*AVAudioFifo) Free

func (this *AVAudioFifo) Free()

func (*AVAudioFifo) Read

func (this *AVAudioFifo) Read(sampleCount int) *Frame

func (*AVAudioFifo) SamplesCanWrite

func (this *AVAudioFifo) SamplesCanWrite() int

func (*AVAudioFifo) SamplesToRead

func (this *AVAudioFifo) SamplesToRead() int

func (*AVAudioFifo) Write

func (this *AVAudioFifo) Write(frame *Frame) int

type AVIOContext

type AVIOContext struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewAVIOContext

func NewAVIOContext(ctx *FmtCtx, handlers *AVIOHandlers) (*AVIOContext, error)

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

func (*AVIOContext) Flush

func (this *AVIOContext) Flush()

func (*AVIOContext) Free

func (this *AVIOContext) Free()

type AVIOHandlers

type AVIOHandlers struct {
	ReadPacket  func() ([]byte, int)
	WritePacket func([]byte)
	Seek        func(int64, int) int64
}

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

E.g.:

func gridFsReader() ([]byte, int) {
	... implementation ...
	return data, length
}

avoictx := NewAVIOContext(ctx, &AVIOHandlers{ReadPacket: gridFsReader})

type AVR

type AVR struct {
	Num int
	Den int
}

func (AVR) AVRational

func (this AVR) AVRational() AVRational

type AVRational

type AVRational C.struct_AVRational

func (AVRational) AVR

func (this AVRational) AVR() AVR

type CgoMemoryManage

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

func (*CgoMemoryManage) Free

func (this *CgoMemoryManage) Free()

func (*CgoMemoryManage) Release

func (this *CgoMemoryManage) Release()

func (*CgoMemoryManage) Retain

func (this *CgoMemoryManage) Retain()

func (*CgoMemoryManage) RetainCount

func (this *CgoMemoryManage) RetainCount() int32

type CgoMemoryManager

type CgoMemoryManager interface {
	Retain()
	RetainCount() int32
	Release()
	Free()
}

type Codec

type Codec struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func FindDecoder

func FindDecoder(i interface{}) (*Codec, error)

func FindEncoder

func FindEncoder(i interface{}) (*Codec, error)

func (*Codec) Free

func (this *Codec) Free()

func (*Codec) Id

func (this *Codec) Id() int

func (*Codec) IsExperimental

func (this *Codec) IsExperimental() bool

func (*Codec) LongName

func (this *Codec) LongName() string

func (*Codec) Name

func (this *Codec) Name() string

func (*Codec) Type

func (this *Codec) Type() int

type CodecCtx

type CodecCtx struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewCodecCtx

func NewCodecCtx(codec *Codec, options ...[]*Option) *CodecCtx

func (*CodecCtx) BitRate

func (this *CodecCtx) BitRate() int

func (*CodecCtx) ChannelLayout

func (this *CodecCtx) ChannelLayout() int

func (*CodecCtx) Channels

func (this *CodecCtx) Channels() int

func (*CodecCtx) Close

func (this *CodecCtx) Close()

func (*CodecCtx) CloseAndRelease

func (this *CodecCtx) CloseAndRelease()

func (*CodecCtx) Codec

func (this *CodecCtx) Codec() *Codec

func (*CodecCtx) CopyBasic

func (this *CodecCtx) CopyBasic(ist *Stream) *CodecCtx

func (*CodecCtx) CopyExtra

func (this *CodecCtx) CopyExtra(ist *Stream) *CodecCtx

func (*CodecCtx) Dump

func (this *CodecCtx) Dump()

func (*CodecCtx) FlushBuffers

func (this *CodecCtx) FlushBuffers()

func (*CodecCtx) FrameSize

func (this *CodecCtx) FrameSize() int

func (*CodecCtx) Free

func (this *CodecCtx) Free()

func (*CodecCtx) Height

func (this *CodecCtx) Height() int

func (*CodecCtx) Id

func (this *CodecCtx) Id() int

func (*CodecCtx) IsOpen

func (this *CodecCtx) IsOpen() bool

func (*CodecCtx) Open

func (this *CodecCtx) Open(dict *Dict) error

func (*CodecCtx) PixFmt

func (this *CodecCtx) PixFmt() int32

func (*CodecCtx) Profile

func (this *CodecCtx) Profile() int

func (*CodecCtx) SampleFmt

func (this *CodecCtx) SampleFmt() int32

func (*CodecCtx) SampleRate

func (this *CodecCtx) SampleRate() int

func (*CodecCtx) SelectChannelLayout

func (this *CodecCtx) SelectChannelLayout() int

func (*CodecCtx) SelectSampleRate

func (this *CodecCtx) SelectSampleRate() int

func (*CodecCtx) SetBitRate

func (this *CodecCtx) SetBitRate(val int) *CodecCtx

func (*CodecCtx) SetChannelLayout

func (this *CodecCtx) SetChannelLayout(channelLayout int)

func (*CodecCtx) SetChannels

func (this *CodecCtx) SetChannels(val int) *CodecCtx

func (*CodecCtx) SetDimension

func (this *CodecCtx) SetDimension(w, h int) *CodecCtx

func (*CodecCtx) SetFlag

func (this *CodecCtx) SetFlag(flag int) *CodecCtx

func (*CodecCtx) SetGopSize

func (this *CodecCtx) SetGopSize(val int) *CodecCtx

func (*CodecCtx) SetHasBframes

func (this *CodecCtx) SetHasBframes(val int) *CodecCtx

func (*CodecCtx) SetHeight

func (this *CodecCtx) SetHeight(val int) *CodecCtx

func (*CodecCtx) SetMaxBFrames

func (this *CodecCtx) SetMaxBFrames(val int) *CodecCtx

func (*CodecCtx) SetMbDecision

func (this *CodecCtx) SetMbDecision(val int) *CodecCtx

func (*CodecCtx) SetOpt

func (this *CodecCtx) SetOpt()

@todo

func (*CodecCtx) SetPixFmt

func (this *CodecCtx) SetPixFmt(val int32) *CodecCtx

func (*CodecCtx) SetProfile

func (this *CodecCtx) SetProfile(profile int) *CodecCtx

func (*CodecCtx) SetSampleFmt

func (this *CodecCtx) SetSampleFmt(val int32) *CodecCtx

func (*CodecCtx) SetSampleRate

func (this *CodecCtx) SetSampleRate(val int) *CodecCtx

func (*CodecCtx) SetStrictCompliance

func (this *CodecCtx) SetStrictCompliance(val int) *CodecCtx

func (*CodecCtx) SetTimeBase

func (this *CodecCtx) SetTimeBase(val AVR) *CodecCtx

func (*CodecCtx) SetWidth

func (this *CodecCtx) SetWidth(val int) *CodecCtx

func (*CodecCtx) TimeBase

func (this *CodecCtx) TimeBase() AVRational

func (*CodecCtx) Type

func (this *CodecCtx) Type() int32

func (*CodecCtx) Width

func (this *CodecCtx) Width() int

type CodecDescriptor

type CodecDescriptor struct {
	IsEncoder bool
	// contains filtered or unexported fields
}

func (*CodecDescriptor) Id

func (this *CodecDescriptor) Id() int

func (*CodecDescriptor) LongName

func (this *CodecDescriptor) LongName() string

func (*CodecDescriptor) Name

func (this *CodecDescriptor) Name() string

func (*CodecDescriptor) Props

func (this *CodecDescriptor) Props() int

func (*CodecDescriptor) Type

func (this *CodecDescriptor) Type() int

type Dict

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

func NewDict

func NewDict(pairs []Pair) *Dict

type FmtCtx

type FmtCtx struct {
	Filename string

	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewCtx

func NewCtx() *FmtCtx

@todo return error if avCtx is null @todo start_time is it needed?

func NewInputCtx

func NewInputCtx(filename string) (*FmtCtx, error)

Just a helper for NewCtx().OpenInput()

func NewInputCtxWithFormatName

func NewInputCtxWithFormatName(filename, format string) (*FmtCtx, error)

func NewOutputCtx

func NewOutputCtx(i interface{}) (*FmtCtx, error)

func NewOutputCtxWithFormatName

func NewOutputCtxWithFormatName(filename, format string) (*FmtCtx, error)

func (*FmtCtx) AddStreamWithCodeCtx

func (this *FmtCtx) AddStreamWithCodeCtx(codeCtx *CodecCtx) (*Stream, error)

func (*FmtCtx) CloseInputAndRelease

func (this *FmtCtx) CloseInputAndRelease()

func (*FmtCtx) CloseOutputAndRelease

func (this *FmtCtx) CloseOutputAndRelease()

func (*FmtCtx) Dump

func (this *FmtCtx) Dump()

func (*FmtCtx) DumpAv

func (this *FmtCtx) DumpAv()

func (*FmtCtx) Duration

func (this *FmtCtx) Duration() int

func (*FmtCtx) FindStreamInfo

func (this *FmtCtx) FindStreamInfo() error

func (*FmtCtx) Free

func (this *FmtCtx) Free()

func (*FmtCtx) GetBestStream

func (this *FmtCtx) GetBestStream(typ int32) (*Stream, error)

func (*FmtCtx) GetNewPackets

func (this *FmtCtx) GetNewPackets() chan *Packet

func (*FmtCtx) GetNextPacket

func (this *FmtCtx) GetNextPacket() *Packet

func (*FmtCtx) GetSDPString

func (this *FmtCtx) GetSDPString() (sdp string)

func (*FmtCtx) GetStream

func (this *FmtCtx) GetStream(idx int) (*Stream, error)

func (*FmtCtx) IsGlobalHeader

func (this *FmtCtx) IsGlobalHeader() bool

func (*FmtCtx) IsNoFile

func (this *FmtCtx) IsNoFile() bool

func (*FmtCtx) NewStream

func (this *FmtCtx) NewStream(c *Codec) *Stream

func (*FmtCtx) OpenInput

func (this *FmtCtx) OpenInput(filename string) error

func (*FmtCtx) SeekFile

func (this *FmtCtx) SeekFile(ist *Stream, minTs, maxTs int64, flag int) error

func (*FmtCtx) SeekFrameAt

func (this *FmtCtx) SeekFrameAt(sec int64, streamIndex int) error

func (*FmtCtx) SetDebug

func (this *FmtCtx) SetDebug(val int) *FmtCtx

func (*FmtCtx) SetFlag

func (this *FmtCtx) SetFlag(flag int) *FmtCtx

func (*FmtCtx) SetInputFormat

func (this *FmtCtx) SetInputFormat(name string) error

func (*FmtCtx) SetOformat

func (this *FmtCtx) SetOformat(ofmt *OutputFmt) error

func (*FmtCtx) SetPb

func (this *FmtCtx) SetPb(val *AVIOContext) *FmtCtx

func (*FmtCtx) SetStartTime

func (this *FmtCtx) SetStartTime(val int) *FmtCtx

func (*FmtCtx) StartTime

func (this *FmtCtx) StartTime() int

func (*FmtCtx) StreamsCnt

func (this *FmtCtx) StreamsCnt() int

Original structure member is called instead of len(this.streams) because there is no initialized Stream wrappers in input context.

func (*FmtCtx) TsOffset

func (this *FmtCtx) TsOffset(stime int) int

func (*FmtCtx) WriteHeader

func (this *FmtCtx) WriteHeader() error

func (*FmtCtx) WritePacket

func (this *FmtCtx) WritePacket(p *Packet) error

func (*FmtCtx) WritePacketNoBuffer

func (this *FmtCtx) WritePacketNoBuffer(p *Packet) error

func (*FmtCtx) WriteSDPFile

func (this *FmtCtx) WriteSDPFile(filename string) error

func (*FmtCtx) WriteTrailer

func (this *FmtCtx) WriteTrailer()

type Frame

type Frame struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewAudioFrame

func NewAudioFrame(sampleFormat int32, channels, nb_samples int) (*Frame, error)

func NewFrame

func NewFrame() *Frame

func (*Frame) Channels

func (this *Frame) Channels() int

func (*Frame) CloneNewFrame

func (this *Frame) CloneNewFrame() *Frame

func (*Frame) EncodeNewPacket

func (this *Frame) EncodeNewPacket(cc *CodecCtx) (*Packet, bool, error)

func (*Frame) FlushNewPacket

func (this *Frame) FlushNewPacket(cc *CodecCtx) (*Packet, bool, error)

func (*Frame) Format

func (this *Frame) Format() int

AVPixelFormat for video frames, AVSampleFormat for audio

func (*Frame) Free

func (this *Frame) Free()

func (*Frame) Height

func (this *Frame) Height() int

func (*Frame) ImgAlloc

func (this *Frame) ImgAlloc() error

func (*Frame) KeyFrame

func (this *Frame) KeyFrame() int

func (*Frame) LineSize

func (this *Frame) LineSize(idx int) int

func (*Frame) NbSamples

func (this *Frame) NbSamples() int

func (*Frame) PktDts

func (this *Frame) PktDts() int

func (*Frame) PktDuration

func (this *Frame) PktDuration() int

func (*Frame) PktPos

func (this *Frame) PktPos() int

func (*Frame) PktPts

func (this *Frame) PktPts() int64

func (*Frame) Pts

func (this *Frame) Pts() int64

func (*Frame) SetBestPts

func (this *Frame) SetBestPts()

func (*Frame) SetChannelLayout

func (this *Frame) SetChannelLayout(val int) *Frame

func (*Frame) SetChannels

func (this *Frame) SetChannels(val int) *Frame

func (*Frame) SetData

func (this *Frame) SetData(idx int, lineSize int, data int) *Frame

func (*Frame) SetFormat

func (this *Frame) SetFormat(val int32) *Frame

func (*Frame) SetHeight

func (this *Frame) SetHeight(val int) *Frame

func (*Frame) SetNbSamples

func (this *Frame) SetNbSamples(val int) *Frame

func (*Frame) SetPktDts

func (this *Frame) SetPktDts(val int)

func (*Frame) SetPktPts

func (this *Frame) SetPktPts(val int64)

func (*Frame) SetPts

func (this *Frame) SetPts(val int64)

func (*Frame) SetQuality

func (this *Frame) SetQuality(val int) *Frame

func (*Frame) SetWidth

func (this *Frame) SetWidth(val int) *Frame

func (*Frame) TimeStamp

func (this *Frame) TimeStamp() int

func (*Frame) Unref

func (this *Frame) Unref()

func (*Frame) Width

func (this *Frame) Width() int

type Image

type Image struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewImage

func NewImage(w, h int, pixFmt int32, align int) (*Image, error)

@todo find better way to do allocation

func (*Image) Copy

func (this *Image) Copy(frame *Frame)

func (*Image) Free

func (this *Image) Free()

type Option

type Option struct {
	Key string
	Val interface{}
}

func (*Option) Set

func (this *Option) Set(ctx interface{})

type Options

type Options struct{}

@todo remove from code

type OutputFmt

type OutputFmt struct {
	Filename string

	CgoMemoryManage
	// contains filtered or unexported fields
}

func FindOutputFmt

func FindOutputFmt(format string, filename string, mime string) *OutputFmt

func (*OutputFmt) Free

func (this *OutputFmt) Free()

func (*OutputFmt) Infomation

func (this *OutputFmt) Infomation() string

func (*OutputFmt) LongName

func (this *OutputFmt) LongName() string

func (*OutputFmt) MimeType

func (this *OutputFmt) MimeType() string

func (*OutputFmt) Name

func (this *OutputFmt) Name() string

type Packet

type Packet struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewPacket

func NewPacket() *Packet

func (*Packet) Clone

func (this *Packet) Clone() *Packet

func (*Packet) Data

func (this *Packet) Data() []byte

func (*Packet) Decode

func (this *Packet) Decode(cc *CodecCtx) (*Frame, bool, int, error)

@todo should be private

func (*Packet) DecodeToNewFrame

func (this *Packet) DecodeToNewFrame(cc *CodecCtx) (*Frame, bool, int, error)

func (*Packet) Dts

func (this *Packet) Dts() int64

func (*Packet) Dump

func (this *Packet) Dump()

func (*Packet) Duration

func (this *Packet) Duration() int

func (*Packet) Flags

func (this *Packet) Flags() int

func (*Packet) Frames

func (this *Packet) Frames(cc *CodecCtx) chan *Frame

func (*Packet) Free

func (this *Packet) Free()

func (*Packet) GetNextFrame

func (this *Packet) GetNextFrame(cc *CodecCtx) (*Frame, error)

func (*Packet) Pos

func (this *Packet) Pos() int64

func (*Packet) Pts

func (this *Packet) Pts() int64

func (*Packet) SetDts

func (this *Packet) SetDts(val int64)

func (*Packet) SetDuration

func (this *Packet) SetDuration(duration int)

func (*Packet) SetPts

func (this *Packet) SetPts(pts int64)

func (*Packet) SetStreamIndex

func (this *Packet) SetStreamIndex(val int) *Packet

func (*Packet) Size

func (this *Packet) Size() int

func (*Packet) StreamIndex

func (this *Packet) StreamIndex() int

type Pair

type Pair struct {
	Key string
	Val string
}

type Sample

type Sample struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func (*Sample) SampleRealloc

func (this *Sample) SampleRealloc(nbSamples, nbChannels int) error

type SampleFmt

type SampleFmt int

type Stream

type Stream struct {
	Pts int64
	CgoMemoryManage
	// contains filtered or unexported fields
}

func (*Stream) CodecCtx

func (this *Stream) CodecCtx() *CodecCtx

func (*Stream) DumpContexCodec

func (this *Stream) DumpContexCodec(codec *CodecCtx)

func (*Stream) Duration

func (this *Stream) Duration() int64

func (*Stream) Free

func (this *Stream) Free()

func (*Stream) Id

func (this *Stream) Id() int

func (*Stream) Index

func (this *Stream) Index() int

func (*Stream) IsAudio

func (this *Stream) IsAudio() bool

func (*Stream) IsCodecCtxSet

func (this *Stream) IsCodecCtxSet() bool

func (*Stream) IsVideo

func (this *Stream) IsVideo() bool

func (*Stream) NbFrames

func (this *Stream) NbFrames() int

func (*Stream) SetCodecCtx

func (this *Stream) SetCodecCtx(cc *CodecCtx)

func (*Stream) SetCodecFlags

func (this *Stream) SetCodecFlags()

func (*Stream) TimeBase

func (this *Stream) TimeBase() AVRational

func (*Stream) Type

func (this *Stream) Type() int32

type SwrCtx

type SwrCtx struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewSwrCtx

func NewSwrCtx(options []*Option, cc *CodecCtx) *SwrCtx

func (*SwrCtx) Convert

func (this *SwrCtx) Convert(input *Frame) *Frame

func (*SwrCtx) Free

func (this *SwrCtx) Free()

type SwsCtx

type SwsCtx struct {
	CgoMemoryManage
	// contains filtered or unexported fields
}

func NewPicSwsCtx

func NewPicSwsCtx(srcWidth int, srcHeight int, srcPixFmt int32, dst *CodecCtx, method int) *SwsCtx

func NewSwsCtx

func NewSwsCtx(src *CodecCtx, dst *CodecCtx, method int) *SwsCtx

func (*SwsCtx) Free

func (this *SwsCtx) Free()

func (*SwsCtx) Scale

func (this *SwsCtx) Scale(src *Frame, dst *Frame)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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