Skip to content

Commit

Permalink
Fix unexpected audio stream transcoding when uploaded video is eligib…
Browse files Browse the repository at this point in the history
…le to passthrough (mastodon#26608)

Co-authored-by: Claire <[email protected]>
  • Loading branch information
yufushiro and ClearlyClaire authored Aug 23, 2023
1 parent cf6f707 commit 3aac129
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/paperclip/transcoder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ def make
@output_options['f'] = 'image2'
@output_options['vframes'] = 1
when 'mp4'
@output_options['acodec'] = 'aac'
@output_options['strict'] = 'experimental'

if high_vfr?(metadata) && !eligible_to_passthrough?(metadata)
@output_options['vsync'] = 'vfr'
@output_options['r'] = @vfr_threshold
unless eligible_to_passthrough?(metadata)
@output_options['acodec'] = 'aac'
@output_options['strict'] = 'experimental'

if high_vfr?(metadata)
@output_options['vsync'] = 'vfr'
@output_options['r'] = @vfr_threshold
end
end
end

Expand Down

0 comments on commit 3aac129

Please sign in to comment.