evideo 0.1.7 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8606bfbd9f0c7ba938bec7202751ad943b1ca67ee35099165d129d49a2897b0c
4
- data.tar.gz: e960f31a33ebed6c26d1295ecaa9c595c846242d335a157db0766d40b3b69155
3
+ metadata.gz: '0790e2e3d70d9a24e7dd68fd3de6910b2f76acbb08340b381bc1384bc41ea1a7'
4
+ data.tar.gz: f2fdd13f9fd3766c4139fc19a17eb494c0d82b3362231a47bfa087506351d7d6
5
5
  SHA512:
6
- metadata.gz: 37f629b884f5ba6872a4f28e274caa7e4dcc4dc06828b2a43cf7933d7d6b571a2eda2cbd30fb5e68795559932f32606efb5bd5413526cd219a75e21af4e4ccca
7
- data.tar.gz: 395e200817a3af2045535861d598bce990f654f2e730e271d6a7aeb52049a13ed87abfcdc98ee1a2aceffed32a79ff4107a5159cb0a78d4376241c3be97aab2a
6
+ metadata.gz: a6600bc14a3b436d3de37b4a393f1c8e23e64381add067c80d0033fc7d511b08362ac5b94d06b140c5f3047602b520fed5df0332bf05e4025a3b34e01c0c10a9
7
+ data.tar.gz: 25353d139bcf0b2c14b84716b52d7fa64442f91c53a51640963828e1a68ce9d1dd8ff8549c0cb17e6d22224d745fab9a2aba86143e5861373116a6521648e665
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- evideo (0.1.7)
4
+ evideo (0.2.0)
5
5
  thor (~> 0.1)
6
6
 
7
7
  GEM
data/lib/evideo.rb CHANGED
@@ -15,9 +15,9 @@ module Evideo
15
15
  desc: 'Onde procurar videos'
16
16
  class_option :i, banner: 'IN', default: 'ftv',
17
17
  desc: 'Pasta origem'
18
+ class_option :o, banner: 'OUT', default: 'out',
19
+ desc: 'Pasta destino'
18
20
  desc 'conv', 'converte videos'
19
- option :o, banner: 'OUT', default: 'out',
20
- desc: 'Pasta destino'
21
21
  option :t, type: :boolean, default: false,
22
22
  desc: 'Processa somente segundos para teste'
23
23
  # Processa videos
@@ -31,7 +31,7 @@ module Evideo
31
31
  # Analisa videos
32
32
  def test
33
33
  Dir.glob("#{fin}/*.???").sort.each do |f|
34
- HRVideo.new(f).testa(options)
34
+ HRVideo.new(f).testa(options, fout)
35
35
  end
36
36
  end
37
37
  default_task :conv
@@ -14,13 +14,14 @@ module Evideo
14
14
 
15
15
  # Testa validade video original
16
16
  #
17
+ # @param [String] aot pasta destino dos videos absoluta
17
18
  # @return [true, false] sim ou nao video esta ok
18
- def ofok?
19
+ def ofok?(aot)
19
20
  return false unless (bitrate < 3000 && ext == '.mp4') ||
20
21
  Time.parse(duration) < Time.parse('00:01:00')
21
22
  return false unless ratio == '16:9' && height > 480
22
23
 
23
- puts "rm \"#{video}\" # #{show}"
24
+ puts "mv \"#{video} #{aot}/#{base}.mp4\" # #{show}"
24
25
  true
25
26
  end
26
27
 
@@ -40,12 +41,12 @@ module Evideo
40
41
  # Testa validade videos processados em todos locais contra video original
41
42
  #
42
43
  # @param [Array<String>] ary array locais onde procurar videos
43
- # @param [String] out pasta destino dos videos
44
+ # @param [String] pot pasta destino dos videos
44
45
  # @return [true, false] sim ou nao <local>/<video> esta ok
45
- def vdok?(ary, out)
46
+ def vdok?(ary, pot)
46
47
  if ary.empty? then false
47
- elsif vfok?(HRVideo.new("#{ary.first}/#{out}/#{base}.mp4")) then true
48
- else vdok?(ary.drop(1), out)
48
+ elsif vfok?(HRVideo.new("#{ary.first}/#{pot}/#{base}.mp4")) then true
49
+ else vdok?(ary.drop(1), pot)
49
50
  end
50
51
  end
51
52
 
@@ -99,12 +100,12 @@ module Evideo
99
100
  # @option opcoes [<String>] :i pasta origem dos videos
100
101
  # @option opcoes [<String>] :o pasta destino dos videos
101
102
  # @option opcoes [<Boolean>] :t processa somente segundos para teste
102
- # @param [String] out pasta destino dos videos absoluta
103
- def processa(opcoes, out)
104
- return if ofok? || vdok?(opcoes[:d], opcoes[:o])
103
+ # @param [String] aot pasta destino dos videos absoluta
104
+ def processa(opcoes, aot)
105
+ return if ofok?(aot) || vdok?(opcoes[:d], opcoes[:o])
105
106
 
106
- system mpeg(opcoes[:t] ? ' -t 20' : '') + " #{out}/#{base}.mp4"
107
- vfok?(HRVideo.new("#{out}/#{base}.mp4"))
107
+ system mpeg(opcoes[:t] ? ' -t 20' : '') + " #{aot}/#{base}.mp4"
108
+ vfok?(HRVideo.new("#{aot}/#{base}.mp4"))
108
109
  end
109
110
 
110
111
  # Testa videos
@@ -114,8 +115,9 @@ module Evideo
114
115
  # @option opcoes [<String>] :i pasta origem dos videos
115
116
  # @option opcoes [<String>] :o pasta destino dos videos
116
117
  # @option opcoes [<Boolean>] :t processa somente segundos para teste
117
- def testa(opcoes)
118
- return if ofok? || vdok?(opcoes[:d], opcoes[:o])
118
+ # @param [String] aot pasta destino dos videos absoluta
119
+ def testa(opcoes, aot)
120
+ return if ofok?(aot) || vdok?(opcoes[:d], opcoes[:o])
119
121
 
120
122
  puts "ls \"#{video}\" # #{show}"
121
123
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Evideo
4
- VERSION = '0.1.7'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evideo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hernâni Rodrigues Vaz