Skip to content

Commit

Permalink
Merge pull request #75 from basriciftci/master
Browse files Browse the repository at this point in the history
Add single_file option
  • Loading branch information
xfrr committed Jun 24, 2021
2 parents 5550d23 + a7aded7 commit 5ca2d30
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ SetSeekTimeInput
SetSeekUsingTsInput
SetQuality
SetStrict
SetSingleFile
SetCopyTs
SetMuxDelay
SetHideBanner
Expand Down
17 changes: 17 additions & 0 deletions models/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ type Mediafile struct {
qscale uint32
crf uint32
strict int
singleFile int
muxDelay string
seekUsingTsInput bool
seekTimeInput string
Expand Down Expand Up @@ -223,6 +224,10 @@ func (m *Mediafile) SetStrict(v int) {
m.strict = v
}

func (m *Mediafile) SetSingleFile(v int) {
m.singleFile = v
}

func (m *Mediafile) SetSeekUsingTsInput(val bool) {
m.seekUsingTsInput = val
}
Expand Down Expand Up @@ -502,6 +507,10 @@ func (m *Mediafile) Strict() int {
return m.strict
}

func (m *Mediafile) SingleFile() int {
return m.singleFile
}

func (m *Mediafile) MuxDelay() string {
return m.muxDelay
}
Expand Down Expand Up @@ -682,6 +691,7 @@ func (m *Mediafile) ToStrCommand() []string {
"CRF",
"QScale",
"Strict",
"SingleFile",
"BufferSize",
"MuxDelay",
"Threads",
Expand Down Expand Up @@ -998,6 +1008,13 @@ func (m *Mediafile) ObtainStrict() []string {
return nil
}

func (m *Mediafile) ObtainSingleFile() []string {
if m.singleFile != 0 {
return []string{"-single_file", fmt.Sprintf("%d", m.singleFile)}
}
return nil
}

func (m *Mediafile) ObtainVideoProfile() []string {
if m.videoProfile != "" {
return []string{"-profile:v", m.videoProfile}
Expand Down

0 comments on commit 5ca2d30

Please sign in to comment.