ffmpeg

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *Config) transcoder.Transcoder

New ...

Types

type Config

type Config struct {
	FfmpegBinPath   string
	FfprobeBinPath  string
	ProgressEnabled bool
	Verbose         bool
}

Config ...

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 ...

func (Disposition) GetCleanEffects added in v1.2.2

func (d Disposition) GetCleanEffects() int

GetCleanEffects ...

func (Disposition) GetComment added in v1.2.2

func (d Disposition) GetComment() int

GetComment ...

func (Disposition) GetDefault added in v1.2.2

func (d Disposition) GetDefault() int

GetDefault ...

func (Disposition) GetDub added in v1.2.2

func (d Disposition) GetDub() int

GetDub ...

func (Disposition) GetForced added in v1.2.2

func (d Disposition) GetForced() int

GetForced ...

func (Disposition) GetHearingImpaired added in v1.2.2

func (d Disposition) GetHearingImpaired() int

GetHearingImpaired ...

func (Disposition) GetKaraoke added in v1.2.2

func (d Disposition) GetKaraoke() int

GetKaraoke ...

func (Disposition) GetLyrics added in v1.2.2

func (d Disposition) GetLyrics() int

GetLyrics ...

func (Disposition) GetOriginal added in v1.2.2

func (d Disposition) GetOriginal() int

GetOriginal ...

func (Disposition) GetVisualImpaired added in v1.2.2

func (d Disposition) GetVisualImpaired() int

GetVisualImpaired ...

type Format

