libis-format 2.0.4 → 2.0.5

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
  SHA256:
3
- metadata.gz: 43d209bde1a85973e528730bb3ec4c9cffc58db02f916936fa2144d4e91b81f7
4
- data.tar.gz: 04315d80c7e20b6302f9d6d10906f4ec7d5b6046a47902fbeff95ec97bf7732a
3
+ metadata.gz: 7cad4173d3e5cc43e573f612cc3f345ef91f5eb8938bb0d457681514d281a531
4
+ data.tar.gz: 77e84828a1269bb9ddd153362a8af2221153494542f328b73785d014740e07e1
5
5
  SHA512:
6
- metadata.gz: d581e3ac51fc290ba57e27d2bf6bfe5dcfa8f269a8dbdfa656954bff2af7efd8d963177ec1cb309db481bd7b84603df20e8b34bb1800f7c88d93e91e31722532
7
- data.tar.gz: 867208ce1766cb4bdec0efc648c7b5a1e1dd9883ffd5818f82324ea3a783b21e50cb81fafdbc04bad1c1da75adb75503c63d9be3936baeeac436a5a92ac9a791
6
+ metadata.gz: 1cc76923e13c732a606af376614b9d2dd716e7ff851a77645bc8fd979ee7d7c6e98c5bd9936ea506f68009c1aba71b94be98a558e7b4167e53011d966a099c2e
7
+ data.tar.gz: 29c46dc0a855ff168d2160cd9934e6a710d98e1ddea3b06ae47413248f3d1ddc288bbf376a89a85505ca10cba6d3b3b1d80b4f50f8a1545389b9671f9a0fa46d
@@ -128,12 +128,12 @@ module Libis
128
128
  opts[:output] << '-map_metadata:g' << '0:g' # Copy global metadata
129
129
  opts[:output] << '-map_metadata:s:a' << '0:s:a' # Copy audio metadata
130
130
  opts[:input] << '-accurate_seek' << (@options[:start].to_i < 0 ? '-sseof' : '-ss') << @options[:start] if @options[:start]
131
- opts[:input] << '-t' << @options[:duration] if @options[:duration]
132
- opts[:output] << '-q:a' << @options[:quality] if @options[:quality]
133
- opts[:output] << '-b:a' << @options[:bit_rate] if @options[:bit_rate]
134
- opts[:output] << '-ar' << @options[:sampling_freq] if @options[:sampling_freq]
135
- opts[:output] << '-ac' << @options[:channels] if @options[:channels]
136
- opts[:output] << '-f' << @options[:format] if @options[:format]
131
+ opts[:input] << '-t' << @options[:duration].to_s if @options[:duration]
132
+ opts[:output] << '-q:a' << @options[:quality].to_s if @options[:quality]
133
+ opts[:output] << '-b:a' << @options[:bit_rate].to_s if @options[:bit_rate]
134
+ opts[:output] << '-ar' << @options[:sampling_freq].to_s if @options[:sampling_freq]
135
+ opts[:output] << '-ac' << @options[:channels].to_s if @options[:channels]
136
+ opts[:output] << '-f' << @options[:format].to_s if @options[:format]
137
137
  result = Libis::Format::Tool::FFMpeg.run(source, target, opts)
138
138
  info "FFMpeg output: #{result}"
139
139
  result
@@ -130,7 +130,7 @@ module Libis
130
130
  colorspace = @options.delete(:colorspace) || 'sRGB'
131
131
  unless @options.empty?
132
132
  convert.colorspace('RGB')
133
- @options.each {|o, v| convert.send(o, v)}
133
+ @options.each {|o, v| convert.send(o, v.to_s)}
134
134
  end
135
135
  convert.colorspace(colorspace)
136
136
  convert.profile @profile if @profile
@@ -51,11 +51,13 @@ module Libis
51
51
  @options[:progression_order] = value
52
52
  end
53
53
 
