lib/video_converter/mp4info.rb
# Get the formatted audio or video bitrate from the MP4 video
# file at path.
#
# @param path [String] Path to an MP4 video file
# @param type [#to_s] :audio or :video
# @return [String] The formatted bitrate from the mp4info output
Get the formatted audio or video bitrate from the MP4 video
file at path.
Get the formatted audio or video bitrate from the MP4 video file at path .
def formatted_bitrate(path, type)
      mp4info_output(path).split("\n").each do |line|
        next unless line =~ /\d\t#{type}/
        return line.split(',')[2].strip
      end
      '(not found)'
    end
def formatted_bitrate ( path , type ) mp4info_output ( path ) . split ( "\n" ) . each do | line | next unless line =~ / \d \t #{ type } / return line . split ( ',' ) [ 2 ] . strip end '(not found)' end
Get the formatted audio or video bitrate from the MP4 video
file at path.
Get the formatted audio or video bitrate from the MP4 video file at path .
The formatted bitrate from the mp4info output
The formatted bitrate from the mp4info output
String
path
Path to an MP4 video file
Path to an MP4 video file
type
:audio or :video
: audio or : video