Documentation
¶
Index ¶
- Constants
- Variables
- type ComplexFilterOption
- type Configuration
- type DecodingOptions
- type DefaultStdErrResults
- type EncodingOptions
- type FFMpeg
- type FilterOptions
- type Format
- type GlobalOptions
- type Input
- type InputOptions
- type LogOptions
- type MapOption
- type MapOptions
- type Number
- type Output
- type OutputOptions
- type PixelFormat
- type Ratio
- type Scale
- type StdErrParser
- type StreamOption
- type StreamSpecifier
Constants ¶
const ( // Show everything, including debugging information. LogLevelDebug = "debug" // Show all errors, including ones which can be recovered from. LogLevelError = "error" // Only show fatal errors. These are errors after which the process absolutely cannot continue. LogLevelFatal = "fatal" // Show informative messages during processing. This is in addition to warnings and errors. This is the default // value. LogLevelInfo = "info" // Only show fatal errors which could lead the process to crash, such as an assertion failure. This is not // currently used for anything. LogLevelPanic = "panic" // Show nothing at all; be silent. LogLevelQuiet = "quiet" // Same as info, except more verbose. LogLevelTrace = "trace" // Same as info, except more verbose. LogLevelVerbose = "verbose" // Show all warnings and errors. Any message related to possibly incorrect or unexpected events will be shown. LogLevelWarning = "warning" )
Log levels
const ( StreamSpecifierTypeAudio = "a" StreamSpecifierTypeSubtitle = "s" StreamSpecifierTypeVideo = "v" StreamSpecifierTypeVideoAndNotThumbnail = "V" )
Stream specifier types
const ( DeinterlacingModeAdaptive = "adaptive" DeinterlacingModeBob = "bob" DeinterlacingModeWeave = "weave" )
Deinterlacing modes
const ( CoderAC = "ac" CoderCABAC = "cabac" CoderCAVLC = "cavlc" CoderDefault = "default" CoderVLC = "vlc" )
Coders
const ( PresetUltrafast = "ultrafast" PresetSuperfast = "superfast" PresetVeryfast = "veryfast" PresetFaster = "faster" PresetFast = "fast" PresetMedium = "medium" PresetSlow = "slow" PresetSlower = "slower" PresetVeryslow = "veryslow" )
Presets
const ( ProfileBaseline = "baseline" ProfileHigh = "high" ProfileHigh10 = "high10" ProfileHigh422 = "high422" ProfileHigh444 = "high444" ProfileMain = "main" )
Profiles
const ( TuneAnimation = "animation" TuneFastdecode = "fastdecode" TuneFilm = "film" TuneGrain = "grain" TuneStillimage = "stillimage" TuneZerolatency = "zerolatency" )
Tunes
Variables ¶
var (
BinaryPath = flag.String("ffmpeg-binary-path", "", "the FFMpeg binary path")
)
Flags
Functions ¶
This section is empty.
Types ¶
type ComplexFilterOption ¶
type ComplexFilterOption struct { Filters []string InputStreams []StreamSpecifier OutputStreams []StreamSpecifier }
ComplexFilterOption represents complex filter options
type Configuration ¶
type Configuration struct {
BinaryPath string `toml:"binary_path"`
}
Configuration represents the ffmpeg configuration
func FlagConfig ¶
func FlagConfig() Configuration
FlagConfig generates a Configuration based on flags
type DecodingOptions ¶
type DecodingOptions struct { Codec *StreamOption DeinterlacingMode string DropSecondField *bool Duration time.Duration HardwareAcceleration string HardwareAccelerationDevice *int Position time.Duration }
DecodingOptions represents decoding options
type DefaultStdErrResults ¶
type DefaultStdErrResults struct { Bitrate *float64 // bits/s FPS *int Frame *int Q *float64 Size *int // bits Speed *float64 Time *time.Duration }
DefaultStdErrResults represents default stderr results
type EncodingOptions ¶
type EncodingOptions struct { AudioSamplerate *int BFrames *int Bitrate []StreamOption BStrategy *int BufSize *Number Codec []StreamOption Coder string ComplexFilter string ComplexFilters []ComplexFilterOption ConstantQuality *float64 CRF *int Filters []StreamOption Framerate *float64 Frames []StreamOption GOP *int KeyintMin *int Level *float64 Maxrate []StreamOption Minrate []StreamOption Preset string Profile string Quality []StreamOption RateControl string SCThreshold *int Tune string }
EncodingOptions represents encoding options
type FFMpeg ¶
type FFMpeg struct {
// contains filtered or unexported fields
}
FFMpeg represents an entity capable of running an FFMpeg binary https://ffmpeg.org/ffmpeg.html
func (*FFMpeg) Exec ¶
Exec executes the binary with the specified options ffmpeg [global_options] {[input_file_options] -i input_url} ... [output_file_options] output_url
func (*FFMpeg) SetStdErrParser ¶
func (f *FFMpeg) SetStdErrParser(s StdErrParser)
SetStdErrParser sets the stderr parser
type FilterOptions ¶
FilterOptions represents filter options
type Format ¶ added in v0.3.0
type Format struct {
PixelFormats []PixelFormat
}
Format represents a format filter
type GlobalOptions ¶
type GlobalOptions struct { Log *LogOptions NoStats bool Overwrite *bool // Dump full command line and console output to a file named program-YYYYMMDD-HHMMSS.log in the current directory. // This file can be useful for bug reports. It also implies -loglevel verbose. Report bool }
GlobalOptions represents global options
type InputOptions ¶
type InputOptions struct {
Decoding *DecodingOptions
}
InputOptions represents input options
type LogOptions ¶
LogOptions represents log options
type MapOption ¶
type MapOption struct { InputFileID int Stream *StreamSpecifier }
MapOption represents a map option
type Number ¶
type Number struct { BinaryMultiple bool // Result will be based on powers of 1024 instead of powers of 1000. ByteMultiple bool // Multiplies the value by 8. Prefix string // K, M, G, ... Value interface{} }
Number represents a number which value can be shortened using string shortcuts
type OutputOptions ¶
type OutputOptions struct { Encoding *EncodingOptions Format string Map *MapOptions }
OutputOptions represents output options
type PixelFormat ¶ added in v0.3.0
type PixelFormat string
const (
PixelFormatRGBA PixelFormat = "rgba"
)
type StdErrParser ¶
StdErrParser represents an object capable of parsing stderr
func DefaultStdErrParser ¶
func DefaultStdErrParser(period time.Duration, fn func(r DefaultStdErrResults)) StdErrParser
DefaultStdErrParser creates the default stderr parser
type StreamOption ¶
type StreamOption struct { Stream *StreamSpecifier Value interface{} }
SteamOption represents an option that can be specific to a stream
type StreamSpecifier ¶
StreamSpecifier represents a stream specifier