av 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/av/commands/base.rb +14 -6
- data/lib/av/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d0cb65953c7ade46986b3f4293fa629dfe7ff4f
|
4
|
+
data.tar.gz: e038bf43ca37acea1da8464de77742a5e8c9f8d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad0cc91c2e38d27fb2d1bd29dce7b7080e5378420aee943eefa2ccbe74f4cf802f8860da3a5f6b6db22c018684a310e01a29f3a616785576db88c774ff586b6a
|
7
|
+
data.tar.gz: 681263a9f592944a57fbe43d7ec215c3e5426d168d7f89488128219f227aab8de7a85ef372bf7c74dd2538c91be76d6027861592bba7589e549b47eecc9806ca
|
data/lib/av/commands/base.rb
CHANGED
@@ -102,11 +102,14 @@ module Av
|
|
102
102
|
# Matching lines like:
|
103
103
|
# Video: h264, yuvj420p, 640x480 [PAR 72:72 DAR 4:3], 10301 kb/s, 30 fps, 30 tbr, 600 tbn, 600 tbc
|
104
104
|
if line =~ /Video:(.*)/
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
105
|
+
size = $1.to_s.match(/\d{3,5}x\d{3,5}/).to_s
|
106
|
+
meta[:size] = size unless size.empty?
|
107
|
+
meta[:aspect] = size.split('x').first.to_f / size.split('x').last.to_f if meta[:size]
|
108
|
+
end
|
109
|
+
# Matching Stream #0.0: Audio: libspeex, 8000 Hz, mono, s16
|
110
|
+
if line =~ /Audio:(.*)/
|
111
|
+
meta[:audio_encode], meta[:audio_bitrate], meta[:audio_channels] = $1.to_s.split(',').map(&:strip)
|
112
|
+
end
|
110
113
|
# Matching Duration: 00:01:31.66, start: 0.000000, bitrate: 10404 kb/s
|
111
114
|
if line =~ /Duration:(\s.?(\d*):(\d*):(\d*\.\d*))/
|
112
115
|
meta[:length] = $2.to_s + ":" + $3.to_s + ":" + $4.to_s
|
@@ -115,7 +118,12 @@ module Av
|
|
115
118
|
meta[:rotate] = $1.to_i
|
116
119
|
end
|
117
120
|
end
|
118
|
-
|
121
|
+
if meta.empty?
|
122
|
+
::Av.log "Empty metadata from #{path}. Got the following output: #{out}"
|
123
|
+
else
|
124
|
+
return meta
|
125
|
+
end
|
126
|
+
nil
|
119
127
|
end
|
120
128
|
|
121
129
|
def output_format format
|
data/lib/av/version.rb
CHANGED