aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/previewer/video_previewer.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2017-12-01 11:07:30 -0500
committerGitHub <noreply@github.com>2017-12-01 11:07:30 -0500
commitb852ef2660dac36e348865b455fab7fbcc0d2a7f (patch)
tree5619b01097c922e4175055f6ebeaa8c7447257da /activestorage/lib/active_storage/previewer/video_previewer.rb
parent32516e8862946da963e4ba9256553156ca321596 (diff)
downloadrails-b852ef2660dac36e348865b455fab7fbcc0d2a7f.tar.gz
rails-b852ef2660dac36e348865b455fab7fbcc0d2a7f.tar.bz2
rails-b852ef2660dac36e348865b455fab7fbcc0d2a7f.zip
Make ASt previewer/analyzer binary paths configurable
Diffstat (limited to 'activestorage/lib/active_storage/previewer/video_previewer.rb')
-rw-r--r--activestorage/lib/active_storage/previewer/video_previewer.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activestorage/lib/active_storage/previewer/video_previewer.rb b/activestorage/lib/active_storage/previewer/video_previewer.rb
index 49f128d142..5d06e33f44 100644
--- a/activestorage/lib/active_storage/previewer/video_previewer.rb
+++ b/activestorage/lib/active_storage/previewer/video_previewer.rb
@@ -2,6 +2,8 @@
module ActiveStorage
class Previewer::VideoPreviewer < Previewer
+ class_attribute :ffmpeg_path, default: "ffmpeg"
+
def self.accept?(blob)
blob.video?
end
@@ -16,7 +18,7 @@ module ActiveStorage
private
def draw_relevant_frame_from(file, &block)
- draw "ffmpeg", "-i", file.path, "-y", "-vcodec", "png",
+ draw ffmpeg_path, "-i", file.path, "-y", "-vcodec", "png",
"-vf", "thumbnail", "-vframes", "1", "-f", "image2", "-", &block
end
end