video2gif 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/video2gif/ffmpeg.rb +5 -4
- data/lib/video2gif/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92d78189e8061dcc25298f5e8fb65e84c39688479f7f087761a16fbab16b5c60
|
4
|
+
data.tar.gz: d50fcf7f759e6578beb1730c9a1f2de95b5518c5fdae9a36125405d888a85c03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57774248542d5c75031ff1596094b3698ee13b48df7ca0a0715c314da676bfe62601396249bbc1d0b0116be97a83351a65a5f9ffded88deb26ac9779afb645c2
|
7
|
+
data.tar.gz: 7661e6761b9ceb828bace679eb552f9ffdabf31fdd43b31a63e4ad480bed4514b5733b2a4958a868cd698cd96d7fd3d93da6d31da1fc31e008369a695f8fa64c
|
data/lib/video2gif/ffmpeg.rb
CHANGED
@@ -9,7 +9,8 @@ module Video2gif
|
|
9
9
|
width = options[:width] # default is not to scale at all
|
10
10
|
|
11
11
|
# create filter elements
|
12
|
-
|
12
|
+
palettegen_fps_filter = "fps=2" # sample only a few frames a second
|
13
|
+
paletteuse_fps_filter = "fps=#{fps}"
|
13
14
|
crop_filter = options[:cropdetect] || 'crop=' + %W[
|
14
15
|
w=#{ options[:wregion] || 'in_w' }
|
15
16
|
h=#{ options[:hregion] || 'in_h' }
|
@@ -39,7 +40,7 @@ module Video2gif
|
|
39
40
|
gamma_b=#{ options[:gamma_b] || 1 }
|
40
41
|
].join(':')
|
41
42
|
end
|
42
|
-
palettegen_filter = "palettegen=#{max_colors}stats_mode=
|
43
|
+
palettegen_filter = "palettegen=#{max_colors}stats_mode=full"
|
43
44
|
paletteuse_filter = 'paletteuse=dither=floyd_steinberg:diff_mode=rectangle'
|
44
45
|
drawtext_filter = if options[:text]
|
45
46
|
count_of_lines = options[:text].scan(/\\n/).count + 1
|
@@ -75,7 +76,7 @@ module Video2gif
|
|
75
76
|
# first, apply the same filters we'll use later in the same order
|
76
77
|
# before applying the palettegen so that we accurately predict the
|
77
78
|
# final palette
|
78
|
-
filter_complex <<
|
79
|
+
filter_complex << palettegen_fps_filter
|
79
80
|
filter_complex << crop_filter if crop_filter
|
80
81
|
filter_complex << scale_filter if options[:width] unless options[:tonemap]
|
81
82
|
filter_complex << tonemap_filters if options[:tonemap]
|
@@ -90,7 +91,7 @@ module Video2gif
|
|
90
91
|
# along with the other filters (drawing text last so that it isn't
|
91
92
|
# affected by scaling)
|
92
93
|
filter_complex << '[0:v][palette]' + paletteuse_filter
|
93
|
-
filter_complex <<
|
94
|
+
filter_complex << paletteuse_fps_filter
|
94
95
|
filter_complex << crop_filter if crop_filter
|
95
96
|
filter_complex << scale_filter if options[:width] unless options[:tonemap]
|
96
97
|
filter_complex << tonemap_filters if options[:tonemap]
|
data/lib/video2gif/version.rb
CHANGED