summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2023-09-02 09:02:44 +0200
committerGitHub <noreply@github.com>2023-09-02 09:02:44 +0200
commit05093266e6e3c54f9096da9cdcdafdc83703c578 (patch)
tree74b4a7015f6054d4859c1b742fbd3856e58a3df5
parent16681e0f20e1f8584e11439953c8d59b322571f5 (diff)
Fix some video encoding failing due to uneven dimensions (#26766)
-rw-r--r--app/models/media_attachment.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb
index 984f4252a17..f0b072e23f9 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',