From a82a149b7034c04b9e459cefe13447ecb402c358 Mon Sep 17 00:00:00 2001 From: Ari Summer Date: Fri, 18 Jun 2021 16:36:49 -0600 Subject: [PATCH 1/3] Replace paperclip dependency with kt-paperclip --- paperclip-av-transcoder.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paperclip-av-transcoder.gemspec b/paperclip-av-transcoder.gemspec index c62aa5c..0c940f8 100644 --- a/paperclip-av-transcoder.gemspec +++ b/paperclip-av-transcoder.gemspec @@ -25,6 +25,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "sqlite3" spec.add_development_dependency "coveralls" - spec.add_dependency "paperclip", ">=2.5.2" + spec.add_dependency "kt-paperclip", ">=2.5.2" spec.add_dependency "av", "~> 0.9.0" end From bdbda4af51bf55f55ff75c226c36b6b67713861a Mon Sep 17 00:00:00 2001 From: Alex <2286882+laramee@users.noreply.github.com> Date: Tue, 2 Aug 2022 10:09:41 -0700 Subject: [PATCH 2/3] Cocaine -> Terrapin --- lib/paperclip/paperclip_processors/transcoder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/paperclip/paperclip_processors/transcoder.rb b/lib/paperclip/paperclip_processors/transcoder.rb index d67efea..684b295 100755 --- a/lib/paperclip/paperclip_processors/transcoder.rb +++ b/lib/paperclip/paperclip_processors/transcoder.rb @@ -75,7 +75,7 @@ def make begin @cli.run log "Successfully transcoded #{@basename} to #{dst}" - rescue Cocaine::ExitStatusError => e + rescue Terrapin::ExitStatusError => e raise Paperclip::Error, "error while transcoding #{@basename}: #{e}" if @whiny end else From 88725014f88252e8bb14155de7c92257ba5d00be Mon Sep 17 00:00:00 2001 From: Alex <2286882+laramee@users.noreply.github.com> Date: Thu, 4 Aug 2022 13:33:19 -0700 Subject: [PATCH 3/3] Allow passing runner options to Av --- lib/paperclip/paperclip_processors/transcoder.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/paperclip/paperclip_processors/transcoder.rb b/lib/paperclip/paperclip_processors/transcoder.rb index 684b295..802467b 100755 --- a/lib/paperclip/paperclip_processors/transcoder.rb +++ b/lib/paperclip/paperclip_processors/transcoder.rb @@ -1,6 +1,6 @@ module Paperclip class Transcoder < Processor - attr_accessor :geometry, :format, :whiny, :convert_options + attr_accessor :geometry, :format, :whiny, :convert_options, :runner_options # Creates a Video object set to work on the +file+ given. It # will attempt to transcode the video into one defined by +target_geometry+ # which is a "WxH"-style string. +format+ should be specified. @@ -14,6 +14,7 @@ def initialize file, options = {}, attachment = nil @cli = ::Av.cli @meta = ::Av.cli.identify(@file.path) @whiny = options[:whiny].nil? ? true : options[:whiny] + @runner_options = options[:runner_options] @convert_options = set_convert_options(options) @@ -73,7 +74,7 @@ def make end begin - @cli.run + @cli.run(@runner_options) log "Successfully transcoded #{@basename} to #{dst}" rescue Terrapin::ExitStatusError => e raise Paperclip::Error, "error while transcoding #{@basename}: #{e}" if @whiny