From 5c7d21e397ba6a5e8a93681a219ff72f9cb380f6 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sat, 28 Dec 2019 10:47:04 -0500 Subject: [PATCH] fix for excessively slow vp8 encoding and tag bug --- lib/philomena/images/image.ex | 2 +- lib/philomena/processors/webm.ex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/philomena/images/image.ex b/lib/philomena/images/image.ex index e903d168..d6d5ccce 100644 --- a/lib/philomena/images/image.ex +++ b/lib/philomena/images/image.ex @@ -278,7 +278,7 @@ defmodule Philomena.Images.Image do file_name_slug_fragment = tags |> Enum.map_join("_", & &1.slug) - |> String.replace("%2F", "") + |> String.replace("%", "") |> String.replace("/", "") |> String.slice(0..150) diff --git a/lib/philomena/processors/webm.ex b/lib/philomena/processors/webm.ex index 71b77625..93232e99 100644 --- a/lib/philomena/processors/webm.ex +++ b/lib/philomena/processors/webm.ex @@ -72,7 +72,7 @@ defmodule Philomena.Processors.Webm do scale_filter = "scale=w=#{width}:h=#{height}" {_output, 0} = - System.cmd("ffmpeg", ["-loglevel", "0", "-y", "-i", file, "-c:v", "libvpx", "-auto-alt-ref", "0", "-crf", "10", "-b:v", "5M", "-vf", scale_filter, webm]) + System.cmd("ffmpeg", ["-loglevel", "0", "-y", "-i", file, "-c:v", "libvpx", "-quality", "good", "-cpu-used", "3", "-auto-alt-ref", "0", "-crf", "10", "-b:v", "5M", "-vf", scale_filter, webm]) {_output, 0} = System.cmd("ffmpeg", ["-loglevel", "0", "-y", "-i", file, "-c:v", "libx264", "-pix_fmt", "yuv420p", "-profile:v", "main", "-preset", "medium", "-crf", "18", "-b:v", "5M", "-vf", scale_filter, mp4])