

Name of the parser as you'd pass to a :gem or :require call.Į.g. If you'd like, you canĬonfigure Mediainfo to use Nokogiri instead:ĭefine the MEDIAINFO_XML_PARSER environment variable to be the REXML is used as the XML parser by default. Else if no ID exists, you'll see consecutive numbering for duplicate tracks in the Media.Īny second level attributes are also available: om('~/Desktop/test.mov').general.extra This is because the MediaInfo from the video has: The track type media_5 is available, but no video2, 3, and 4. In order to support all possible MediaInfo variations, you may see the following situation: media_info. You can review lib/attribute_standardization_rules.yml to see them all media_rate => nil (\41.2 Mbps\) We standardize the naming of several Attributes: Submit an issue to add more! media_ => 15164 (\15s 164ms\) In the form of a Float (as for iphone mov files) Ms (15hour 6min 59sec 301ms) (milliseconds) overall_duration will be returned as milliseconds AS LONG AS the Duration and Overall_Duration match one of the expected units (each separated by a space or not): Media_aspect_ratio.class => FloatĪny track attribute name with "date" and matching /\d-/ will be converted using Time.parse: Note that the above automatically converts MediaInfo Strings into Time, Integer, and Float objects: display_aspect_ratio => 1.222 media_info. The first track type name, or any track type with 1 will not contain '1' media_info. Sometimes you'll have more than one track of a given type: Theįirst approach assumes one track of a given type, a common scenario in many video files, When inspecting specific types of tracks, you have a couple general API options. Once you have an MediaInfo object, you can start inspecting tracks: media_ack_types => You can specify an alternate path for the MediaInfo Binary: ENV = " /opt/local/bin/mediainfo " from ( ' ~/Desktop/test.mov ' ) Handling a URL media_info = MediaInfo. read ) Handling a local file media_info = MediaInfo. Usage Parsing raw XML media_info = MediaInfo. MediaInfo is a class wrapping the mediainfo CLI.
