gearheads
/
mastodon
Archived
2
0
Fork 0

Fix some video encoding failing due to uneven dimensions (#26766)

gh/dev^2
Eugen Rochko 2023-09-02 09:02:44 +02:00 committed by GitHub
parent 16681e0f20
commit 05093266e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -102,6 +102,7 @@ class MediaAttachment < ApplicationRecord
'preset' => 'veryfast', 'preset' => 'veryfast',
'movflags' => 'faststart', # Move metadata to start of file so playback can begin before download finishes '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 '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:v' => 'h264',
'c:a' => 'aac', 'c:a' => 'aac',
'b:a' => '192k', 'b:a' => '192k',