Module: FFMpeg::MetaData
- Included in:
- FFMpeg
- Defined in:
- lib/ffmpeg/meta_data.rb
Constant Summary collapse
- EXIF_UTILITY =
'exiftool'
Instance Method Summary collapse
-
#meta ⇒ Object
Retrieves meta data from the file using exiftool, and returned in a hash allowing for complex conversion rules.
Instance Method Details
#meta ⇒ Object
Retrieves meta data from the file using exiftool, and returned in a hash allowing for complex conversion rules.
video_bitrate "300k" if [:video_bitrate].to_f > 300
11 12 13 14 15 16 17 18 19 |
# File 'lib/ffmpeg/meta_data.rb', line 11 def if `which #{EXIF_UTILITY}`.empty? {} else @meta_data ||= `#{EXIF_UTILITY} #{@from_file}`.split("\n").inject({}) {|hash, element| hash.merge(((split = element.split(':')) && split.first.strip.downcase.gsub(/[^a-zA-Z0-9]/, "_").to_sym) => (split.shift && split).join(':').strip) } end end |