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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4554b0f1dc3d2b14f6bc4b4870ad09b0c2cac225
4
- data.tar.gz: 566ae2b58f2cea61d64f9281c20e60decee55182
3
+ metadata.gz: 8d0cb65953c7ade46986b3f4293fa629dfe7ff4f
4
+ data.tar.gz: e038bf43ca37acea1da8464de77742a5e8c9f8d0
5
5
  SHA512:
6
- metadata.gz: 8558bd201772e57a3b60871dbfdc769f0e0619f657691d32057e74d6db1a67171c89d2322ee0c18204d14e33494255d5b8b3a3b82aaedd7cbeef19922f848211
7
- data.tar.gz: 3d069c67bdc1796697dc954a50a04d91524a9b1ca157e6f8ab2be3de206fd57724d672265535b262c17a66ac15671e198bd5810cb5f74926b286c6079b4c6345
6
+ metadata.gz: ad0cc91c2e38d27fb2d1bd29dce7b7080e5378420aee943eefa2ccbe74f4cf802f8860da3a5f6b6db22c018684a310e01a29f3a616785576db88c774ff586b6a
7
+ data.tar.gz: 681263a9f592944a57fbe43d7ec215c3e5426d168d7f89488128219f227aab8de7a85ef372bf7c74dd2538c91be76d6027861592bba7589e549b47eecc9806ca
@@ -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
- v = $1.to_s
106
- size = v.match(/\d{3,5}x\d{3,5}/).to_s
107
- meta[:size] = size unless size.empty?
108
- meta[:aspect] = size.split('x').first.to_f / size.split('x').last.to_f if meta[:size]
109
- end
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
- meta unless meta.empty?
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
@@ -1,3 +1,3 @@
1
1
  module Av
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: av
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Omar Abdel-Wahab