features

package
v0.0.0-...-b3777ea Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MediaTypeFromString = map[string]MediaType{
	"audio":    MediaTypeAudio,
	"video":    MediaTypeVideo,
	"subtitle": MediaTypeSubtitle,
	"data":     MediaTypeData,
}
View Source
var MediaTypeToString = map[MediaType]string{
	MediaTypeAudio:    "audio",
	MediaTypeVideo:    "video",
	MediaTypeSubtitle: "subtitle",
	MediaTypeData:     "data",
}
View Source
var OptionTypeFromString = map[string]OptionType{
	"flags":          OptionTypeFlags,
	"int":            OptionTypeInt,
	"int64":          OptionTypeInt64,
	"double":         OptionTypeDouble,
	"float":          OptionTypeFloat,
	"string":         OptionTypeString,
	"rational":       OptionTypeRational,
	"binary":         OptionTypeBinary,
	"dictionary":     OptionTypeDictionary,
	"uint64":         OptionTypeUInt64,
	"const":          OptionTypeConst,
	"image_size":     OptionTypeImageSize,
	"pix_fmt":        OptionTypePixFmt,
	"sample_fmt":     OptionTypeSampleFmt,
	"video_rate":     OptionTypeVideoRate,
	"duration":       OptionTypeDuration,
	"color":          OptionTypeColor,
	"channel_layout": OptionTypeChannelLayout,
	"boolean":        OptionTypeBoolean,
}
View Source
var OptionTypeToString = map[OptionType]string{
	OptionTypeFlags:         "flags",
	OptionTypeInt:           "int",
	OptionTypeInt64:         "int64",
	OptionTypeDouble:        "double",
	OptionTypeFloat:         "float",
	OptionTypeString:        "string",
	OptionTypeRational:      "rational",
	OptionTypeBinary:        "binary",
	OptionTypeDictionary:    "dictionary",
	OptionTypeUInt64:        "uint64",
	OptionTypeConst:         "const",
	OptionTypeImageSize:     "image_size",
	OptionTypePixFmt:        "pix_fmt",
	OptionTypeSampleFmt:     "sample_fmt",
	OptionTypeVideoRate:     "video_rate",
	OptionTypeDuration:      "duration",
	OptionTypeColor:         "color",
	OptionTypeChannelLayout: "channel_layout",
	OptionTypeBoolean:       "boolean",
}

Functions

This section is empty.

Types

type AVOption

type AVOption struct {
	Name            string          `json:"name"`
	Description     string          `json:"description"`
	Encoding        bool            `json:"encoding"`
	Decoding        bool            `json:"decoding"`
	Filtering       bool            `json:"filtering"`
	Audio           bool            `json:"audio"`
	Video           bool            `json:"video"`
	Subtitle        bool            `json:"subtitle"`
	Export          bool            `json:"export"`
	Readonly        bool            `json:"readonly"`
	BitstreamFilter bool            `json:"bitstream_filter"`
	RuntimeParam    bool            `json:"runtime_param"`
	Type            OptionType      `json:"type"`
	Min             string          `json:"min"` // TODO: int etc?
	Max             string          `json:"max"`
	Default         string          `json:"default"`
	Constants       []AVOptionConst `json:"constants"` // used for enum and flags

}

func CodecContextOptions

func CodecContextOptions(ffmpegPath string) ([]AVOption, error)

func FilterOptions

func FilterOptions(ffmpegPath string) ([]AVOption, error)

func FormatContextOptions

func FormatContextOptions(ffmpegPath string) ([]AVOption, error)

type AVOptionConst

type AVOptionConst struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Encoding    bool   `json:"encoding"`
	Decoding    bool   `json:"decoding"`
	Audio       bool   `json:"audio"`
	Video       bool   `json:"video"`
	Value       int    `json:"value"`
}

AVOptionConst used for enum and flags

type Codec

type Codec struct {
	Name        string    `json:"name"`
	Description string    `json:"description"`
	MediaType   MediaType `json:"media_type"`
	Decoders    []string  `json:"decoders"`
	Encoders    []string  `json:"encoders"`
}

func Codecs

func Codecs(ffmpegPath string) ([]Codec, error)

type Coder

type Coder struct {
	Name                  string     `json:"name"`
	Description           string     `json:"description"`
	MediaType             MediaType  `json:"media_type"`
	Codec                 string     `json:"codec"`
	GeneralCapabilities   []string   `json:"general_capabilities"`
	ThreadingCapabilities []string   `json:"threading_capabilities"`
	FrameRates            []string   `json:"frame_rates"`
	PixelFormats          []string   `json:"pixel_formats"`
	SampleRates           []string   `json:"sample_rates"`
	SampleFormats         []string   `json:"sample_formats"`
	ChannelLayouts        []string   `json:"channel_layouts"`
	Options               []AVOption `json:"options"`
}

