evideo 0.3.4 → 0.3.6

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: 9f8ae06d07be97ed6d678bc47439e0d4f631243351eb2286f3d847b6f5634b16
4
- data.tar.gz: 57e79d419857ea67ca2b2da1739f38c81045d6e693290cff148be8316012cc9e
3
+ metadata.gz: 36e891ca32f3aa809c13abd6ef45c200ac65b28abbbe0e0369cd26f5e31ff48c
4
+ data.tar.gz: 1a36a2c861c1ba15c397cf21e355a49fc10cea65ac13d64679a4972f18cba24b
5
5
  SHA512:
6
- metadata.gz: 866eedd399b2b0cb7f8b4fcbad71127442ab960175c957b5054cb27371ddddb24c300156016a8a88c420940ce262ef05aa1583e5b09b246218ec5eff113b009c
7
- data.tar.gz: 8f9f3d2a38a0be9a725704e71412c4eab6a15d6c4cc5d4003f767faa5e905599fcdc61098b21385bd779d66ca6fe21c96c1976edd7c664db0fd4a1cd927f20f5
6
+ metadata.gz: a3528940afdc0a345bcfd631199af27c6d282ce10e8ea897bfcf6b1d3eae214ece4780be95209675bc07763e020d5dd488ccc57dacbe46d9b8c08c7d6d88e4e0
7
+ data.tar.gz: 11be49102db078279c1634bca348c0c45c8506ceaec03872154a53e851c3d6d2c58b4ea9d0127c557dba496c2f69fd7dd2043b179436c79f27a4e45deadeef09
data/.reek.yml ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ detectors:
3
+ TooManyStatements:
4
+ exclude:
5
+ - initialize
6
+ max_statements: 10
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- evideo (0.3.4)
4
+ evideo (0.3.6)
5
5
  thor
6
6
 
7
7
  GEM
@@ -12,7 +12,7 @@ GEM
12
12
  benchmark (0.4.0)
13
13
  bigdecimal (3.1.9)
14
14
  concurrent-ruby (1.3.5)
15
- diff-lcs (1.6.0)
15
+ diff-lcs (1.6.2)
16
16
  dry-configurable (1.3.0)
17
17
  dry-core (~> 1.1)
18
18
  zeitwerk (~> 2.6)
@@ -27,13 +27,13 @@ GEM
27
27
  concurrent-ruby (~> 1.0)
28
28
  dry-core (~> 1.1)
29
29
  zeitwerk (~> 2.6)
30
- dry-schema (1.13.4)
30
+ dry-schema (1.14.1)
31
31
  concurrent-ruby (~> 1.0)
32
32
  dry-configurable (~> 1.0, >= 1.0.1)
33
- dry-core (~> 1.0, < 2)
34
- dry-initializer (~> 3.0)
35
- dry-logic (>= 1.4, < 2)
36
- dry-types (>= 1.7, < 2)
33
+ dry-core (~> 1.1)
34
+ dry-initializer (~> 3.2)
35
+ dry-logic (~> 1.5)
36
+ dry-types (~> 1.8)
37
37
  zeitwerk (~> 2.6)
38
38
  dry-types (1.8.2)
39
39
  bigdecimal (~> 3.0)
@@ -42,30 +42,31 @@ GEM
42
42
  dry-inflector (~> 1.0)
43
43
  dry-logic (~> 1.4)
44
44
  zeitwerk (~> 2.6)
45
- jaro_winkler (1.6.0)
46
- json (2.10.2)
45
+ jaro_winkler (1.6.1)
46
+ json (2.12.2)
47
47
  kramdown (2.5.1)
48
48
  rexml (>= 3.3.9)
49
49
  kramdown-parser-gfm (1.1.0)
50
50
  kramdown (~> 2.0)
51
- language_server-protocol (3.17.0.4)
51
+ language_server-protocol (3.17.0.5)
52
52
  lint_roller (1.1.0)
53
- logger (1.6.6)
54
- nokogiri (1.18.5-x86_64-linux-gnu)
53
+ logger (1.7.0)
54
+ nokogiri (1.18.8-x86_64-linux-gnu)
55
55
  racc (~> 1.4)
56
56
  observer (0.1.2)
57
57
  ostruct (0.6.1)
