|
|
|
@ -25,14 +25,13 @@ func ModFile(fname string, encoding config.VideoOpts) string { |
|
|
|
return filepath.Join(dir, renamed) |
|
|
|
return filepath.Join(dir, renamed) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func Run(encoding config.VideoOpts, pass int, pid int, input string, output string) { |
|
|
|
func Run(encoding config.VideoOpts, pass int, pid int, input string, output string) { |
|
|
|
encode := fluentffmpeg.NewCommand("") |
|
|
|
encode := fluentffmpeg.NewCommand("") |
|
|
|
|
|
|
|
|
|
|
|
extras := []string{ |
|
|
|
extras := []string{ |
|
|
|
"-pix_fmt", "yuv420p", |
|
|
|
"-pix_fmt", "yuv420p", |
|
|
|
"-pass", fmt.Sprint(pass), |
|
|
|
"-pass", fmt.Sprint(pass), |
|
|
|
"-passlogfile", fmt.Sprintf("ffmpeg2pass-%x.log", pid), |
|
|
|
"-passlogfile", fmt.Sprintf("ffmpegpass-%x.log", pid), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if encoding.Preset != "" { |
|
|
|
if encoding.Preset != "" { |
|
|
|
@ -45,8 +44,6 @@ func Run(encoding config.VideoOpts, pass int, pid int, input string, output stri |
|
|
|
"-aspect", encoding.Scale) |
|
|
|
"-aspect", encoding.Scale) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extras = append(extras, encoding.Extras...) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if pass != encoding.Passes { |
|
|
|
if pass != encoding.Passes { |
|
|
|
extras = append(extras, "-an") |
|
|
|
extras = append(extras, "-an") |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
@ -66,6 +63,7 @@ func Run(encoding config.VideoOpts, pass int, pid int, input string, output stri |
|
|
|
FrameRate(encoding.FPS). |
|
|
|
FrameRate(encoding.FPS). |
|
|
|
ConstantRateFactor(encoding.CRF) |
|
|
|
ConstantRateFactor(encoding.CRF) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extras = append(extras, encoding.Extras...) |
|
|
|
encode.OutputOptions(extras...) |
|
|
|
encode.OutputOptions(extras...) |
|
|
|
|
|
|
|
|
|
|
|
cmd := encode.InputPath(input). |
|
|
|
cmd := encode.InputPath(input). |
|
|
|
|