From 919fd17eed77748fc6dde702e559b7d04da8293e Mon Sep 17 00:00:00 2001 From: connerdouglass Date: Tue, 19 Mar 2024 22:33:35 -0400 Subject: [PATCH] feat: expose WithOptions function for outputs --- output/options.go | 14 +++++++------- output/output.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/output/options.go b/output/options.go index 1f39008..c6f6eaf 100644 --- a/output/options.go +++ b/output/options.go @@ -3,7 +3,7 @@ package output import "strconv" func WithFormat(format string) Option { - return withOptions("-f", format) + return WithOptions("-f", format) } func WithFormatMP4() Option { @@ -21,7 +21,7 @@ func WithFormatMOV() Option { } func withDefaultMP4Options() Option { - return withOptions( + return WithOptions( "-movflags", "use_metadata_tags", "-vcodec", "h264", "-pix_fmt", "yuv420p", @@ -32,21 +32,21 @@ func withDefaultMP4Options() Option { } func WithFrameRate(frameRate string) Option { - return withOptions("-r", frameRate) + return WithOptions("-r", frameRate) } func WithTimecode(timecode string) Option { - return withOptions("-timecode", timecode) + return WithOptions("-timecode", timecode) } func WithConstantRateFactor(factor int) Option { - return withOptions("-crf", strconv.Itoa(factor)) + return WithOptions("-crf", strconv.Itoa(factor)) } func WithVideoCodec(codec string) Option { - return withOptions("-vcodec", codec) + return WithOptions("-vcodec", codec) } func WithAudioCodec(codec string) Option { - return withOptions("-acodec", codec) + return WithOptions("-acodec", codec) } diff --git a/output/output.go b/output/output.go index 67480bb..51c9909 100644 --- a/output/output.go +++ b/output/output.go @@ -25,7 +25,7 @@ func (o *outputWithArgs) Options() []string { return o.opts } -func withOptions(opts ...string) Option { +func WithOptions(opts ...string) Option { return func() []string { return opts }