Allow configuration of ffmpeg args (#3216)

* Allow configuration of ffmpeg args
* Add UI settings for ffmpeg config
* Add changelog entry
* Add documentation in manual
This commit is contained in:
WithoutPants
2023-01-27 11:31:11 +11:00
committed by GitHub
parent a36b895e4b
commit b67abb89ff
20 changed files with 204 additions and 26 deletions

View File

@@ -21,6 +21,11 @@ type TranscodeOptions struct {
// Verbosity is the logging verbosity. Defaults to LogLevelError if not set.
Verbosity ffmpeg.LogLevel
// arguments added before the input argument
ExtraInputArgs []string
// arguments added before the output argument
ExtraOutputArgs []string
}
func (o *TranscodeOptions) setDefaults() {
@@ -59,6 +64,7 @@ func Transcode(input string, options TranscodeOptions) ffmpeg.Args {
var args ffmpeg.Args
args = args.LogLevel(options.Verbosity).Overwrite()
args = append(args, options.ExtraInputArgs...)
if options.XError {
args = args.XError()
@@ -92,6 +98,8 @@ func Transcode(input string, options TranscodeOptions) ffmpeg.Args {
}
args = args.AppendArgs(options.AudioArgs)
args = append(args, options.ExtraOutputArgs...)
args = args.Format(options.Format)
args = args.Output(options.OutputPath)