video2gif 0.0.20 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/video2gif/ffmpeg.rb +7 -0
- data/lib/video2gif/options.rb +9 -0
- 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: f4e0acee1fd59d611f97a41816906dbbb332ced3fbaaf90b0801e0736c2d00f9
|
4
|
+
data.tar.gz: dc29a597398d407ab48bacdbde2bbd281602583a68e0a04c9423029a0b1ab01c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8e804320c36b811ca32f06a454484019d3e84d2b084aa90e7229d35e177a8d226126d02c2ea1d2b581c91a5a623fae6683865e543fe41f2c488d9bc159b0c44
|
7
|
+
data.tar.gz: 7f87f0e27e7f8931b7579d773c8f0e516506df02d0b992ac62e025a17fa482b066f4716404e230002fcabc9c7e41a7bd7b846777795cbe23462d6b1eaa055c1b
|
data/Gemfile.lock
CHANGED
data/lib/video2gif/ffmpeg.rb
CHANGED
@@ -6,6 +6,13 @@ module Video2gif
|
|
6
6
|
def self.filtergraph(options)
|
7
7
|
filtergraph = []
|
8
8
|
|
9
|
+
# Subtitle overlay has to be first due to sync problems.
|
10
|
+
if options[:subtitles] && options[:subtitles].is_a?(TrueClass)
|
11
|
+
filtergraph << '[0:v][0:s:0]overlay=format=auto'
|
12
|
+
elsif options[:subtitles] && options[:subtitles].match(/\A\d+\z/)
|
13
|
+
filtergraph << "[0:v][0:s:#{options[:subtitles]}]overlay=format=auto"
|
14
|
+
end
|
15
|
+
|
9
16
|
# Set 'fps' filter first, drop unneeded frames instead of
|
10
17
|
# processing those.
|
11
18
|
filtergraph << "fps=#{ options[:fps] || 10 }"
|
data/lib/video2gif/options.rb
CHANGED
@@ -148,6 +148,15 @@ module Video2gif
|
|
148
148
|
options[:tonemap] = t || 'hable'
|
149
149
|
end
|
150
150
|
|
151
|
+
parser.on('--subtitles [SELECTION INDEX]',
|
152
|
+
'Attempt to use the subtitles built into the video to',
|
153
|
+
'overlay text on the resulting GIF. Takes an optional',
|
154
|
+
'integer value to choose the subtitle stream. (Defaults',
|
155
|
+
'to the first subtitle stream, 0) (ONLY WORKS WITH BITMAP',
|
156
|
+
'SUBTITLES AT THIS TIME)') do |s|
|
157
|
+
options[:subtitles] = s || true
|
158
|
+
end
|
159
|
+
|
151
160
|
parser.separator ''
|
152
161
|
parser.separator 'Text overlay options (only used if text is defined):'
|
153
162
|
|
data/lib/video2gif/version.rb
CHANGED