Prefer avconv over ffmpeg.

This commit is contained in:
Lars Jung 2014-06-20 22:06:50 +02:00
parent 7d8284e3ee
commit 922f83357f

View File

@ -16,6 +16,10 @@ class Thumb {
$this->app = $app;
$this->thumbs_path = CACHE_PATH . "/" . Thumb::$THUMB_CACHE;
$this->thumbs_href = CACHE_HREF . Thumb::$THUMB_CACHE;
if (!is_dir($this->thumbs_path)) {
@mkdir($this->thumbs_path, 0755, true);
}
}
@ -29,10 +33,10 @@ class Thumb {
if ($type === "img") {
$capture_path = $source_path;
} else if ($type === "mov") {
if (HAS_CMD_FFMPEG) {
$capture_path = $this->capture(Thumb::$FFMPEG_CMDV, $source_path);
} else if (HAS_CMD_AVCONV) {
if (HAS_CMD_AVCONV) {
$capture_path = $this->capture(Thumb::$AVCONV_CMDV, $source_path);
} else if (HAS_CMD_FFMPEG) {
$capture_path = $this->capture(Thumb::$FFMPEG_CMDV, $source_path);
}
} else if ($type === "doc" && HAS_CMD_CONVERT) {
$capture_path = $this->capture(Thumb::$CONVERT_CMDV, $source_path);
@ -48,10 +52,6 @@ class Thumb {
return null;
}
if (!is_dir($this->thumbs_path)) {
@mkdir($this->thumbs_path, 0755, true);
}
$name = "thumb-" . sha1("$source_path-$width-$height-$mode") . ".jpg";
$thumb_path = $this->thumbs_path . "/" . $name;
$thumb_url = $this->thumbs_href . "/" . $name;