server ffmpeg version needed extra args

pull/16/head
Stephen Searles 7 years ago
parent acbfdbe8eb
commit fb93746ba6
  1. 2
      media/video.go

@ -33,7 +33,7 @@ func VideoSize(filename string) (image.Rectangle, error) {
func VideoEncode(filename string, size image.Rectangle, thumbDir string) error { func VideoEncode(filename string, size image.Rectangle, thumbDir string) error {
dest := thumbFilename(thumbDir, size, path.Base(filename)) dest := thumbFilename(thumbDir, size, path.Base(filename))
os.MkdirAll(filepath.Dir(dest), 0755) os.MkdirAll(filepath.Dir(dest), 0755)
cmd := exec.Command("ffmpeg", "-i", filename, "-vf", fmt.Sprintf("scale=%d:%d", size.Dx(), size.Dy()), dest) cmd := exec.Command("ffmpeg", "-i", filename, "-vf", fmt.Sprintf("scale=%d:%d", size.Dx(), size.Dy()), "-strict", "-2", dest)
if out, err := cmd.CombinedOutput(); err != nil { if out, err := cmd.CombinedOutput(); err != nil {
os.Remove(dest) os.Remove(dest)
return fmt.Errorf("could not thumb video: %s", string(out)) return fmt.Errorf("could not thumb video: %s", string(out))

Loading…
Cancel
Save