Coder is a encoder or decoder

func Decoders

func Decoders(ffmpegPath string) ([]Coder, error)

func Encoders

func Encoders(ffmpegPath string) ([]Coder, error)

type Features

type Features struct {
	Version              VersionParts `json:"version"`
	Codecs               []Codec      `json:"codecs"`
	Encoders             []Coder      `json:"encoders"`
	Decoders             []Coder      `json:"decoders"`
	Muxers               []Format     `json:"muxers"`
	Demuxers             []Format     `json:"demuxers"`
	Filters              []Filter     `json:"filters"`
	PixelFmts            []PixelFmt   `json:"pixel_fmts"`
	SampleFmts           []SampleFmt  `json:"sample_fmts"`
	FormatContextOptions []AVOption   `json:"format_context_options"`
	CodecContextOptions  []AVOption   `json:"codec_context_options"`
	FilterOptions        []AVOption   `json:"filter_options"`
}

func LoadFeatures

func LoadFeatures(ffmpegPath string) (Features, error)

type Filter

type Filter struct {
	Name            string              `json:"name"`
	Description     string              `json:"description"`
	TimelineSupport bool                `json:"timeline_support"`
	SliceThreading  bool                `json:"slice_threading"`
	CommandSupport  bool                `json:"command_support"`
	InputsDynamic   bool                `json:"inputs_dynamic"`
	OutputsDynamic  bool                `json:"outputs_dynamic"`
	Inputs          []FilterInputOutput `json:"inputs"`
	Outputs         []FilterInputOutput `json:"outputs"`
	Options         []AVOption          `json:"options"`
}

Filter

func Filters

func Filters(ffmpegPath string) ([]Filter, error)

type FilterInputOutput

type FilterInputOutput struct {
	Name      string    `json:"name"`
	MediaType MediaType `json:"media_type"`
}

type Format

type Format struct {
	Name              string     `json:"name"`
	Description       string     `json:"description"`
	Extensions        []string   `json:"extensions"`
	MIMEType          string     `json:"mime_type"`
	DefaultAudioCodec string     `json:"default_audio_codec"`
	DefaultVideoCodec string     `json:"default_video_codec"`
	Options           []AVOption `json:"options"`
}

Format is a muxer or demuxer

func Demuxers

func Demuxers(ffmpegPath string) ([]Format, error)

func Muxers

func Muxers(ffmpegPath string) ([]Format, error)

type MediaType

type MediaType uint
const (
	MediaTypeAudio MediaType = iota
	MediaTypeVideo
	MediaTypeSubtitle
	MediaTypeData
)

func (MediaType) JSONSchemaEnums

func (MediaType) JSONSchemaEnums() []interface{}

func (MediaType) MarshalJSON

func (mt MediaType) MarshalJSON() ([]byte, error)

func (MediaType) String

func (mt MediaType) String() string

func (*MediaType) UnmarshalJSON

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

type OptionType

type OptionType uint
const (
	OptionTypeFlags OptionType = iota
	OptionTypeInt
	OptionTypeInt64
	OptionTypeDouble
	OptionTypeFloat
	OptionTypeString
	OptionTypeRational
	OptionTypeBinary
	OptionTypeDictionary
	OptionTypeUInt64
	OptionTypeConst
	OptionTypeImageSize
	OptionTypePixFmt
	OptionTypeSampleFmt
	OptionTypeVideoRate
	OptionTypeDuration
	OptionTypeColor
	OptionTypeChannelLayout
	OptionTypeBoolean
)

func (OptionType) JSONSchemaEnums

func (OptionType) JSONSchemaEnums() []interface{}

func (OptionType) MarshalJSON

func (ot OptionType) MarshalJSON() ([]byte, error)

func (OptionType) String

func (ot OptionType) String() string

func (*OptionType) UnmarshalJSON

func (ot *OptionType) UnmarshalJSON(text []byte) error

type PixelFmt

type PixelFmt struct {
	Name         string `json:"name"`
	Input        bool   `json:"input"`
	Output       bool   `json:"output"`
	NbComponents uint   `json:"nb_components"`
	BitsPerPixel uint   `json:"bits_per_pixel"`
}

func PixelFmts

func PixelFmts(ffmpegPath string) ([]PixelFmt, error)

type SampleFmt

type SampleFmt struct {
	Name  string `json:"name"`
	Depth uint   `json:"depth"`
}

func SampleFmts

func SampleFmts(ffmpegPath string) ([]SampleFmt, error)

type VersionParts

type VersionParts struct {
	Full    string `json:"full"`
	Release string `json:"release"`
	Major   uint   `json:"major"`
	Minor   uint   `json:"minor"`
	Patch   uint   `json:"patch"`
}

func Version

func Version(ffmpegPath string) (VersionParts, error)

Jump to

Keyboard shortcuts

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