58
- parallel (1.26.3)
59
- parser (3.3.7.2)
58
+ parallel (1.27.0)
59
+ parser (3.3.8.0)
60
60
  ast (~> 2.4.1)
61
61
  racc
62
+ prism (1.4.0)
62
63
  racc (1.8.1)
63
64
  rainbow (3.1.1)
64
65
  rake (13.2.1)
65
- rbs (3.9.0)
66
+ rbs (3.9.4)
66
67
  logger
67
- reek (6.4.0)
68
- dry-schema (~> 1.13.0)
68
+ reek (6.5.0)
69
+ dry-schema (~> 1.13)
69
70
  logger (~> 1.6)
70
71
  parser (~> 3.3.0)
71
72
  rainbow (>= 2.0, < 4.0)
@@ -74,7 +75,7 @@ GEM
74
75
  reverse_markdown (3.0.0)
75
76
  nokogiri
76
77
  rexml (3.4.1)
77
- rubocop (1.74.0)
78
+ rubocop (1.75.7)
78
79
  json (~> 2.3)
79
80
  language_server-protocol (~> 3.17.0.2)
80
81
  lint_roller (~> 1.1.0)
@@ -82,29 +83,30 @@ GEM
82
83
  parser (>= 3.3.0.2)
83
84
  rainbow (>= 2.2.2, < 4.0)
84
85
  regexp_parser (>= 2.9.3, < 3.0)
85
- rubocop-ast (>= 1.38.0, < 2.0)
86
+ rubocop-ast (>= 1.44.0, < 2.0)
86
87
  ruby-progressbar (~> 1.7)
87
88
  unicode-display_width (>= 2.4.0, < 4.0)
88
- rubocop-ast (1.41.0)
89
+ rubocop-ast (1.44.1)
89
90
  parser (>= 3.3.7.2)
91
+ prism (~> 1.4)
90
92
  rubocop-rake (0.7.1)
91
93
  lint_roller (~> 1.1)
92
94
  rubocop (>= 1.72.1)
93
95
  ruby-progressbar (1.13.0)
94
- solargraph (0.52.0)
96
+ solargraph (0.54.5)
95
97
  backport (~> 1.2)
96
- benchmark
98
+ benchmark (~> 0.4)
97
99
  bundler (~> 2.0)
98
100
  diff-lcs (~> 1.4)
99
- jaro_winkler (~> 1.6)
101
+ jaro_winkler (~> 1.6, >= 1.6.1)
100
102
  kramdown (~> 2.3)
101
103
  kramdown-parser-gfm (~> 1.1)
102
104
  logger (~> 1.6)
103
105
  observer (~> 0.1)
104
106
  ostruct (~> 0.6)
105
107
  parser (~> 3.0)
106
- rbs (~> 3.0)
107
- reverse_markdown (>= 2.0, < 4)
108
+ rbs (~> 3.3)
109
+ reverse_markdown (~> 3.0)
108
110
  rubocop (~> 1.38)
109
111
  thor (~> 1.0)
110
112
  tilt (~> 2.0)
@@ -118,7 +120,7 @@ GEM
118
120
  yard (0.9.37)
119
121
  yard-solargraph (0.1.0)
120
122
  yard (~> 0.9)
121
- zeitwerk (2.7.2)
123
+ zeitwerk (2.7.3)
122
124
 
123
125
  PLATFORMS
124
126
  x86_64-linux
@@ -134,4 +136,4 @@ DEPENDENCIES
134
136
  yard
135
137
 
136
138
  BUNDLED WITH
