Documentation
¶
Index ¶
- Variables
- func CreateArgs(ctx context.Context, source, destination string, tOptions TranscodeOptions) (args []string, duration float64, err error)
- func Transcode(ctx context.Context, source, destination string, tOptions TranscodeOptions) (progress chan Progress, done chan error)
- type Progress
- type TranscodeOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTranscodeOptions = TranscodeOptions{ InputOptions: []string{ "-hwaccel", "auto", }, OutputOptions: []string{ "-f", "mp4", "-c:v", "libx264", "-crf", "18", "-preset", "fast", "-c:a", "aac", "-tune", "animation", "-threads", "0", }, }
DefaultTranscodeOptions are the default options.
Functions ¶
func CreateArgs ¶
func Transcode ¶
func Transcode(ctx context.Context, source, destination string, tOptions TranscodeOptions) ( progress chan Progress, done chan error, )
Transcode is specifically created to transcode video files which require some sort of burnt subtitles. It'll check for available streams in our source and if it contains a subtitle stream, it'll burn the subtitles (hardsub) otherwise it'll leave it and assume that the video already contains hardsubs. NOTE: assumes you have 'ffmpeg' in your PATH environment variables
Types ¶
type Progress ¶
type Progress struct { FramesProcessed string `json:"framesProcessed"` CurrentTime string `json:"currentTime"` CurrentBitrate string `json:"currentBitrate"` Percentage float64 `json:"percantage"` Speed float64 `json:"speed"` Duration float64 `json:"duration"` CurrentDuration float64 `json:"currentDuration"` }
Progress defines a transcode progress.
type TranscodeOptions ¶
TranscodeOptions are options. InputOptions are options defined before the source. OutputOptions are options defined after the video filters as mappings.
Click to show internal directories.
Click to hide internal directories.