54
- def tile_size(width = 1024, height = 1024)
54
+ def tile_size(width = 1024, height = nil)
55
+ height ||= width
55
56
  @options[:tile_size] = [width, height]
56
57
  end
57
58
 
58
- def codeblock_size(height = 6, width = 6)
59
+ def codeblock_size(width = 6, height = nil)
60
+ height ||= width
59
61
  @options[:codeblock_size] = [height, width]
60
62
  end
61
63
 
@@ -63,7 +63,7 @@ module Libis
63
63
  if v.nil?
64
64
  nil
65
65
  else
66
- ["--#{k}", v]
66
+ ["--#{k}", v.to_s]
67
67
  end}.compact.flatten
68
68
  )
69
69
  unless result[:err].empty?
@@ -103,7 +103,7 @@ module Libis
103
103
  nil
104
104
  else
105
105
  k = OPTIONS_TABLE[k] || k
106
- ["--#{k}", v]
106
+ ["--#{k}", v.to_s]
107
107
  end
108
108
  },
109
109
  @flags.map { |k, v|
@@ -40,9 +40,9 @@ module Libis
40
40
  def ranges(selection)
41
41
  case selection
42
42
  when Array
43
- @options[:ranges] += selection unless selection.empty?
43
+ @options[:ranges] += selection.to_s unless selection.empty?
44
44
  when String
45
- range(selection)
45
+ range([selection])
46
46
  else
47
47
  # nothing
48
48
  end
@@ -52,7 +52,7 @@ module Libis
52
52
  if v.nil?
53
53
  nil
54
54
  else
55
- ["--#{k}", v]
55
+ ["--#{k}", v.to_s]
56
56
  end }.compact.flatten
57
57
  )
58
58
  unless result[:err].empty?
@@ -51,7 +51,7 @@ module Libis
51
51
  if v.nil?
52
52
  nil
53
53
  else
54
- ["--#{k}", v]
54
+ ["--#{k}", v.to_s]
55
55
  end
56
56
  }.compact.flatten
57
57
  )
@@ -56,7 +56,7 @@ module Libis
56
56
  if v.nil?
57
57
  nil
58
58
  else
59
- ["--#{k}", v]
59
+ ["--#{k}", v.to_s]
60
60
  end
61
61
  }.compact.flatten + [@file]
62
62
  )
@@ -73,7 +73,7 @@ module Libis
73
73
  if v.nil?
74
74
  nil
75
75
  else
76
- ["--#{k}", v]
76
+ ["--#{k}", v.to_s]
77
77
  end
78
78
  }.compact.flatten + @text
79
79
  )
@@ -31,7 +31,7 @@ module Libis
31
31
  end
32
32
 
33
33
  def audio_channels(value)
34
- @options[:audio_channels] = value.to_s
34
+ @options[:audio_channels] = value
35
35
  end
36
36
 
37
37
  def audio_codec(codec)
@@ -43,39 +43,39 @@ module Libis
43
43
  end
44
44
 
45
45
  def start(seconds)
46
- @options[:start] = seconds.to_s
46
+ @options[:start] = seconds
47
47
  end
48
48
 
49
49
  def duration(seconds)
50
- @options[:duration] = seconds.to_s
50
+ @options[:duration] = seconds
51
51
  end
52
52
 
53
53
  def audio_quality(value)
54
- @options[:audio_quality] = value.to_s
54
+ @options[:audio_quality] = value
55
55
  end
56
56
 
57
57
  def video_quality(value)
58
- @options[:video_quality] = value.to_s
58
+ @options[:video_quality] = value
59
59
  end
60
60
 
61
61
  def audio_bitrate(value)
62
- @options[:audio_bitrate] = value.to_s
62
+ @options[:audio_bitrate] = value
63
63
  end
64
64
 
65
65
  def video_bitrate(value)
66
- @options[:video_bitrate] = value.to_s
66
+ @options[:video_bitrate] = value
67
67
  end