137
- 2.5.3
139
+ 2.6.9
@@ -0,0 +1,169 @@
1
+ # frozen_string_literal: true
2
+
3
+ # (see Evideo)
4
+ module Evideo
5
+ # parametros video :tempo, :bitrate - Duration: 01:01:08.50, start: 0.000000, bitrate: 2228 kb/s
6
+ RE1 = /duration:\s+(\d\d:\d\d:\d\d).*bitrate:\s+(\d+)\s+kb/i
7
+ # parametros video :height, :fps -
8
+ # Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720
9
+ # [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 180k tbc (default)
10
+ RE2 = /stream.*video:.*x\s*(\d+).*\s+(\d+\.*\d*)\s+fps/i
11
+ # parametros video :ratio - display_aspect_ratio=16:9
12
+ RE3 = /display_aspect_ratio\s*=\s*(\d+:\d+)$/i
13
+ # parametros video :audio - Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
14
+ RE4 = /stream.*audio:.*\s+(\d+)\s+hz/i
15
+
16
+ # permite analizar string output do comando sonda video
17
+ class Video
18
+ # @return [String] base ficheiro video
19
+ attr_reader :bas
20
+ # @return [String] extensao ficheiro video
21
+ attr_reader :ext
22
+ # @return [Thor::CoreExt::HashWithIndifferentAccess] opcoes trabalho
23
+ attr_reader :ops
24
+
25
+ # @param [String] ficheiro video a processar
26
+ # @param [Thor::CoreExt::HashWithIndifferentAccess] opcoes trabalho
27
+ # @option opcoes [Array<String>] :d (/home/eu/lust,/media/eu/hrv2,/media/eu/hrv2/lust) pastas onde procurar videos
28
+ # @option opcoes [String] :i (ftv) pasta inicial dos videos
29
+ # @option opcoes [String] :o (out) pasta final dos videos
30
+ # @option opcoes [Boolean] :s (false) 10 segundos cortados no inicio do video final
31
+ # @option opcoes [Integer] :t (0) segundos duracao video final 0=sem cortes
32
+ # @return [Video] videos processados para arquivo uniformizado
33
+ def initialize(ficheiro, opcoes)
34
+ @ext = File.extname(ficheiro)
35
+ @bas = File.basename(ficheiro, ext)
36
+ @ops = opcoes
37
+ @iopcao = {}
38
+ end
39
+
40
+ # @return [String] texto probe do video inicial
41
+ def iprobe
42
+ @iprobe ||= `#{cmd_prob(inome)}`
43
+ end
44
+
45
+ # @return [Array<String>] parametros video inicial [:tempo, :bitrate]
46
+ def i1scan
47
+ @i1scan ||= iprobe.scan(RE1).flatten
48
+ end
49
+
50
+ # @return [Array<String>] parametros video inicial [:height, :fps]
51
+ def i2scan
52
+ @i2scan ||= iprobe.scan(RE2).flatten
53
+ end
54
+
55
+ # @return [String] parametro video inicial :tempo hh:mm:ss
56
+ def itempo
57
+ @iopcao[:tempo] ||= i1scan[0] || '00:00:00'
58
+ end
59
+
60
+ # @return [Integer] parametro video inicial :bitrate kb/s
61
+ def ibitrate
62
+ @iopcao[:bitrate] ||= Integer(i1scan[1] || 0)
63
+ end
64
+
65
+ # @return [Integer] parametro video inicial :height
66
+ def iheight
67
+ @iopcao[:height] ||= Integer(i2scan[0] || 0)
68
+ end
69
+
70
+ # @return [Float] parametro video inicial :fps frame_rate
71
+ def ifps
72
+ @iopcao[:fps] ||= Float(i2scan[1] || 0)
73
+ end
74
+
75
+ # @return [String] parametro video inicial aspect :ratio 16:9
76
+ def iratio
77
+ @iopcao[:ratio] ||= iprobe.scan(RE3).flatten[0] || '0:1'
78
+ end
79
+
80
+ # @return [Integer] parametro video inicial :audio Hz
81
+ def iaudio
82
+ @iopcao[:audio] ||= Integer(iprobe.scan(RE4).flatten[0] || 0)
83
+ end
84
+
85
+ # @return [String] ficheiro inicial absoluto
86
+ def inome
87
+ "#{ops[:d][0]}/#{ops[:i]}/#{bas}#{ext}"
88
+ end
89
+
90
+ # @return [String] mostra dados do ficheiro video inicial
91
+ def ishow
92
+ "# r:#{ibitrate} h:#{iheight} #{iratio}"
93
+ end
94
+
95
+ # @return [Time] tempo no ruby standard library com precisao
96
+ def self.to_t(tempo, pre = 8)
97
+ Time.parse(tempo[0, pre])
98
+ end
99
+
100
+ # inicia variaveis do video final
101
+ def oinit
102
+ @oopcao = {}
103
+ @oprobe = nil
104
+ @o1scan = nil
105
+ @o2scan = nil
106
+ end
107
+
108
+ # @return [String] texto probe do video final
109
+ def oprobe
110
+ return '' unless File.exist?(onome)
111
+
112
+ @oprobe ||= `#{cmd_prob(onome)}`
113
+ end
114
+
115
+ # @return [Array<String>] parametros video final [:tempo, :bitrate]
116
+ def o1scan
117
+ @o1scan ||= oprobe.scan(RE1).flatten
118
+ end
119
+
120
+ # @return [Array<String>] parametros video final [:height, :fps]
121
+ def o2scan
122
+ @o2scan ||= oprobe.scan(RE2).flatten
123
+ end
124
+
125
+ # @return [String] parametro video final :tempo hh:mm:ss
126
+ def otempo
127
+ @oopcao[:tempo] ||= o1scan[0] || '00:00:00'
128
+ end
129
+
130
+ # @return [Integer] parametro video final :bitrate kb/s
131
+ def obitrate
132
+ @oopcao[:bitrate] ||= Integer(o1scan[1] || 0)
133
+ end
134
+
135
+ # @return [Integer] parametro video final :height
136
+ def oheight
137
+ @oopcao[:height] ||= Integer(o2scan[0] || 0)
138
+ end
139
+
140
+ # @return [Float] parametro video final :fps frame_rate
141
+ def ofps
142
+ @oopcao[:fps] ||= Float(o2scan[1] || 0)
143
+ end
144
+
145
+ # @return [String] parametro video final aspect :ratio 16:9
146
+ def oratio
147
+ @oopcao[:ratio] ||= oprobe.scan(RE3).flatten[0] || '0:1'
148
+ end
149
+
150
+ # @return [Integer] posicao array pastas onde procurar videos finais
151
+ def pos
152
+ # -1 #{ops[:d][0]}/#{ops[:i]}/#{ops[:o]}"
153
+ # 0 #{ops[:d][pos]}/#{ops[:o]}"
154
+ # 1 #{ops[:d][pos]}/#{ops[:o]}"
155
+ @pos ||= -1
156
+ end
157
+
158
+ # @return [String] video final absoluto
159
+ def onome
160
+ dir = ops[:d]
161
+ (pos == -1 ? "#{dir[0]}/#{ops[:i]}" : dir[pos]) + "/#{ops[:o]}/#{bas.downcase}.mp4"
162
+ end
163
+
164
+ # @return [String] mostra dados do ficheiro video final
165
+ def oshow
166
+ "# r:#{obitrate} h:#{oheight} #{oratio} #{ops[:d][pos]}/#{ops[:o]}"
167
+ end
168
+ end
169
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # analizar/processar videos para arquivo uniformizado
4
4
  module Evideo
