ffprober 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Changes.md +5 -0
- data/Gemfile +1 -4
- data/ffprober.gemspec +1 -1
- data/lib/ffprober/ffprobe_version.rb +1 -1
- data/lib/ffprober/version.rb +1 -1
- data/spec/assets/version_outputs/osx-2_1_2 +11 -0
- data/spec/assets/version_outputs/osx-2_1_4 +11 -0
- data/spec/assets/version_outputs/osx-2_2 +11 -0
- data/spec/ffprober/ffprobe_version_spec.rb +19 -11
- data/spec/ffprober/parser_spec.rb +21 -35
- data/spec/ffprober_spec.rb +5 -4
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9720e6501e9017095339eeeda71ea175a478645
|
4
|
+
data.tar.gz: 1779005a50673b1ef183320d7702287ef9186bfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb08ab86f81c9c662c708954bad57a92dc49f77ada054d5828b2f5df7ae7d95a646ef2ac0b55ce729aa3fff47330aa3223677ef3e49982ac4a1bb3c37634337f
|
7
|
+
data.tar.gz: ee31e032b48e4a923df8a4f31525874a80dcac433747039310e069ad40b68ed8d8c9993c5067961d41886b9ccce5f21381231049e640d73685520dcd889db0c4
|
data/.travis.yml
CHANGED
data/Changes.md
CHANGED
data/Gemfile
CHANGED
data/ffprober.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
|
|
13
13
|
|
14
14
|
gem.licenses = ['MIT']
|
15
15
|
|
16
|
-
gem.add_development_dependency "rspec", "~>
|
16
|
+
gem.add_development_dependency "rspec", "~> 3.0.0.beta1"
|
17
17
|
|
18
18
|
gem.files = `git ls-files`.split("\n")
|
19
19
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/ffprober/version.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
ffprobe version 2.1.2-tessus
|
2
|
+
built on Jan 13 2014 18:27:44 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
|
3
|
+
configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
|
4
|
+
libavutil 52. 48.101 / 52. 48.101
|
5
|
+
libavcodec 55. 39.101 / 55. 39.101
|
6
|
+
libavformat 55. 19.104 / 55. 19.104
|
7
|
+
libavdevice 55. 5.100 / 55. 5.100
|
8
|
+
libavfilter 3. 90.100 / 3. 90.100
|
9
|
+
libswscale 2. 5.101 / 2. 5.101
|
10
|
+
libswresample 0. 17.104 / 0. 17.104
|
11
|
+
libpostproc 52. 3.100 / 52. 3.100
|
@@ -0,0 +1,11 @@
|
|
1
|
+
ffprobe version 2.1.4-tessus
|
2
|
+
built on Feb 23 2014 19:51:22 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
|
3
|
+
configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
|
4
|
+
libavutil 52. 48.101 / 52. 48.101
|
5
|
+
libavcodec 55. 39.101 / 55. 39.101
|
6
|
+
libavformat 55. 19.104 / 55. 19.104
|
7
|
+
libavdevice 55. 5.100 / 55. 5.100
|
8
|
+
libavfilter 3. 90.100 / 3. 90.100
|
9
|
+
libswscale 2. 5.101 / 2. 5.101
|
10
|
+
libswresample 0. 17.104 / 0. 17.104
|
11
|
+
libpostproc 52. 3.100 / 52. 3.100
|
@@ -0,0 +1,11 @@
|
|
1
|
+
ffprobe version 2.2-tessus
|
2
|
+
built on Mar 24 2014 22:25:11 with llvm-gcc 4.2.1 (LLVM build 2336.1.00)
|
3
|
+
configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-libmodplug --enable-fontconfig --enable-libfreetype --enable-libass --enable-libbluray --enable-filters --enable-runtime-cpudetect
|
4
|
+
libavutil 52. 66.100 / 52. 66.100
|
5
|
+
libavcodec 55. 52.102 / 55. 52.102
|
6
|
+
libavformat 55. 33.100 / 55. 33.100
|
7
|
+
libavdevice 55. 10.100 / 55. 10.100
|
8
|
+
libavfilter 4. 2.100 / 4. 2.100
|
9
|
+
libswscale 2. 5.102 / 2. 5.102
|
10
|
+
libswresample 0. 18.100 / 0. 18.100
|
11
|
+
libpostproc 52. 3.100 / 52. 3.100
|
@@ -8,14 +8,22 @@ describe Ffprober::FfprobeVersion do
|
|
8
8
|
{ version: "1.1.0", pass: true },
|
9
9
|
{ version: "2.9.0", pass: false },
|
10
10
|
{ version: "1.2.1", pass: true },
|
11
|
-
{ version: "2.0",
|
11
|
+
{ version: "2.0", pass: true},
|
12
|
+
{ version: "2.0.1", pass: true },
|
13
|
+
{ version: "2.0.2", pass: true },
|
14
|
+
{ version: "2.1.1", pass: true },
|
15
|
+
{ version: "2.1.2", pass: true },
|
16
|
+
{ version: "2.1.4", pass: true },
|
17
|
+
{ version: "2.2", pass: true }
|
12
18
|
]
|
13
19
|
|
20
|
+
subject(:ffprobe_version) { Ffprober::FfprobeVersion.new }
|
21
|
+
|
14
22
|
context 'validates the ffprobe version' do
|
15
23
|
VERSION_CHECKS.each do |check|
|
16
24
|
it "detects version #{check[:version]}" do
|
17
|
-
|
18
|
-
|
25
|
+
allow(ffprobe_version).to receive(:version).and_return(Gem::Version.new(check[:version]))
|
26
|
+
expect(ffprobe_version.valid?).to be(check[:pass])
|
19
27
|
end
|
20
28
|
end
|
21
29
|
end
|
@@ -27,22 +35,22 @@ describe Ffprober::FfprobeVersion do
|
|
27
35
|
|
28
36
|
it "on #{os} from #{expected_version}" do
|
29
37
|
version_output = File.read("spec/assets/version_outputs/" + entry)
|
30
|
-
|
31
|
-
|
38
|
+
|
39
|
+
allow(ffprobe_version).to receive(:version_output).and_return(version_output)
|
32
40
|
|
33
41
|
if expected_version == "nightly"
|
34
|
-
|
35
|
-
|
42
|
+
expect(ffprobe_version.nightly?).to eq(true)
|
43
|
+
expect(ffprobe_version.valid?).to eq(true)
|
36
44
|
else
|
37
|
-
|
45
|
+
expect(ffprobe_version.version).to eq(Gem::Version.new(expected_version.gsub("_", ".")))
|
38
46
|
end
|
39
47
|
end
|
40
48
|
end
|
41
49
|
|
42
50
|
it "should not be valid if no ffprobe could be found in PATH" do
|
43
|
-
Ffprober.
|
44
|
-
|
45
|
-
Ffprober::FfprobeVersion.valid
|
51
|
+
allow(Ffprober).to receive(:path).and_return(nil)
|
52
|
+
expect(ffprobe_version.version.to_s).to eq("0.0.0")
|
53
|
+
expect(Ffprober::FfprobeVersion.valid?).to eq(false)
|
46
54
|
end
|
47
55
|
|
48
56
|
end
|
@@ -4,112 +4,98 @@ require 'spec_helper'
|
|
4
4
|
describe Ffprober::Parser do
|
5
5
|
|
6
6
|
describe "from_file with whitespace", if: Ffprober::FfprobeVersion.valid? do
|
7
|
-
|
8
|
-
@ffprobe = Ffprober::Parser.from_file('spec/assets/301 extracting a ruby gem.m4v')
|
9
|
-
end
|
7
|
+
let(:ffprobe) { Ffprober::Parser.from_file('spec/assets/301 extracting a ruby gem.m4v') }
|
10
8
|
|
11
9
|
describe "format" do
|
12
10
|
it "should determine the correct filename" do
|
13
|
-
|
11
|
+
expect(ffprobe.format.filename).to eq("spec/assets/301 extracting a ruby gem.m4v")
|
14
12
|
end
|
15
13
|
|
16
14
|
it "should find the correct size" do
|
17
|
-
|
15
|
+
expect(ffprobe.format.size).to eq("130694")
|
18
16
|
end
|
19
17
|
|
20
18
|
it "should find the correct bit_rate" do
|
21
|
-
|
19
|
+
expect(ffprobe.format.bit_rate).to eq("502669")
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
26
24
|
describe "from_file", if: Ffprober::FfprobeVersion.valid? do
|
27
|
-
|
28
|
-
@ffprobe = Ffprober::Parser.from_file('spec/assets/301-extracting_a_ruby_gem.m4v')
|
29
|
-
end
|
25
|
+
let(:ffprobe) { Ffprober::Parser.from_file('spec/assets/301-extracting_a_ruby_gem.m4v') }
|
30
26
|
|
31
27
|
describe "format" do
|
32
28
|
it "should determine the correct filename" do
|
33
|
-
|
29
|
+
expect(ffprobe.format.filename).to eq("spec/assets/301-extracting_a_ruby_gem.m4v")
|
34
30
|
end
|
35
31
|
|
36
32
|
it "should find the correct size" do
|
37
|
-
|
33
|
+
expect(ffprobe.format.size).to eq("130694")
|
38
34
|
end
|
39
35
|
|
40
36
|
it "should find the correct bit_rate" do
|
41
|
-
|
37
|
+
expect(ffprobe.format.bit_rate).to eq("502669")
|
42
38
|
end
|
43
39
|
end
|
44
40
|
end
|
45
41
|
|
46
42
|
describe "from invalid file", if: Ffprober::FfprobeVersion.valid? do
|
47
|
-
|
48
|
-
@ffprobe = Ffprober::Parser.from_file('spec/assets/empty_file')
|
49
|
-
end
|
43
|
+
let(:ffprobe) { Ffprober::Parser.from_file('spec/assets/empty_file') }
|
50
44
|
|
51
45
|
describe "format" do
|
52
46
|
it "should determine the correct filename" do
|
53
|
-
expect
|
54
|
-
@ffprobe.format.filename.should eq("spec/assets/empty_file")
|
55
|
-
end.to raise_error
|
47
|
+
expect { ffprobe.format.filename }.to raise_error
|
56
48
|
end
|
57
49
|
|
58
50
|
it "should find the correct size" do
|
59
|
-
expect
|
60
|
-
@ffprobe.format.size.should eq("130694")
|
61
|
-
end.to raise_error
|
51
|
+
expect { ffprobe.format.size }.to raise_error
|
62
52
|
end
|
63
53
|
|
64
54
|
it "should find the correct bit_rate" do
|
65
|
-
expect
|
66
|
-
@ffprobe.format.bit_rate.should eq("502669")
|
67
|
-
end.to raise_error
|
55
|
+
expect { ffprobe.format.bit_rate }.to raise_error
|
68
56
|
end
|
69
57
|
end
|
70
58
|
end
|
71
59
|
|
72
60
|
describe "from_json" do
|
73
|
-
|
74
|
-
@ffprobe = Ffprober::Parser.from_json(File.read('spec/assets/301-extracting_a_ruby_gem.json'))
|
75
|
-
end
|
61
|
+
let(:ffprobe) { Ffprober::Parser.from_json(File.read('spec/assets/301-extracting_a_ruby_gem.json')) }
|
76
62
|
|
77
63
|
describe "format" do
|
78
64
|
it "should determine the correct filename" do
|
79
|
-
|
65
|
+
expect(ffprobe.format.filename).to eq("301-extracting-a-ruby-gem.mp4")
|
80
66
|
end
|
81
67
|
|
82
68
|
it "should find the correct size" do
|
83
|
-
|
69
|
+
expect(ffprobe.format.size).to eq("44772490")
|
84
70
|
end
|
85
71
|
|
86
72
|
it "should find the correct bit_rate" do
|
87
|
-
|
73
|
+
expect(ffprobe.format.bit_rate).to eq("361309")
|
88
74
|
end
|
89
75
|
end
|
90
76
|
|
91
77
|
describe "audio_streams" do
|
92
78
|
it "should determine the correct number of audio streams" do
|
93
|
-
|
79
|
+
expect(ffprobe.audio_streams.count).to eq(1)
|
94
80
|
end
|
95
81
|
|
96
82
|
it "should determine the correct sample rate of the first audio stream" do
|
97
|
-
|
83
|
+
expect(ffprobe.audio_streams.first.sample_rate).to eq("48000")
|
98
84
|
end
|
99
85
|
|
100
86
|
end
|
101
87
|
|
102
88
|
describe "video_streams" do
|
103
89
|
it "should determine the correct width of the first video streams" do
|
104
|
-
|
90
|
+
expect(ffprobe.video_streams.first.width).to eq(960)
|
105
91
|
end
|
106
92
|
|
107
93
|
it "should determine the correct width of the first video streams" do
|
108
|
-
|
94
|
+
expect(ffprobe.video_streams.first.height).to eq(600)
|
109
95
|
end
|
110
96
|
|
111
97
|
it "should determine the correct number of video streams" do
|
112
|
-
|
98
|
+
expect(ffprobe.video_streams.count).to eq(1)
|
113
99
|
end
|
114
100
|
end
|
115
101
|
end
|
data/spec/ffprober_spec.rb
CHANGED
@@ -5,17 +5,18 @@ describe Ffprober do
|
|
5
5
|
|
6
6
|
describe "if no ffprobe is found" do
|
7
7
|
it "should raise a exception if there is no ffmpeg" do
|
8
|
-
Ffprober.
|
8
|
+
allow(Ffprober).to receive(:path).and_return("nonexistant")
|
9
|
+
|
9
10
|
expect {
|
10
|
-
|
11
|
+
Ffprober::Parser.from_file('spec/assets/301-extracting_a_ruby_gem.m4v')
|
11
12
|
}.to raise_error
|
12
13
|
end
|
13
14
|
|
14
15
|
it "should raise a exception if there is no valid ffmpeg" do
|
15
|
-
Ffprober::FfprobeVersion.
|
16
|
+
allow(Ffprober::FfprobeVersion).to receive(:valid?).and_return(false)
|
16
17
|
|
17
18
|
expect {
|
18
|
-
|
19
|
+
Ffprober::Parser.from_file('spec/assets/301-extracting_a_ruby_gem.m4v')
|
19
20
|
}.to raise_error(ArgumentError)
|
20
21
|
end
|
21
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffprober
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- beanieboi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0.beta1
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0.beta1
|
27
27
|
description: a Ruby wrapper for ffprobe
|
28
28
|
email:
|
29
29
|
- beanie@benle.de
|
@@ -57,6 +57,9 @@ files:
|
|
57
57
|
- spec/assets/version_outputs/osx-1_2_0
|
58
58
|
- spec/assets/version_outputs/osx-2_0
|
59
59
|
- spec/assets/version_outputs/osx-2_0_1
|
60
|
+
- spec/assets/version_outputs/osx-2_1_2
|
61
|
+
- spec/assets/version_outputs/osx-2_1_4
|
62
|
+
- spec/assets/version_outputs/osx-2_2
|
60
63
|
- spec/assets/version_outputs/raspian-0_8_6
|
61
64
|
- spec/assets/version_outputs/ubuntu-0_10_6
|
62
65
|
- spec/assets/version_outputs/windows-nightly
|
@@ -98,6 +101,9 @@ test_files:
|
|
98
101
|
- spec/assets/version_outputs/osx-1_2_0
|
99
102
|
- spec/assets/version_outputs/osx-2_0
|
100
103
|
- spec/assets/version_outputs/osx-2_0_1
|
104
|
+
- spec/assets/version_outputs/osx-2_1_2
|
105
|
+
- spec/assets/version_outputs/osx-2_1_4
|
106
|
+
- spec/assets/version_outputs/osx-2_2
|
101
107
|
- spec/assets/version_outputs/raspian-0_8_6
|
102
108
|
- spec/assets/version_outputs/ubuntu-0_10_6
|
103
109
|
- spec/assets/version_outputs/windows-nightly
|