Class: DragonflyVideo::Analysers::VideoProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/dragonfly_video/analysers/video_properties.rb

Constant Summary collapse

VIDEO_PROPS =
%i(duration bitrate size video_stream video_codec colorspace
resolution width height frame_rate audio_stream audio_codec
audio_sample_rate audio_channels).freeze

Instance Method Summary collapse

Instance Method Details

#call(content) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/dragonfly_video/analysers/video_properties.rb', line 10

def call(content)
  res = {}
  movie = FFMPEG::Movie.new(content.path)
  if movie.valid?
    VIDEO_PROPS.each do |prop_name|
      res[prop_name] = movie.send(prop_name)
    end
  end
  res
end