|
|
|
|
@ -31,8 +31,12 @@ func Run(encoding config.VideoOpts, pass int, pid int, input string, output stri |
|
|
|
|
|
|
|
|
|
extras := []string{ |
|
|
|
|
"-pix_fmt", "yuv420p", |
|
|
|
|
"-pass", fmt.Sprint(pass), |
|
|
|
|
"-passlogfile", fmt.Sprintf("ffmpegpass-%x.log", pid), |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if encoding.Passes > 1 { |
|
|
|
|
extras = append(extras,
|
|
|
|
|
"-pass", fmt.Sprint(pass), |
|
|
|
|
"-passlogfile", fmt.Sprintf("ffmpegpass-%x.log", pid)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if encoding.Preset != "" { |
|
|
|
|
@ -45,7 +49,8 @@ func Run(encoding config.VideoOpts, pass int, pid int, input string, output stri |
|
|
|
|
"-aspect", encoding.Scale) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if pass != encoding.Passes { |
|
|
|
|
if pass != encoding.Passes || encoding.Dash { |
|
|
|
|
// BUG: warn that dash removes audio
|
|
|
|
|
extras = append(extras, "-an") |
|
|
|
|
} else { |
|
|
|
|
encode.AudioCodec(encoding.AudioCodec) |
|
|
|
|
@ -53,25 +58,33 @@ func Run(encoding config.VideoOpts, pass int, pid int, input string, output stri |
|
|
|
|
"-b:a", fmt.Sprint(encoding.AudioBitrate * 1024)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if encoding.Test > 0 { |
|
|
|
|
encode.InputOptions("-ss", fmt.Sprintf("00:%d", encoding.TestStart)) |
|
|
|
|
extras = append(extras, "-t", fmt.Sprint(encoding.Test)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
encode.VideoCodec(encoding.VideoCodec). |
|
|
|
|
VideoBitRate(encoding.VideoBitrate * 1024). |
|
|
|
|
FrameRate(encoding.FPS). |
|
|
|
|
ConstantRateFactor(encoding.CRF) |
|
|
|
|
VideoBitRate(encoding.VideoBitrate * 1024). |
|
|
|
|
FrameRate(encoding.FPS). |
|
|
|
|
ConstantRateFactor(encoding.CRF) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extras = append(extras, encoding.Extras...) |
|
|
|
|
|
|
|
|
|
if encoding.Dash { |
|
|
|
|
extras = append(extras, "-dash", "1") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
encode.OutputOptions(extras...) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd := encode.InputPath(input). |
|
|
|
|
OutputFormat(encoding.Format). |
|
|
|
|
OutputPath(output). |
|
|
|
|
OutputLogs(os.Stdout). |
|
|
|
|
Overwrite(true). |
|
|
|
|
Build() |
|
|
|
|
OutputFormat(encoding.Format). |
|
|
|
|
OutputPath(output). |
|
|
|
|
OutputLogs(os.Stdout). |
|
|
|
|
Overwrite(true). |
|
|
|
|
Build() |
|
|
|
|
|
|
|
|
|
fmt.Println(">", cmd.String()) |
|
|
|
|
|
|
|
|
|
|