Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add audio filter #29

Merged
merged 3 commits into from
Apr 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions models/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,16 @@ type Mediafile struct {
streamIds map[int]string
metadata Metadata
filter string
audioFilter string
skipVideo bool
skipAudio bool
}

/*** SETTERS ***/
func (m *Mediafile) SetAudioFilter(v string) {
m.audioFilter = v
}

func (m *Mediafile) SetFilter(v string) {
m.filter = v
}
Expand Down Expand Up @@ -499,6 +504,7 @@ func (m *Mediafile) ToStrCommand() []string {
"HlsSegmentDuration",
"HlsPlaylistType",
"Filter",
timotto marked this conversation as resolved.
Show resolved Hide resolved
"AudioFilter",
"HttpMethod",
"HttpKeepAlive",
"OutputPath",
Expand All @@ -517,6 +523,13 @@ func (m *Mediafile) ToStrCommand() []string {
return strCommand
}

func (m *Mediafile) ObtainAudioFilter() []string {
if m.audioFilter != "" {
return []string{"-af", m.audioFilter}
}
return nil
}

func (m *Mediafile) ObtainFilter() []string {
timotto marked this conversation as resolved.
Show resolved Hide resolved
if m.filter != "" {
return []string{"-vf", m.filter}
Expand Down