type Format struct {
	Filename       string
	NbStreams      int    `json:"nb_streams"`
	NbPrograms     int    `json:"nb_programs"`
	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 ...

func (Format) GetBitRate added in v1.2.2

func (f Format) GetBitRate() string

GetBitRate ...

func (Format) GetDuration added in v1.2.2

func (f Format) GetDuration() string

GetDuration ...

func (Format) GetFilename added in v1.2.2

func (f Format) GetFilename() string

GetFilename ...

func (Format) GetFormatLongName added in v1.2.2

func (f Format) GetFormatLongName() string

GetFormatLongName ...

func (Format) GetFormatName added in v1.2.2

func (f Format) GetFormatName() string

GetFormatName ...

func (Format) GetNbPrograms added in v1.2.2

func (f Format) GetNbPrograms() int

GetNbPrograms ...

func (Format) GetNbStreams added in v1.2.2

func (f Format) GetNbStreams() int

GetNbStreams ...

func (Format) GetProbeScore added in v1.2.2

func (f Format) GetProbeScore() int

GetProbeScore ...

func (Format) GetSize added in v1.2.2

func (f Format) GetSize() string

GetSize ...

func (Format) GetTags added in v1.2.2

func (f Format) GetTags() transcoder.Tags

GetTags ...

type Metadata

type Metadata struct {
	Format  Format    `json:"format"`
	Streams []Streams `json:"streams"`
}

Metadata ...

func (Metadata) GetFormat added in v1.2.2

func (m Metadata) GetFormat() transcoder.Format

GetFormat ...

func (Metadata) GetStreams added in v1.2.2

func (m Metadata) GetStreams() (streams []transcoder.Streams)

GetStreams ...

type Options

type Options struct {
	Aspect                *string           `flag:"-aspect"`
	Resolution            *string           `flag:"-s"`
	VideoBitRate          *string           `flag:"-b:v"`
	VideoBitRateTolerance *int              `flag:"-bt"`
	VideoMaxBitRate       *int              `flag:"-maxrate"`
	VideoMinBitrate       *int              `flag:"-minrate"`
	VideoCodec            *string           `flag:"-c:v"`
	Vframes               *int              `flag:"-vframes"`
	FrameRate             *int              `flag:"-r"`
	AudioRate             *int              `flag:"-ar"`
	KeyframeInterval      *int              `flag:"-g"`
	AudioCodec            *string           `flag:"-c:a"`
	AudioBitrate          *string           `flag:"-ab"`
	AudioChannels         *int              `flag:"-ac"`
	AudioVariableBitrate  *bool             `flag:"-q:a"`
	BufferSize            *int              `flag:"-bufsize"`
	Threadset             *bool             `flag:"-threads"`
	Threads               *int              `flag:"-threads"`
	Preset                *string           `flag:"-preset"`
	Tune                  *string           `flag:"-tune"`
	AudioProfile          *string           `flag:"-profile:a"`
	VideoProfile          *string           `flag:"-profile:v"`
	Target                *string           `flag:"-target"`
	Duration              *string           `flag:"-t"`
	Qscale                *uint32           `flag:"-qscale"`
	Crf                   *uint32           `flag:"-crf"`
	Strict                *int              `flag:"-strict"`
	MuxDelay              *string           `flag:"-muxdelay"`
	SeekTime              *string           `flag:"-ss"`
	SeekUsingTimestamp    *bool             `flag:"-seek_timestamp"`
	MovFlags              *string           `flag:"-movflags"`
	HideBanner            *bool             `flag:"-hide_banner"`
	OutputFormat          *string           `flag:"-f"`
	CopyTs                *bool             `flag:"-copyts"`
	NativeFramerateInput  *bool             `flag:"-re"`
	InputInitialOffset    *string           `flag:"-itsoffset"`
	RtmpLive              *string           `flag:"-rtmp_live"`
	HlsPlaylistType       *string           `flag:"-hls_playlist_type"`
	HlsListSize           *int              `flag:"-hls_list_size"`
	HlsSegmentDuration    *int              `flag:"-hls_time"`
	HlsMasterPlaylistName *string           `flag:"-master_pl_name"`
	HlsSegmentFilename    *string           `flag:"-hls_segment_filename"`
	HTTPMethod            *string           `flag:"-method"`
	HTTPKeepAlive         *bool             `flag:"-multiple_requests"`
	Hwaccel               *string           `flag:"-hwaccel"`
	StreamIds             map[string]string `flag:"-streamid"`
	VideoFilter           *string           `flag:"-vf"`
	AudioFilter           *string           `flag:"-af"`
	SkipVideo             *bool             `flag:"-vn"`
	SkipAudio             *bool             `flag:"-an"`
	CompressionLevel      *int              `flag:"-compression_level"`
	MapMetadata           *string           `flag:"-map_metadata"`
	Metadata              map[string]string `flag:"-metadata"`
	EncryptionKey         *string           `flag:"-hls_key_info_file"`
	Bframe                *int              `flag:"-bf"`
	PixFmt                *string           `flag:"-pix_fmt"`
	WhiteListProtocols    []string          `flag:"-protocol_whitelist"`
	Overwrite             *bool             `flag:"-y"`
	ExtraArgs             map[string]interface{}
}

Options defines allowed FFmpeg arguments

func (Options) GetStrArguments

func (opts Options) GetStrArguments() []string

GetStrArguments ...

type Progress

type Progress struct {
	FramesProcessed string
	CurrentTime     string
	CurrentBitrate  string
	Progress        float64
	Speed           string
}

Progress ...

func (Progress) GetCurrentBitrate added in v1.3.0

func (p Progress) GetCurrentBitrate() string

GetCurrentBitrate ...

func (Progress) GetCurrentTime added in v1.3.0

func (p Progress) GetCurrentTime() string

GetCurrentTime ...

func (Progress) GetFramesProcessed added in v1.3.0

func (p Progress) GetFramesProcessed() string

GetFramesProcessed ...

func (Progress) GetProgress added in v1.3.0

func (p Progress) GetProgress() float64

GetProgress ...

func (Progress) GetSpeed added in v1.3.0

func (p Progress) GetSpeed() string

GetSpeed ...

type Streams

type Streams struct {
	Index              int
	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"`
}

Streams ...

func (Streams) GetAvgFrameRate added in v1.2.2

func (s Streams) GetAvgFrameRate() string

GetAvgFrameRate ...

func (Streams) GetBitRate added in v1.2.2

func (s Streams) GetBitRate() string

GetBitRate ...

func (Streams) GetChromaLocation added in v1.2.2

func (s Streams) GetChromaLocation() string

GetChromaLocation ...

func (Streams) GetCodecLongName added in v1.2.2

func (s Streams) GetCodecLongName() string

GetCodecLongName ...

func (Streams) GetCodecName added in v1.2.2

func (s Streams) GetCodecName() string

GetCodecName ...

func (Streams) GetCodecTag added in v1.2.2

func (s Streams) GetCodecTag() string

GetCodecTag ...

func (Streams) GetCodecTagString added in v1.2.2

func (s Streams) GetCodecTagString() string

GetCodecTagString ...

func (Streams) GetCodecTimeBase added in v1.2.2

func (s Streams) GetCodecTimeBase() string

GetCodecTimeBase ...

func (Streams) GetCodecType added in v1.2.2

func (s Streams) GetCodecType() string

GetCodecType ...

func (Streams) GetCodedHeight added in v1.2.2

func (s Streams) GetCodedHeight() int

GetCodedHeight ...

func (Streams) GetCodedWidth added in v1.2.2

func (s Streams) GetCodedWidth() int

GetCodedWidth ...

func (Streams) GetDisplayAspectRatio added in v1.2.2

func (s Streams) GetDisplayAspectRatio() string

GetDisplayAspectRatio ...

func (Streams) GetDisposition added in v1.2.2

func (s Streams) GetDisposition() transcoder.Disposition

GetDisposition ...

func (Streams) GetDivxPacked added in v1.2.2

func (s Streams) GetDivxPacked() string

GetDivxPacked ...

func (Streams) GetDuration added in v1.2.2

func (s Streams) GetDuration() string

GetDuration ...

func (Streams) GetDurationTs added in v1.2.2

func (s Streams) GetDurationTs() int

GetDurationTs ...

func (Streams) GetHasBFrames added in v1.2.2

func (s Streams) GetHasBFrames() int

GetHasBFrames ...

func (Streams) GetHeight added in v1.2.2

func (s Streams) GetHeight() int

GetHeight ...

func (Streams) GetID added in v1.2.2

func (s Streams) GetID() string

GetID ...

func (Streams) GetIndex added in v1.2.2

func (s Streams) GetIndex() int

GetIndex ...

func (Streams) GetLevel added in v1.2.2

func (s Streams) GetLevel() int

GetLevel ...

func (Streams) GetPixFmt added in v1.2.2

func (s Streams) GetPixFmt() string

GetPixFmt ...

func (Streams) GetProfile added in v1.2.2

func (s Streams) GetProfile() string

GetProfile ...

func (Streams) GetQuarterSample added in v1.2.2

func (s Streams) GetQuarterSample() string

GetQuarterSample ...

func (Streams) GetRFrameRrate added in v1.2.2

func (s Streams) GetRFrameRrate() string

GetRFrameRrate ...

func (Streams) GetRefs added in v1.2.2

func (s Streams) GetRefs() int

GetRefs ...

func (Streams) GetSampleAspectRatio added in v1.2.2

func (s Streams) GetSampleAspectRatio() string

GetSampleAspectRatio ...

func (Streams) GetTimeBase added in v1.2.2

func (s Streams) GetTimeBase() string

GetTimeBase ...

func (Streams) GetWidth added in v1.2.2

func (s Streams) GetWidth() int

GetWidth ...

type Tags

type Tags struct {
	Encoder string `json:"ENCODER"`
}

Tags ...

func (Tags) GetEncoder added in v1.2.2

func (t Tags) GetEncoder() string

GetEncoder ...

type Transcoder

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

Transcoder ...

func (*Transcoder) GetMetadata added in v1.2.2

func (t *Transcoder) GetMetadata() (transcoder.Metadata, error)

GetMetadata Returns metadata for the specified input file

func (*Transcoder) Input

func (t *Transcoder) Input(arg string) transcoder.Transcoder

Input ...

func (*Transcoder) InputPipe

InputPipe ...

func (*Transcoder) Output

func (t *Transcoder) Output(arg string) transcoder.Transcoder

Output ...

func (*Transcoder) OutputPipe

func (t *Transcoder) OutputPipe(w *io.WriteCloser, r *io.ReadCloser) transcoder.Transcoder

OutputPipe ...

func (*Transcoder) Start

func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress, error)

Start ...

func (*Transcoder) WithAdditionalOptions added in v1.2.0

func (t *Transcoder) WithAdditionalOptions(opts transcoder.Options) transcoder.Transcoder

WithAdditionalOptions Appends an additional options object

func (*Transcoder) WithOptions

func (t *Transcoder) WithOptions(opts transcoder.Options) transcoder.Transcoder

WithOptions Sets the options object

Jump to

Keyboard shortcuts

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