|
|
|
|
@ -33,7 +33,10 @@ func Run(encoding config.VideoOpts, pass int, pid int, input string, output stri |
|
|
|
|
"-pix_fmt", "yuv420p", |
|
|
|
|
"-pass", fmt.Sprint(pass), |
|
|
|
|
"-passlogfile", fmt.Sprintf("ffmpeg2pass-%x.log", pid), |
|
|
|
|
"-preset", encoding.Speed, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if encoding.Preset != "" { |
|
|
|
|
extras = append(extras, "-preset", encoding.Preset) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if encoding.Resize { |
|
|
|
|
@ -94,7 +97,7 @@ func RenderFile(encoding config.VideoOpts, pid int, path string, target string) |
|
|
|
|
Run(encoding, encoding.Passes, pid, path, target) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func RenderToDir(encoding config.VideoOpts) { |
|
|
|
|
func RenderToDir(encoding config.VideoOpts, force bool) { |
|
|
|
|
matches, err := filepath.Glob(encoding.Input) |
|
|
|
|
if err != nil { log.Fatalf("%v", err) } |
|
|
|
|
|
|
|
|
|
@ -105,7 +108,7 @@ func RenderToDir(encoding config.VideoOpts) { |
|
|
|
|
|
|
|
|
|
_, err := os.Stat(target) |
|
|
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
if err != nil || force { |
|
|
|
|
fmt.Println("--- PATH", path, "->", target) |
|
|
|
|
RenderFile(encoding, rand.Int(), path, target) |
|
|
|
|
} else { |
|
|
|
|
@ -119,7 +122,7 @@ func main() { |
|
|
|
|
|
|
|
|
|
for _, encoding := range settings.Encodings { |
|
|
|
|
if encoding.OutDir != "" { |
|
|
|
|
RenderToDir(encoding) |
|
|
|
|
RenderToDir(encoding, settings.Force) |
|
|
|
|
} else { |
|
|
|
|
log.Fatal("config file needs either Output or OutDir") |
|
|
|
|
} |
|
|
|
|
|