5
- VERSION = '0.3.4'
5
+ VERSION = "0.3.6"
6
6
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evideo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hernâni Rodrigues Vaz
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-03-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -133,6 +132,7 @@ extensions: []
133
132
  extra_rdoc_files: []
134
133
  files:
135
134
  - ".gitignore"
135
+ - ".reek.yml"
136
136
  - ".rubocop.yml"
137
137
  - ".travis.yml"
138
138
  - Gemfile
@@ -147,6 +147,7 @@ files:
147
147
  - exe/evideo
148
148
  - lib/evideo.rb
149
149
  - lib/evideo/processa.rb
150
+ - lib/evideo/vars.rb
150
151
  - lib/evideo/version.rb
151
152
  homepage: https://github.com/hernanilr/evideo
152
153
  licenses:
@@ -154,7 +155,6 @@ licenses:
154
155
  metadata:
155
156
  homepage_uri: https://github.com/hernanilr/evideo
156
157
  yard.run: yard
157
- post_install_message:
158
158
  rdoc_options: []
159
159
  require_paths:
160
160
  - lib
@@ -169,8 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  - !ruby/object:Gem::Version
170
170
  version: '0'
171
171
  requirements: []
172
- rubygems_version: 3.4.20
173
- signing_key:
172
+ rubygems_version: 3.6.9
174
173
  specification_version: 4
175
174
  summary: Processa ficheiros video.
176
175
  test_files: []