diff options
author | George Claghorn <george.claghorn@gmail.com> | 2017-12-01 11:07:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-01 11:07:30 -0500 |
commit | b852ef2660dac36e348865b455fab7fbcc0d2a7f (patch) | |
tree | 5619b01097c922e4175055f6ebeaa8c7447257da /activestorage/lib/active_storage/analyzer | |
parent | 32516e8862946da963e4ba9256553156ca321596 (diff) | |
download | rails-b852ef2660dac36e348865b455fab7fbcc0d2a7f.tar.gz rails-b852ef2660dac36e348865b455fab7fbcc0d2a7f.tar.bz2 rails-b852ef2660dac36e348865b455fab7fbcc0d2a7f.zip |
Make ASt previewer/analyzer binary paths configurable
Diffstat (limited to 'activestorage/lib/active_storage/analyzer')
-rw-r--r-- | activestorage/lib/active_storage/analyzer/video_analyzer.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activestorage/lib/active_storage/analyzer/video_analyzer.rb b/activestorage/lib/active_storage/analyzer/video_analyzer.rb index 408b5e58e9..b6fc54d917 100644 --- a/activestorage/lib/active_storage/analyzer/video_analyzer.rb +++ b/activestorage/lib/active_storage/analyzer/video_analyzer.rb @@ -19,6 +19,8 @@ module ActiveStorage # This analyzer requires the {ffmpeg}[https://www.ffmpeg.org] system library, which is not provided by Rails. You must # install ffmpeg yourself to use this analyzer. class Analyzer::VideoAnalyzer < Analyzer + class_attribute :ffprobe_path, default: "ffprobe" + def self.accept?(blob) blob.video? end @@ -68,7 +70,7 @@ module ActiveStorage end def probe_from(file) - IO.popen([ "ffprobe", "-print_format", "json", "-show_streams", "-v", "error", file.path ]) do |output| + IO.popen([ ffprobe_path, "-print_format", "json", "-show_streams", "-v", "error", file.path ]) do |output| JSON.parse(output.read) end rescue Errno::ENOENT |