mediainfo 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changelog +3 -0
- data/README.markdown +16 -0
- data/Rakefile +1 -0
- data/lib/mediainfo.rb +53 -29
- data/mediainfo.gemspec +1 -1
- metadata +1 -1
data/Changelog
CHANGED
data/README.markdown
CHANGED
@@ -15,6 +15,22 @@ You can specify an alternate path if necessary:
|
|
15
15
|
|
16
16
|
Mediainfo.path = "/opt/local/bin/mediainfo"
|
17
17
|
|
18
|
+
|
19
|
+
By default, REXML is used as the XML parser. If you'd like, you can
|
20
|
+
configure Mediainfo to use Hpricot or Nokogiri instead using one of
|
21
|
+
the following approaches:
|
22
|
+
|
23
|
+
* define the `MEDIAINFO_XML_PARSER` environment variable to be the
|
24
|
+
name of the parser as you'd pass to a :gem or :require call.
|
25
|
+
|
26
|
+
e.g. `export MEDIAINFO_XML_PARSER=nokogiri`
|
27
|
+
|
28
|
+
* assign to Mediainfo.xml_parser after you've loaded the gem,
|
29
|
+
following the same naming conventions mentioned previously.
|
30
|
+
|
31
|
+
e.g. `Mediainfo.xml_parser = "hpricot"`
|
32
|
+
|
33
|
+
|
18
34
|
Once you've got an instance setup, you can call numerous methods to get
|
19
35
|
a variety of information about a file. Some attributes may be present
|
20
36
|
for some files where others are not, but any supported attribute
|
data/Rakefile
CHANGED
data/lib/mediainfo.rb
CHANGED
@@ -1,35 +1,59 @@
|
|
1
1
|
require "mediainfo/string"
|
2
2
|
require "mediainfo/attr_readers"
|
3
3
|
|
4
|
-
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
4
|
+
=begin
|
5
|
+
# Mediainfo
|
6
|
+
|
7
|
+
Mediainfo is a class wrapping [the mediainfo CLI](http://mediainfo.sourceforge.net).
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
$ gem install mediainfo -s http://gemcutter.org
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
info = Mediainfo.new "/path/to/file"
|
16
|
+
|
17
|
+
That will issue the system call to `mediainfo` and parse the output.
|
18
|
+
You can specify an alternate path if necessary:
|
19
|
+
|
20
|
+
Mediainfo.path = "/opt/local/bin/mediainfo"
|
21
|
+
|
22
|
+
|
23
|
+
By default, REXML is used as the XML parser. If you'd like, you can
|
24
|
+
configure Mediainfo to use Hpricot or Nokogiri instead using one of
|
25
|
+
the following approaches:
|
26
|
+
|
27
|
+
* define the `MEDIAINFO_XML_PARSER` environment variable to be the
|
28
|
+
name of the parser as you'd pass to a :gem or :require call.
|
29
|
+
|
30
|
+
e.g. `export MEDIAINFO_XML_PARSER=nokogiri`
|
31
|
+
|
32
|
+
* assign to Mediainfo.xml_parser after you've loaded the gem,
|
33
|
+
following the same naming conventions mentioned previously.
|
34
|
+
|
35
|
+
e.g. `Mediainfo.xml_parser = "hpricot"`
|
36
|
+
|
37
|
+
|
38
|
+
Once you've got an instance setup, you can call numerous methods to get
|
39
|
+
a variety of information about a file. Some attributes may be present
|
40
|
+
for some files where others are not, but any supported attribute
|
41
|
+
should at least return `nil`.
|
42
|
+
|
43
|
+
For a list of all possible attributes supported:
|
44
|
+
|
45
|
+
Mediainfo.supported_attributes
|
46
|
+
|
47
|
+
## Requirements
|
48
|
+
|
49
|
+
This requires at least the following version of the Mediainfo CLI:
|
50
|
+
|
51
|
+
MediaInfo Command line,
|
52
|
+
MediaInfoLib - v0.7.25
|
53
|
+
|
54
|
+
Previous versions of this gem(<= 0.5.1) worked against v0.7.11, which did not
|
55
|
+
generate XML output, and is no longer supported.
|
56
|
+
=end
|
33
57
|
class Mediainfo
|
34
58
|
extend AttrReaders
|
35
59
|
|
data/mediainfo.gemspec
CHANGED