video2gif 0.0.17 → 0.0.18

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: 9dea97a401b3e47b30ffc508fb4dfa7c3f93059b92e1e2fb63331c8487fd1315
4
- data.tar.gz: 645a56bf651cff478b033ca2dd710f2b1102dbdfe1bfce4d5a4a5e49a5ec8662
3
+ metadata.gz: 201a683929c71a4f1f0857fc4b0316762742695d78986682dfef5ac547fcac8a
4
+ data.tar.gz: fbd96ac1341097ef254ce3ea85512d1f3c7b856d6bbadf20938ae315fd639a6f
5
5
  SHA512:
6
- metadata.gz: 77a15fe135ba84c88447ed29fec18a32ca61a3bbc69d729b9a8725015a303c49990df42d13f913c24ca9452dedfc7f118197fb494a2778a259391419ac5ebd61
7
- data.tar.gz: c784127c03e71ede62f83c393cad597447c0a97738da684cd5deb1aca2c4f48fde11f2c05c3dd61b148a17c9925768f13f3f9b10ea4c7cd9fe628535eed350d9
6
+ metadata.gz: 33d191ea91ae9ab24e9248b5e3701e05dd8b3f194da3d4b66bddce6518e622866f65e06271dcab6b6ac7051af40abd30cfd132022e7a3c394ec71e4eaa09f486
7
+ data.tar.gz: c05bfff2d92dd4ce23d6240469aa4d0db718a86f27f0810b47a91ce05c8ed0d1e16d57cb96bc34fb30ffa9cc21599e791d0c54f902d986b1026562ca6a75d4f9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- video2gif (0.0.17)
4
+ video2gif (0.0.18)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -28,18 +28,17 @@ module Video2gif
28
28
  ].join(':')
29
29
  end
30
30
 
31
- # If we're not attempting to convert HDR to SDR, the standard
32
- # 'scale' filter is preferred (if we're resizing at all). Scale
33
- # here before other filters to avoid unnecessary processing.
34
- if options[:width] && !options[:tonemap]
35
- filtergraph << "scale=flags=lanczos:sws_dither=none:width=#{options[:width]}:height=-1"
36
- end
37
-
38
- # If we're attempting to convert HDR to SDR, use a set of 'zscale'
39
- # filters, 'format' filters, and the 'tonemap' filter. The
40
- # 'zscale' will do the resize for us as well.
31
+ # Scale here before other filters to avoid unnecessary processing.
41
32
  if options[:tonemap]
42
- filtergraph << "zscale=dither=none:filter=lanczos:width=#{options[:width]}:height=-1" if options[:width]
33
+ # If we're attempting to convert HDR to SDR, use a set of
34
+ # 'zscale' filters, 'format' filters, and the 'tonemap' filter.
35
+ # The 'zscale' will do the resize for us as well.
36
+ filtergraph << 'zscale=' + %W[
37
+ dither=none
38
+ filter=lanczos
39
+ width=#{options[:width]}
40
+ height=trunc(#{options[:width]}/dar)
41
+ ] if options[:width]
43
42
  filtergraph << 'zscale=transfer=linear:npl=100'
44
43
  filtergraph << 'zscale=npl=100'
45
44
  filtergraph << 'format=gbrpf32le'
@@ -47,6 +46,15 @@ module Video2gif
47
46
  filtergraph << "tonemap=tonemap=#{options[:tonemap]}:desat=0"
48
47
  filtergraph << 'zscale=transfer=bt709:matrix=bt709:range=tv'
49
48
  filtergraph << 'format=yuv420p'
49
+ else
50
+ # If we're not attempting to convert HDR to SDR, the standard
51
+ # 'scale' filter is preferred (if we're resizing at all).
52
+ filtergraph << 'scale=' + %W[
53
+ flags=lanczos
54
+ sws_dither=none
55
+ width=#{options[:width]}
56
+ height=trunc(#{options[:width]}/dar
57
+ ].join(':') if options[:width] && !options[:tonemap]
50
58
  end
51
59
 
52
60
  # Perform any desired equalization before we overlay text so that
@@ -71,14 +79,14 @@ module Video2gif
71
79
  .gsub(/\B"\b([^"\u201C\u201D\u201E\u201F\u2033\u2036\r\n]+)\b?"\B/, "\u201C\\1\u201D")
72
80
  .gsub(/\B'\b([^'\u2018\u2019\u201A\u201B\u2032\u2035\r\n]+)\b?'\B/, "\u2018\\1\u2019")
73
81
 
74
- filtergraph << 'drawtext=' + [
75
- "x='#{ options[:xpos] || '(main_w/2-text_w/2)' }'",
76
- "y='#{ options[:ypos] || "(main_h-line_h*1.5*#{count_of_lines})" }'",
77
- "fontsize='#{ options[:textsize] || 32 }'",
78
- "fontcolor='#{ options[:textcolor] || 'white' }'",
79
- "borderw='#{ options[:textborder] || 3 }'",
80
- "fontfile='#{ options[:textfont] || 'Arial'}'\\\\:style='#{options[:textvariant] || 'Bold' }'",
81
- "text='#{text}'",
82
+ filtergraph << 'drawtext=' + %W[
83
+ x='#{ options[:xpos] || '(main_w/2-text_w/2)' }'
84
+ y='#{ options[:ypos] || "(main_h-line_h*1.5*#{count_of_lines})" }'
85
+ fontsize='#{ options[:textsize] || 32 }'
86
+ fontcolor='#{ options[:textcolor] || 'white' }'
87
+ borderw='#{ options[:textborder] || 3 }'
88
+ fontfile='#{ options[:textfont] || 'Arial'}'\\\\:style='#{options[:textvariant] || 'Bold' }'
89
+ text='#{text}'
82
90
  ].join(':')
83
91
  end
84
92
 
@@ -101,7 +109,8 @@ module Video2gif
101
109
 
102
110
  def self.ffmpeg_command(options, executable: 'ffmpeg')
103
111
  command = [executable]
104
- command << '-y' # always overwrite
112
+ command << '-y'
113
+ command << '-hide_banner'
105
114
  command << '-analyzeduration' << '2147483647' << '-probesize' << '2147483647'
106
115
  command << '-loglevel' << 'verbose'
107
116
  command << '-ss' << options[:seek] if options[:seek]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Video2gif
4
- VERSION = '0.0.17'
4
+ VERSION = '0.0.18'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video2gif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily St.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-26 00:00:00.000000000 Z
11
+ date: 2019-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler