ffmpeg

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: MIT Imports: 16 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
	Timeout         time.Duration
}

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

func (d Disposition) GetCleanEffects() int

GetCleanEffects ...

func (Disposition) GetComment

func (d Disposition) GetComment() int

GetComment ...

func (Disposition) GetDefault

func (d Disposition) GetDefault() int

GetDefault ...

func (Disposition) GetDub

func (d Disposition) GetDub() int

GetDub ...

func (Disposition) GetForced

func (d Disposition) GetForced() int

GetForced ...

func (Disposition) GetHearingImpaired

func (d Disposition) GetHearingImpaired() int

GetHearingImpaired ...

func (Disposition) GetKaraoke

func (d Disposition) GetKaraoke() int

GetKaraoke ...

func (Disposition) GetLyrics

func (d Disposition) GetLyrics() int

GetLyrics ...

func (Disposition) GetOriginal

func (d Disposition) GetOriginal() int

GetOriginal ...

func (Disposition) GetVisualImpaired

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

func (f Format) GetBitRate() string

GetBitRate ...

func (Format) GetDuration

func (f Format) GetDuration() string

GetDuration ...

func (Format) GetFilename

func (f Format) GetFilename() string

GetFilename ...

func (Format) GetFormatLongName

func (f Format) GetFormatLongName() string

GetFormatLongName ...

func (Format) GetFormatName

func (f Format) GetFormatName() string

GetFormatName ...

func (Format) GetNbPrograms

func (f Format) GetNbPrograms() int

GetNbPrograms ...

func (Format) GetNbStreams

func (f Format) GetNbStreams() int

GetNbStreams ...

func (Format) GetProbeScore

func (f Format) GetProbeScore() int

GetProbeScore ...

func (Format) GetSize

func (f Format) GetSize() string

GetSize ...

func (Format) GetTags

func (f Format) GetTags() transcoder.Tags

GetTags ...

type Metadata

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

Metadata ...

func (Metadata) GetFormat

func (m Metadata) GetFormat() transcoder.Format

GetFormat ...

func (Metadata) GetStreams

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

func (p Progress) GetCurrentBitrate() string

GetCurrentBitrate ...

func (Progress) GetCurrentTime

func (p Progress) GetCurrentTime() string

GetCurrentTime ...

func (Progress) GetFramesProcessed

func (p Progress) GetFramesProcessed() string

GetFramesProcessed ...

func (Progress) GetProgress

func (p Progress) GetProgress() float64

GetProgress ...

func (Progress) GetSpeed

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

func (s Streams) GetAvgFrameRate() string

GetAvgFrameRate ...

func (Streams) GetBitRate

func (s Streams) GetBitRate() string

GetBitRate ...

func (Streams) GetChromaLocation

func (s Streams) GetChromaLocation() string

GetChromaLocation ...

func (Streams) GetCodecLongName

func (s Streams) GetCodecLongName() string

GetCodecLongName ...

func (Streams) GetCodecName

func (s Streams) GetCodecName() string

GetCodecName ...

func (Streams) GetCodecTag

func (s Streams) GetCodecTag() string

GetCodecTag ...

func (Streams) GetCodecTagString

func (s Streams) GetCodecTagString() string

GetCodecTagString ...

func (Streams) GetCodecTimeBase

func (s Streams) GetCodecTimeBase() string

GetCodecTimeBase ...

func (Streams) GetCodecType

func (s Streams) GetCodecType() string

GetCodecType ...

func (Streams) GetCodedHeight

func (s Streams) GetCodedHeight() int

GetCodedHeight ...

func (Streams) GetCodedWidth

func (s Streams) GetCodedWidth() int

GetCodedWidth ...

func (Streams) GetDisplayAspectRatio

func (s Streams) GetDisplayAspectRatio() string

GetDisplayAspectRatio ...

func (Streams) GetDisposition

func (s Streams) GetDisposition() transcoder.Disposition

GetDisposition ...

func (Streams) GetDivxPacked

func (s Streams) GetDivxPacked() string

GetDivxPacked ...

func (Streams) GetDuration

func (s Streams) GetDuration() string

GetDuration ...

func (Streams) GetDurationTs

func (s Streams) GetDurationTs() int

GetDurationTs ...

func (Streams) GetHasBFrames

func (s Streams) GetHasBFrames() int

GetHasBFrames ...

func (Streams) GetHeight

func (s Streams) GetHeight() int

GetHeight ...

func (Streams) GetID

func (s Streams) GetID() string

GetID ...

func (Streams) GetIndex

func (s Streams) GetIndex() int

GetIndex ...

func (Streams) GetLevel

func (s Streams) GetLevel() int

GetLevel ...

func (Streams) GetPixFmt

func (s Streams) GetPixFmt() string

GetPixFmt ...

func (Streams) GetProfile

func (s Streams) GetProfile() string

GetProfile ...

func (Streams) GetQuarterSample

func (s Streams) GetQuarterSample() string

GetQuarterSample ...

func (Streams) GetRFrameRrate

func (s Streams) GetRFrameRrate() string

GetRFrameRrate ...

func (Streams) GetRefs

func (s Streams) GetRefs() int

GetRefs ...

func (Streams) GetSampleAspectRatio

func (s Streams) GetSampleAspectRatio() string

GetSampleAspectRatio ...

func (Streams) GetTimeBase

func (s Streams) GetTimeBase() string

GetTimeBase ...

func (Streams) GetWidth

func (s Streams) GetWidth() int

GetWidth ...

type Tags

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

Tags ...

func (Tags) GetEncoder

func (t Tags) GetEncoder() string

GetEncoder ...

type Transcoder

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

Transcoder ...

func (*Transcoder) GetMetadata

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

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