about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUna <me@unascribed.com>2022-09-02 00:29:31 -0700
committerGitHub <noreply@github.com>2022-09-02 09:29:31 +0200
commitd4e63cd980a87b7bdbde57124d230e7e60ec38f1 (patch)
tree4fbc5d75e9fbb271aa1d090c2005cb25ce5f4bb4
parent156c6ea36ceb080ca4be007bcfdda52e907937aa (diff)
Fix audio always being re-encoded even for passthrough-eligible media (#1839)
-rw-r--r--lib/paperclip/transcoder.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/paperclip/transcoder.rb b/lib/paperclip/transcoder.rb
index afd9f58ff..b3b55f82f 100644
--- a/lib/paperclip/transcoder.rb
+++ b/lib/paperclip/transcoder.rb
@@ -40,8 +40,10 @@ module Paperclip
         @output_options['f']       = 'image2'
         @output_options['vframes'] = 1
       when 'mp4'
-        @output_options['acodec'] = 'aac'
-        @output_options['strict'] = 'experimental'
+        unless eligible_to_passthrough?(metadata)
+          @output_options['acodec'] = 'aac'
+          @output_options['strict'] = 'experimental'
+        end
 
         if high_vfr?(metadata) && !eligible_to_passthrough?(metadata)
           @output_options['vsync'] = 'vfr'