video2gif 0.0.30 → 0.0.31

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: 4e3d8fc9f7c1f1753c1aeb09c6760650055182e1b5d2f68d29d1453b14c6a63d
4
- data.tar.gz: 9525b0c28289532b777d89b6443fa9873d2ab8c94d3bd01ebcc37c27628a3b33
3
+ metadata.gz: 2bb6223bd87603ba92ca6bcb93c3a01b60b4d9c40e0b9389fd47913cf618a6ae
4
+ data.tar.gz: cdb5efabe21d6ffd7fd2d90d3c7fcfe32946241a70ee6ec9b0122456d56678ef
5
5
  SHA512:
6
- metadata.gz: bc904a92ac20deb0bbc643c2cf9fe6919fbbbb9977e78dc08fc12e824acc61e25938ba6160527fd70ecff232d556b2b617f63a84ca61269fea5d3b3404cc000f
7
- data.tar.gz: 510759bd40cdec24eb975b68ea48e942806fc54de7c52b3ab11e67f69e6294b506ff8f5270e1b667b79d6992457b9761802615c00f40b0b68aebe86a8a5b313d
6
+ metadata.gz: 71eea53100d93c48dfee4e5fe633fd4a322750c0bf078f3ee1c593c9657ef4911956537a8c74be5dbe31a94d0314fa4168035ea6352271287c61f3839d9a28ce
7
+ data.tar.gz: 793cb47a931b5326deef087f599fc6d2d00eafdfe74cb5ee4e1c485ee208745d9cb4de69936b5b662caa6f881a64e0864d426f54612533a6dbfddb7177bf4c2e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- video2gif (0.0.30)
4
+ video2gif (0.0.31)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -123,13 +123,20 @@ module Video2gif
123
123
  # generate a palette from the stream using the specified number of
124
124
  # colors and optimizing for moving objects in the stream. Label
125
125
  # this stream's output as "palette."
126
- filtergraph << "[palettegen]palettegen=#{options[:palette] || 256}:stats_mode=diff[palette]"
126
+ filtergraph << '[palettegen]palettegen=' + %W[
127
+ #{options[:palette] || 256}
128
+ stats_mode=#{options[:palettemode] || 'diff'}
129
+ ].join(':') + '[palette]'
127
130
 
128
131
  # Using a copy of the stream from the 'split' filter and the
129
132
  # generated palette as inputs, apply the final palette to the GIF.
130
133
  # For non-moving parts of the GIF, attempt to reuse the same
131
134
  # palette from frame to frame.
132
- filtergraph << "[paletteuse][palette]paletteuse=dither=#{options[:dither] || 'floyd_steinberg'}:diff_mode=rectangle"
135
+ filtergraph << '[paletteuse][palette]paletteuse=' + %W[
136
+ dither=#{options[:dither] || 'floyd_steinberg'}
137
+ diff_mode=rectangle
138
+ #{options[:palettemode] == 'single' ? 'new=1' : ''}
139
+ ].join(':')
133
140
  end
134
141
 
135
142
  def self.ffprobe_command(options, logger, executable: 'ffprobe')
@@ -57,6 +57,17 @@ module Video2gif
57
57
  options[:palette] = p
58
58
  end
59
59
 
60
+ parser.on('--palette-mode MODE',
61
+ '--palettemode MODE',
62
+ 'Configure a custom palette statistics mode, using either',
63
+ '"full" (single full-frame palette for the whole GIF),',
64
+ '"diff" (single palette emphasizing movement against a',
65
+ 'static background across frames), or',
66
+ '"single" (individual palette per frame, adds to file size)',
67
+ '(default "diff")') do |p|
68
+ options[:palettemode] = p
69
+ end
70
+
60
71
  parser.on('-d [ALGORITHM]',
61
72
  '--[no-]dither [ALGORITHM]',
62
73
  'Set the dithering algorithm for the palette generation',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Video2gif
4
- VERSION = '0.0.30'
4
+ VERSION = '0.0.31'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: video2gif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.30
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emily St.