Skip to content

Commit

Permalink
Merge pull request #15 from KiboMibo/master
Browse files Browse the repository at this point in the history
Add filter string to ffmpeg args
  • Loading branch information
xfrr committed Jun 21, 2018
2 parents 48cfb58 + c29adb9 commit ba176bd
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 @@ -47,9 +47,13 @@ type Mediafile struct {
hlsSegmentDuration int
streamIds map[int]string
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 @@ -205,6 +209,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 @@ -402,6 +410,7 @@ func (m *Mediafile) ToStrCommand() string {
"OutputFormat",
"HlsSegmentDuration",
"HlsPlaylistType",
"Filter",
"OutputPath",
}
for _, name := range opts {
Expand All @@ -420,6 +429,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 ba176bd

Please sign in to comment.