Skip to content

Commit 16dd08b

Browse files
committed
Fix vsync
1 parent c3938e7 commit 16dd08b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

models/media.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Mediafile struct {
1717
videoMinBitrate int
1818
videoCodec string
1919
vframes int
20+
vsync string
2021
frameRate int
2122
audioRate int
2223
maxKeyframe int
@@ -51,7 +52,6 @@ type Mediafile struct {
5152
outputPipeReader *io.PipeReader
5253
outputPipeWriter *io.PipeWriter
5354
movFlags string
54-
vsync string
5555
hideBanner bool
5656
outputPath string
5757
outputFormat string
@@ -128,6 +128,10 @@ func (m *Mediafile) SetVframes(v int) {
128128
m.vframes = v
129129
}
130130

131+
func (m *Mediafile) SetVsync(val string) {
132+
m.vsync = val
133+
}
134+
131135
func (m *Mediafile) SetFrameRate(v int) {
132136
m.frameRate = v
133137
}
@@ -262,10 +266,6 @@ func (m *Mediafile) SetMovFlags(val string) {
262266
m.movFlags = val
263267
}
264268

265-
func (m *Mediafile) SetVsync(val string) {
266-
m.vsync = val
267-
}
268-
269269
func (m *Mediafile) SetHideBanner(val bool) {
270270
m.hideBanner = val
271271
}
@@ -405,6 +405,10 @@ func (m *Mediafile) Vframes() int {
405405
return m.vframes
406406
}
407407

408+
func (m *Mediafile) Vsync() string {
409+
return m.vsync
410+
}
411+
408412
func (m *Mediafile) FrameRate() int {
409413
return m.frameRate
410414
}
@@ -541,10 +545,6 @@ func (m *Mediafile) MovFlags() string {
541545
return m.movFlags
542546
}
543547

544-
func (m *Mediafile) Vsync() string {
545-
return m.vsync
546-
}
547-
548548
func (m *Mediafile) HideBanner() bool {
549549
return m.hideBanner
550550
}
@@ -658,6 +658,7 @@ func (m *Mediafile) ToStrCommand() []string {
658658
"AudioRate",
659659
"VideoCodec",
660660
"Vframes",
661+
"Vsync",
661662
"VideoBitRate",
662663
"VideoBitRateTolerance",
663664
"VideoMaxBitRate",
@@ -703,7 +704,6 @@ func (m *Mediafile) ToStrCommand() []string {
703704
"OutputPath",
704705
"Bframe",
705706
"MovFlags",
706-
"Vsync",
707707
}
708708

709709
for _, name := range opts {
@@ -823,7 +823,7 @@ func (m *Mediafile) ObtainVframes() []string {
823823

824824
func (m *Mediafile) ObtainVsync() []string {
825825
if m.vsync != "" {
826-
return []string{"-vsync", fmt.Sprintf("%s", m.vframes)}
826+
return []string{"-vsync", fmt.Sprintf("%s", m.vsync)}
827827
}
828828
return nil
829829
}

0 commit comments

Comments
 (0)