Skip to content

Commit

Permalink
Add filter string to ffmpeg args
Browse files Browse the repository at this point in the history
  • Loading branch information
Николай Пьянков committed Jun 21, 2018
1 parent 21d8833 commit c29adb9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions models/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -382,6 +390,7 @@ func (m *Mediafile) ToStrCommand() string {
"OutputFormat",
"HlsSegmentDuration",
"HlsPlaylistType",
"Filter",
"OutputPath",
}
for _, name := range opts {
Expand All @@ -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
Expand Down

0 comments on commit c29adb9

Please sign in to comment.