Documentation
¶
Index ¶
- type CliOption
- type Configuration
- type Disposition
- type Done
- type Error
- type Format
- type InputMedia
- type Job
- func (j *Job) AddInput(input InputMedia, options ...CliOption)
- func (j *Job) AddInputFile(url string, options ...CliOption) (*Metadata, error)
- func (j *Job) AddInputReader(r io.Reader, options ...CliOption) (*Metadata, error)
- func (j *Job) AddOutputFile(file string, options ...CliOption)
- func (j *Job) AddOutputReader(w io.Writer, options ...CliOption)
- func (j *Job) Start(ctx context.Context) (<-chan Status, error)
- func (j *Job) StartDebug(ctx context.Context, w io.Writer) (<-chan Status, error)
- type Metadata
- type OutputMedia
- type ProbeError
- type Progress
- type Status
- type Stream
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CliOption ¶
type CliOption interface {
// contains filtered or unexported methods
}
CliOption is an command line option for ffmpeg
type Configuration ¶
type Configuration struct {
// contains filtered or unexported fields
}
Configuration represents valid paths to ffmpeg and ffprobe
func DefaultConfiguration ¶
func DefaultConfiguration() (*Configuration, error)
DefaultConfiguration looks for and returns a configuration from the environment
func NewConfiguration ¶
func NewConfiguration(ffmpeg, ffprobe string) (*Configuration, error)
NewConfiguration validates the given paths to ffmpeg and ffprobe and returns a configuration
func (*Configuration) NewJob ¶
func (c *Configuration) NewJob(options ...CliOption) *Job
NewJob creates a new job
func (*Configuration) Probe ¶ added in v0.2.0
func (c *Configuration) Probe(url string) (InputMedia, *Metadata, error)
Probe reads metadata from the url using ffprobe and returns an input media to be added to a job as well as the aformentioned metadata.
func (*Configuration) ProbeReader ¶ added in v0.2.0
func (c *Configuration) ProbeReader(r io.Reader) (InputMedia, *Metadata, error)
ProbeReader reads metadata from the input stream using ffprobe and returns an input media to be added to a job as well as the aformentioned metadata.
type Disposition ¶
type Disposition struct {
Default int `json:"default"`
Dub int `json:"dub"`
Original int `json:"original"`
Comment int `json:"comment"`
Lyrics int `json:"lyrics"`
Karaoke int `json:"karaoke"`
Forced int `json:"forced"`
HearingImpaired int `json:"hearing_impaired"`
VisualImpaired int `json:"visual_impaired"`
CleanEffects int `json:"clean_effects"`
}
Disposition represents stream disposition
type Error ¶
type Error struct {
Arguments []string
// contains filtered or unexported fields
}
Error represents an error that occurred during a job
type Format ¶
type Format struct {
Filename string `json:"filename"`
NbStreams int `json:"nb_streams"`
NbPrograms int `json:"nb_programs"`
NbFrames int `json:"nb_frames"`
FormatName string `json:"format_name"`
FormatLongName string `json:"format_long_name"`
Duration string `json:"duration"`
Size string `json:"size"`
BitRate string `json:"bit_rate"`
ProbeScore int `json:"probe_score"`
Tags Tags `json:"tags"`
}
Format represents video format
type InputMedia ¶ added in v0.2.0
type InputMedia interface {
// contains filtered or unexported methods
}
InputMedia represents some input media
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job represents an ffmpeg job
func (*Job) AddInput ¶ added in v0.2.0
func (j *Job) AddInput(input InputMedia, options ...CliOption)
AddInput adds an input
func (*Job) AddInputFile ¶
AddInputFile adds an input file
func (*Job) AddInputReader ¶
AddInputReader adds an input reader
func (*Job) AddOutputFile ¶
AddOutputFile adds an output file
func (*Job) AddOutputReader ¶
AddOutputReader adds an output reader
type Metadata ¶
type Metadata struct {
Streams []Stream `json:"streams"`
Format *Format `json:"format"`
Error *ProbeError `json:"error"`
}
Metadata represents the output of ffprobe
type OutputMedia ¶ added in v0.2.0
type OutputMedia interface {
// contains filtered or unexported methods
}
OutputMedia represents some output media
type ProbeError ¶ added in v0.2.0
ProbeError represents an error emitted by ffprobe
func (*ProbeError) Error ¶ added in v0.2.0
func (e *ProbeError) Error() string
Error returns an error message
type Status ¶
type Status interface {
// contains filtered or unexported methods
}
Status represents the status of a job
type Stream ¶
type Stream struct {
Index int `json:"index"`
ID string `json:"id"`
CodecName string `json:"codec_name"`
CodecLongName string `json:"codec_long_name"`
Profile string `json:"profile"`
CodecType string `json:"codec_type"`
CodecTimeBase string `json:"codec_time_base"`
CodecTagString string `json:"codec_tag_string"`
CodecTag string `json:"codec_tag"`
Width int `json:"width"`
Height int `json:"height"`
CodedWidth int `json:"coded_width"`
CodedHeight int `json:"coded_height"`
HasBFrames int `json:"has_b_frames"`
SampleAspectRatio string `json:"sample_aspect_ratio"`
DisplayAspectRatio string `json:"display_aspect_ratio"`
PixFmt string `json:"pix_fmt"`
Level int `json:"level"`
ChromaLocation string `json:"chroma_location"`
Refs int `json:"refs"`
QuarterSample string `json:"quarter_sample"`
DivxPacked string `json:"divx_packed"`
RFrameRrate string `json:"r_frame_rate"`
AvgFrameRate string `json:"avg_frame_rate"`
TimeBase string `json:"time_base"`
DurationTs int `json:"duration_ts"`
Duration string `json:"duration"`
Disposition Disposition `json:"disposition"`
BitRate string `json:"bit_rate"`
}
Stream represents stream metadata