68
68
 
69
69
  def constant_rate_factor(value)
70
- @options[:crf] = value.to_s
70
+ @options[:crf] = value
71
71
  end
72
72
 
73
73
  def frame_rate(value)
74
- @options[:frame_rate] = value.to_s
74
+ @options[:frame_rate] = value
75
75
  end
76
76
 
77
77
  def sampling_freq(value)
78
- @options[:sampling_freq] = value.to_s
78
+ @options[:sampling_freq] = value
79
79
  end
80
80
 
81
81
  def scale(width_x_height)
@@ -239,21 +239,21 @@ module Libis
239
239
  ] if @options[:watermark_text_shadow_offset] > 0
240
240
  opts[:filter] << '-vf' << filter_text
241
241
  end
242
- opts[:output] << '-ac' << @options[:audio_channels] if @options[:audio_channels]
243
- opts[:output] << '-c:a' << @options[:audio_codec] if @options[:audio_codec]
244
- opts[:output] << '-c:v' << @options[:video_codec] if @options[:video_codec]
245
- opts[:output] << '-b:a' << @options[:audio_bitrate] if @options[:audio_bitrate]
246
- opts[:output] << '-b:v' << @options[:video_bitrate] if @options[:video_bitrate]
247
- opts[:output] << '-crf' << @options[:crf] if @options[:crf]
242
+ opts[:output] << '-ac' << @options[:audio_channels].to_s if @options[:audio_channels]
243
+ opts[:output] << '-c:a' << @options[:audio_codec].to_s if @options[:audio_codec]
244
+ opts[:output] << '-c:v' << @options[:video_codec].to_s if @options[:video_codec]
245
+ opts[:output] << '-b:a' << @options[:audio_bitrate].to_s if @options[:audio_bitrate]
246
+ opts[:output] << '-b:v' << @options[:video_bitrate].to_s if @options[:video_bitrate]
247
+ opts[:output] << '-crf' << @options[:crf].to_s if @options[:crf]
248
248
  opts[:output] << '-map_metadata:g' << '0:g' # Copy global metadata
249
249
  opts[:output] << '-map_metadata:s:a' << '0:s:a' # Copy audio metadata
250
250
  opts[:output] << '-map_metadata:s:v' << '0:s:v' # Copy video metadata
251
- opts[:input] << '-accurate_seek' << (@options[:start].to_i < 0 ? '-sseof' : '-ss') << @options[:start] if @options[:start]
252
- opts[:input] << '-t' << @options[:duration] if @options[:duration]
253
- opts[:output] << '-qscale' << @options[:video_quality] if @options[:video_quality]
254
- opts[:output] << '-q:a' << @options[:audio_quality] if @options[:audio_quality]
255
- opts[:output] << '-r' << @options[:frame_rate] if @options[:frame_rate]
256
- opts[:output] << '-ar' << @options[:sampling_freq] if @options[:sampling_freq]
251
+ opts[:input] << '-accurate_seek' << (@options[:start].to_i < 0 ? '-sseof' : '-ss') << @options[:start].to_s if @options[:start]
252
+ opts[:input] << '-t' << @options[:duration].to_s if @options[:duration]
253
+ opts[:output] << '-qscale' << @options[:video_quality].to_s if @options[:video_quality]
254
+ opts[:output] << '-q:a' << @options[:audio_quality].to_s if @options[:audio_quality]
255
+ opts[:output] << '-r' << @options[:frame_rate].to_s if @options[:frame_rate]
256
+ opts[:output] << '-ar' << @options[:sampling_freq].to_s if @options[:sampling_freq]
257
257
  if @options[:scale]
258
258
  scale = @options[:scale].split('x')
259
259
  width = scale[0]
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Format
3
- VERSION = '2.0.4'
3
+ VERSION = '2.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-format
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-04 00:00:00.000000000 Z
11
+ date: 2021-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake