From c29adb9d35d4f626f89cdedc4b160c1787a38c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=BE=D0=BB=D0=B0=D0=B9=20=D0=9F=D1=8C?= =?UTF-8?q?=D1=8F=D0=BD=D0=BA=D0=BE=D0=B2?= Date: Thu, 21 Jun 2018 12:45:27 +0300 Subject: [PATCH] Add filter string to ffmpeg args --- models/media.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/models/media.go b/models/media.go index d760059..466d110 100644 --- a/models/media.go +++ b/models/media.go @@ -45,9 +45,13 @@ type Mediafile struct { hlsPlaylistType string hlsSegmentDuration int metadata Metadata + filter string } /*** SETTERS ***/ +func (m *Mediafile) SetFilter(v string){ + m.filter = v +} func (m *Mediafile) SetAspect(v string) { m.aspect = v @@ -195,6 +199,10 @@ func (m *Mediafile) SetMetadata(v Metadata) { /*** GETTERS ***/ +func (m *Mediafile) Filter() string { + return m.filter +} + func (m *Mediafile) Aspect() string { return m.aspect } @@ -382,6 +390,7 @@ func (m *Mediafile) ToStrCommand() string { "OutputFormat", "HlsSegmentDuration", "HlsPlaylistType", + "Filter", "OutputPath", } for _, name := range opts { @@ -400,6 +409,12 @@ func (m *Mediafile) ToStrCommand() string { } +func (m *Mediafile) ObtainFilter() string{ + if m.filter != "" { + return fmt.Sprintf("-vf \"%s\"", m.filter) + } + return "" +} func (m *Mediafile) ObtainAspect() string { // Set aspect