vid2gif 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vid2gif +14 -1
- data/lib/vid2gif/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40b03ce5c4e664b72e6fd6da721dcbe6cf1e28c6
|
4
|
+
data.tar.gz: d711af0cd3b15dafe386771ddf63f2421cd1f803
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0349ce85fee963ac0fb69bc774d9975252a935a4f3991067b40f780351643188aabcdb915c80819b7e4bfb0004f3e8f05ed56ee9aa78e22338446033b2589235
|
7
|
+
data.tar.gz: b739461cc21ccbdf7d2d25c27df69be7a1e6c6d95a4e09573b27e8867bc15b88b1f65daac1458a0631e80aec9e2c03cf6658c795543ceca48e8231ee9e2a375c
|
data/bin/vid2gif
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'optparse'
|
4
4
|
require 'chronic_duration'
|
5
5
|
require 'open3'
|
6
|
+
require 'tempfile'
|
6
7
|
|
7
8
|
options = {}
|
8
9
|
|
@@ -70,6 +71,12 @@ OptionParser.new do |opts|
|
|
70
71
|
opts.separator ''
|
71
72
|
opts.separator 'Other stuff:'
|
72
73
|
|
74
|
+
if RbConfig::CONFIG['host_os'] =~ /darwin|mac os/
|
75
|
+
opts.on '-p', '--preview', 'Open the image in quicklook' do |ql|
|
76
|
+
options[:quicklook] = ql
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
73
80
|
opts.on_tail('-h', '--help', 'Show this message') do
|
74
81
|
puts opts
|
75
82
|
exit
|
@@ -102,7 +109,7 @@ palettegen_filters << '=stats_mode=diff' if options[:diff]
|
|
102
109
|
arguments = []
|
103
110
|
arguments << "-ss #{options[:start]}" if options[:start]
|
104
111
|
arguments << "-t #{options[:duration]}" if options[:duration]
|
105
|
-
arguments << "-i #{ARGV[0]}"
|
112
|
+
arguments << "-i \"#{ARGV[0]}\""
|
106
113
|
|
107
114
|
puts "Generating palette\n"
|
108
115
|
Open3.popen2e(['ffmpeg', *arguments, "-vf #{filters.dup.push(palettegen_filters).join(',')}", "-y #{palette.path}"].join(' ')) do |_, output, _|
|
@@ -130,3 +137,9 @@ end
|
|
130
137
|
palette.unlink
|
131
138
|
|
132
139
|
puts "Gif created at #{filename}"
|
140
|
+
|
141
|
+
exit unless options[:quicklook]
|
142
|
+
|
143
|
+
Open3.popen3('qlmanage', '-p', filename) do |_, _, _, thread|
|
144
|
+
thread.join
|
145
|
+
end
|
data/lib/vid2gif/version.rb
CHANGED