lib/video_converter/mp4info.rb
# Returns the dimensions of the video at path as an Array.
#
# @param path [String] Path to an MP4 video file
# @return [Array] An Array containing width and height of the video in pixels
Returns the dimensions of the video at path as an Array.
Returns the dimensions of the video at path as an Array .
def dimensions(path)
      mp4info_output(path).split("\n").each do |line|
        matches = /video.*\s(\d+)x(\d+)\s/.match line
        next if matches.nil?
        return [matches[1].to_f, matches[2].to_f]
      end
      [nil, nil]
    end
def dimensions ( path ) mp4info_output ( path ) . split ( "\n" ) . each do | line | matches = / video.* \s ( \d +)x( \d +) \s / . match line next if matches . nil? return [ matches [ 1 ] . to_f , matches [ 2 ] . to_f ] end [ nil , nil ] end
Returns the dimensions of the video at path as an Array.
Returns the dimensions of the video at path as an Array .
An Array containing width and height of the video in pixels
An Array containing width and height of the video in pixels
Array
path
Path to an MP4 video file
Path to an MP4 video file