Skip to content

Commit

Permalink
Fix some video encoding failing due to uneven dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Gargron committed Sep 1, 2023
1 parent 16681e0 commit 6dddade
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/models/media_attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 6dddade

Please sign in to comment.