Documentation ¶
Overview ¶
Package ff implements an ffmpeg (or ffprobe) command-line parameter builder
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseFile ¶
Base structure representing an input file or an output file. Not meant to be used directly; use InputFile or OutputFile
type Command ¶
Represents the entire commandline for ffmpeg/ffprobe
func NewCommand ¶
You can pass in only input (for ffprobe). You can pass in one or more outputs. Returns a new Command structure
type CommandFunc ¶
type CommandFunc func(string, ...string) CommandInterface
Used for faking exec.Command() to test Probe()
var DefaultCommandFunc CommandFunc = func(name string, arg ...string) CommandInterface { return exec.Command(name, arg...) }
Used for faking exec.Command() to test Probe()
type CommandInterface ¶
Used for faking exec.Cmd.Output() to test Probe()
type Disposition ¶
type Disposition struct { AttachedPic int `json:"attached_pic"` CleanEffects int `json:"clean_effects"` Comment int `json:"comment"` Default int `json:"default"` Dub int `json:"dub"` Forced int `json:"forced"` HearingImpaired int `json:"hearing_impaired"` Karaoke int `json:"karaoke"` Lyrics int `json:"lyrics"` Original int `json:"original"` VisualImpaired int `json:"visual_impaired"` }
Stream disposition
type File ¶
Interface for either an input file or an output file
type Format ¶
type Format struct { BitRate string `json:"bit_rate"` Duration string `json:"duration"` Filename string `json:"filename"` LongName string `json:"format_long_name"` Name string `json:"format_name"` NumPrograms int `json:"nb_programs"` NumStreams int `json:"nb_streams"` ProbeScore int `json:"probe_score"` Size string `json:"size"` StartTime string `json:"start_time"` Tags Tags `json:"tags"` }
Container Format info
type OutputFile ¶
type OutputFile struct {
BaseFile
}
Represents an output file for ffmpeg/ffprobe
func (OutputFile) Slice ¶
func (f OutputFile) Slice() (result []string)
Returns a slice representation of how an output file should be passed to ffmpeg/ffprobe
type Param ¶
type Param struct { Key interface{} Value interface{} }
Contains the key and/or value of a command-line parameter.
type ParamSet ¶
type ParamSet []string
Represents a set of Params
func NewParamSet ¶
If no params are passed in, nothing is added. If the Slice() representation of a passed-in param is 0, they won't be added. Always returns a pointer to a new ParamSet, never nil
type ProbeInfo ¶
Just a nice structure that represents the JSON data returned by ffprobe. Mostly auto-generated with http://mholt.github.io/json-to-go
func (ProbeInfo) FilterStreams ¶
func (info ProbeInfo) FilterStreams(t StreamType) (streams []Stream)
Filters out streams of the given StreamType. Returns a []Stream slice, even if it's empty
type SideData ¶
type SideData struct { Displaymatrix string `json:"displaymatrix"` Rotation int `json:"rotation"` Size int `json:"side_data_size"` Type string `json:"side_data_type"` }
Stream side data. More fields may be added later as needed.
type Stream ¶
type Stream struct { AvgFrameRate string `json:"avg_frame_rate"` BitRate string `json:"bit_rate"` BitsPerRawSample string `json:"bits_per_raw_sample"` BitsPerSample int `json:"bits_per_sample"` ChannelLayout string `json:"channel_layout"` Channels int `json:"channels"` ChromaLocation string `json:"chroma_location"` CodecLongName string `json:"codec_long_name"` CodecName string `json:"codec_name"` CodecTag string `json:"codec_tag"` CodecTagString string `json:"codec_tag_string"` CodecTimeBase string `json:"codec_time_base"` CodecType StreamType `json:"codec_type"` CodedHeight int `json:"coded_height"` CodedWidth int `json:"coded_width"` ColorPrimaries string `json:"color_primaries"` ColorRange string `json:"color_range"` ColorSpace string `json:"color_space"` ColorTransfer string `json:"color_transfer"` DisplayAspectRatio string `json:"display_aspect_ratio"` DivxPacked string `json:"divx_packed"` DmixMode string `json:"dmix_mode"` Duration string `json:"duration"` DurationTs int `json:"duration_ts"` HasBFrames int `json:"has_b_frames"` Height int `json:"height"` ID string `json:"id"` Index int `json:"index"` IsAvc string `json:"is_avc"` Level int `json:"level"` LoroCmixlev string `json:"loro_cmixlev"` LoroSurmixlev string `json:"loro_surmixlev"` LtrtCmixlev string `json:"ltrt_cmixlev"` LtrtSurmixlev string `json:"ltrt_surmixlev"` MaxBitRate string `json:"max_bit_rate"` NalLengthSize string `json:"nal_length_size"` NumFrames string `json:"nb_frames"` PixFmt string `json:"pix_fmt"` Profile string `json:"profile"` QuarterSample string `json:"quarter_sample"` FrameRate string `json:"r_frame_rate"` Refs int `json:"refs"` SampleAspectRatio string `json:"sample_aspect_ratio"` SampleFmt string `json:"sample_fmt"` SampleRate string `json:"sample_rate"` StartPts int `json:"start_pts"` StartTime string `json:"start_time"` TimeBase string `json:"time_base"` Timecode string `json:"timecode"` Width int `json:"width"` Tags Tags `json:"tags"` Disposition Disposition `json:"disposition"` SideDataList []SideData `json:"side_data_list"` }
Represents any kind of stream (Audio, Video, etc)
type StreamType ¶
type StreamType string
Used for enumerating the CodecType field in Stream
const ( VideoStream StreamType = "video" AudioStream = "audio" )