video_screenshoter 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,12 +15,13 @@ module VideoScreenshoter
|
|
15
15
|
if time.is_a?(String) && matches = time.match(/(.*)%$/)
|
16
16
|
time = matches[1].to_f / 100 * duration
|
17
17
|
end
|
18
|
+
time = time.to_i
|
18
19
|
time = duration + time if time < 0
|
19
20
|
time
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
|
-
def
|
24
|
+
def run
|
24
25
|
times.each do |time|
|
25
26
|
cmd = "#{ffmpeg} -i #{input} -acodec -an -ss #{time} -f image2 -vframes 1 -y #{sprintf(File.join(output_dir, output_file), time)} 2>/dev/null 1>&2"
|
26
27
|
puts cmd if verbose
|
@@ -28,6 +29,9 @@ module VideoScreenshoter
|
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
32
|
+
alias :make_screenshots :run
|
33
|
+
alias :make_thumbnails :run
|
34
|
+
|
31
35
|
private
|
32
36
|
|
33
37
|
def input_duration
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: video_screenshoter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
segments:
|
110
110
|
- 0
|
111
|
-
hash:
|
111
|
+
hash: 4060921785164148765
|
112
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
113
|
none: false
|
114
114
|
requirements:
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
segments:
|
119
119
|
- 0
|
120
|
-
hash:
|
120
|
+
hash: 4060921785164148765
|
121
121
|
requirements:
|
122
122
|
- ffmpeg
|
123
123
|
rubyforge_project:
|