Documentation ¶
Index ¶
- func Probe(filePath string) (map[string]interface{}, error)
- func SetFfProbePath(path string)
- type Args
- func (a *Args) GetAspectRatio() []string
- func (a *Args) GetAudioBitrate() []string
- func (a *Args) GetAudioChannels() []string
- func (a *Args) GetAudioCodec() []string
- func (a *Args) GetAudioRate() []string
- func (a *Args) GetBufferSize() []string
- func (a *Args) GetConstantRateFactor() []string
- func (a *Args) GetFormat() []string
- func (a *Args) GetFrameRate() []string
- func (a *Args) GetFromFormat() []string
- func (a *Args) GetInputOptions() []string
- func (a *Args) GetInputPath() []string
- func (a *Args) GetKeyframeInterval() []string
- func (a *Args) GetOutputOptions() []string
- func (a *Args) GetOutputPath() []string
- func (a *Args) GetOverwrite() []string
- func (a *Args) GetPipeInput() []string
- func (a *Args) GetPipeOutput() []string
- func (a *Args) GetPixelFormat() []string
- func (a *Args) GetPreset() []string
- func (a *Args) GetQuality() []string
- func (a *Args) GetVFrames() []string
- func (a *Args) GetVideoBitRate() []string
- func (a *Args) GetVideoBitRateTolerance() []string
- func (a *Args) GetVideoCodec() []string
- func (a *Args) GetVideoMaxBitrate() []string
- func (a *Args) GetVideoMinBitrate() []string
- type Command
- func (c *Command) AspectRatio(v string) *Command
- func (c *Command) AudioBitRate(v int) *Command
- func (c *Command) AudioChannels(v int) *Command
- func (c *Command) AudioCodec(v string) *Command
- func (c *Command) AudioRate(v int) *Command
- func (c *Command) BufferSize(v int) *Command
- func (c *Command) Build() *exec.Cmd
- func (c *Command) BuildWithContext(ctx context.Context) *exec.Cmd
- func (c *Command) ConstantRateFactor(v int) *Command
- func (c *Command) FrameRate(v int) *Command
- func (c *Command) FromFormat(format string) *Command
- func (c *Command) GetArgs() []string
- func (c *Command) InputOptions(options ...string) *Command
- func (c *Command) InputPath(v string) *Command
- func (c *Command) KeyframeInterval(v int) *Command
- func (c *Command) NativeFramerateInput(v bool) *Command
- func (c *Command) Options(options ...string) *Command
- func (c *Command) OutputFormat(v string) *Command
- func (c *Command) OutputLogs(writer io.Writer) *Command
- func (c *Command) OutputOptions(options ...string) *Command
- func (c *Command) OutputPath(v string) *Command
- func (c *Command) Overwrite(b bool) *Command
- func (c *Command) PipeInput(input io.Reader) *Command
- func (c *Command) PipeOutput(output io.Writer) *Command
- func (c *Command) PixelFormat(v string) *Command
- func (c *Command) Preset(v string) *Command
- func (c *Command) Quality(v int) *Command
- func (c *Command) Resolution(v string) *Command
- func (c *Command) Run() error
- func (c *Command) RunWithContext(ctx context.Context) error
- func (c *Command) VFrames(v int) *Command
- func (c *Command) VideoBitRate(v int) *Command
- func (c *Command) VideoBitRateTolerance(v int) *Command
- func (c *Command) VideoCodec(v string) *Command
- func (c *Command) VideoMaxBitrate(v int) *Command
- func (c *Command) VideoMinBitrate(v int) *Command
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFfProbePath ¶
func SetFfProbePath(path string)
SetFfProbePath sets the path for the ffprobe executable
Types ¶
type Args ¶
type Args struct {
// contains filtered or unexported fields
}
Args contains the input and output args set for FFmpeg
func (*Args) GetAspectRatio ¶
GetAspectRatio returns the arguments for aspect ratio
func (*Args) GetAudioBitrate ¶
GetAudioBitrate returns the arguments for bitrate
func (*Args) GetAudioChannels ¶
GetAudioChannels returns the audio channels
func (*Args) GetAudioCodec ¶
GetAudioCodec returns the audio codec
func (*Args) GetAudioRate ¶
GetAudioRate returns the arguments for audio rate
func (*Args) GetBufferSize ¶
GetBufferSize returns the buffer size
func (*Args) GetConstantRateFactor ¶
GetConstantRateFactor gets the constant rate factor (CRF) for video encoding
func (*Args) GetFrameRate ¶
GetFrameRate returns the arguments for frame rate
func (*Args) GetFromFormat ¶
GetFromFormat returns the input format
func (*Args) GetInputOptions ¶
GetInputOptions returns additional input options
func (*Args) GetInputPath ¶
GetInputPath returns the input file path
func (*Args) GetKeyframeInterval ¶
GetKeyframeInterval returns the key frame interval
func (*Args) GetOutputOptions ¶
GetOutputOptions returns the additional output options
func (*Args) GetOutputPath ¶
GetOutputPath returns the output path
func (*Args) GetOverwrite ¶
GetOverwrite returns whether or not FFmpeg is set to pipe its output
func (*Args) GetPipeInput ¶
GetPipeInput returns whether or not ffmpeg is set to receive piped input
func (*Args) GetPipeOutput ¶
GetPipeOutput returns whether or not ffmpeg is set to receive piped output
func (*Args) GetPixelFormat ¶
GetPixelFormat returns the pixel format
func (*Args) GetVFrames ¶
GetVFrames returns the arguments for vframes
func (*Args) GetVideoBitRate ¶
GetVideoBitRate returns returns the arguments for video bit rate
func (*Args) GetVideoBitRateTolerance ¶
GetVideoBitRateTolerance returns the arguments for video bit rate tolerance
func (*Args) GetVideoCodec ¶
GetVideoCodec returns the arguments for video codec
func (*Args) GetVideoMaxBitrate ¶
GetVideoMaxBitrate returns the arguments for video max bit rate
func (*Args) GetVideoMinBitrate ¶
GetVideoMinBitrate returns the arguments for video min bit rate
type Command ¶
Command is a struct that holds arguments and their values to run FFmpeg
func (*Command) AspectRatio ¶
AspectRatio gets the aspect ratio. Ex: "16:9"
func (*Command) AudioBitRate ¶
AudioBitRate sets the audio bit rate
func (*Command) AudioChannels ¶
AudioChannels sets the number of audio channels to use.
func (*Command) AudioCodec ¶
AudioCodec sets the audio codec to use
func (*Command) BufferSize ¶
BufferSize sets the buffer size
func (*Command) Build ¶
Build returns an exec.Cmd struct ready to run the FFmpeg command with its arguments
func (*Command) BuildWithContext ¶
BuildWithContext is like Build but includes a context which is used to kill the process
func (*Command) ConstantRateFactor ¶
ConstantRateFactor sets the constant rate factor (CRF) for video encoding
func (*Command) FromFormat ¶
FromFormat sets the format of the input
func (*Command) InputOptions ¶
InputOptions sets additional input options
func (*Command) KeyframeInterval ¶
KeyframeInterval sets the keyframe interval.
func (*Command) NativeFramerateInput ¶
NativeFramerateInput sets the native frame rate
func (*Command) Options ¶
Options is intended for configuring global options that are not affected by their position in the FFmpeg command
func (*Command) OutputFormat ¶
OutputFormat sets the format of the output
func (*Command) OutputLogs ¶
OutputLogs sets the destination to write the FFmpeg log output to
func (*Command) OutputOptions ¶
OutputOptions sets additional output options
func (*Command) OutputPath ¶
OutputPath sets the path to write the output file
func (*Command) PipeOutput ¶
PipeOutput sets the output to be written to an io.Writer
func (*Command) PixelFormat ¶
PixelFormat sets the pixel format.
func (*Command) Resolution ¶
Resolution gets the resolution of the media. Ex: "100x100"
func (*Command) Run ¶
Run runs the FFmpeg command. It returns an error if the command fails with exit status code 1. This error message only signifies that the command returned a non-zero status code, read from stderr to see more comprehensive FFmpeg errors.
func (*Command) RunWithContext ¶
RunWithContext is like Run but includes a context which is used to kill the process
func (*Command) VideoBitRate ¶
VideoBitRate gets the video bit rate.
func (*Command) VideoBitRateTolerance ¶
VideoBitRateTolerance gets the video bit rate tolerance.
func (*Command) VideoCodec ¶
VideoCodec gets the desired video codec when working with video.
func (*Command) VideoMaxBitrate ¶
VideoMaxBitrate gets the max bit rate for the video.
func (*Command) VideoMinBitrate ¶
VideoMinBitrate gets the max bit rate for the video.