From 6dddadefa6294c7691e4afd175e813cb0340e55b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 2 Sep 2023 01:17:11 +0200 Subject: [PATCH] Fix some video encoding failing due to uneven dimensions --- app/models/media_attachment.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 984f4252a1747..f0b072e23f91e 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -102,6 +102,7 @@ class MediaAttachment < ApplicationRecord 'preset' => 'veryfast', 'movflags' => 'faststart', # Move metadata to start of file so playback can begin before download finishes 'pix_fmt' => 'yuv420p', # Ensure color space for cross-browser compatibility + 'vf' => 'crop=floor(iw/2)*2:floor(ih/2)*2', # h264 requires width and height to be even. Crop instead of scale to avoid blurring 'c:v' => 'h264', 'c:a' => 'aac', 'b:a' => '192k',