video_screenshoter 0.0.5 → 0.0.6
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.
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module VideoScreenshoter
|
4
4
|
class Video
|
5
|
-
attr_accessor :ffmpeg, :output_dir, :output_file, :input, :times, :duration, :verbose
|
5
|
+
attr_accessor :ffmpeg, :output_dir, :output_file, :input, :times, :duration, :verbose, :size
|
6
6
|
|
7
7
|
def initialize params
|
8
8
|
[:ffmpeg, :output_dir, :output_file, :verbose].each do |attr|
|
@@ -19,6 +19,7 @@ module VideoScreenshoter
|
|
19
19
|
time = time.to_i
|
20
20
|
time
|
21
21
|
end
|
22
|
+
self.size = params[:size] ? "-s #{params[:size]}" : ''
|
22
23
|
end
|
23
24
|
|
24
25
|
def output_fullpath time
|
@@ -27,7 +28,7 @@ module VideoScreenshoter
|
|
27
28
|
|
28
29
|
def run
|
29
30
|
times.each do |time|
|
30
|
-
cmd = "#{ffmpeg} -i #{input} -acodec -an -ss #{time} -f image2 -vframes 1 -y #{output_fullpath(time)} 2>/dev/null 1>&2"
|
31
|
+
cmd = "#{ffmpeg} -i #{input} -acodec -an -ss #{time} #{size} -f image2 -vframes 1 -y #{output_fullpath(time)} 2>/dev/null 1>&2"
|
31
32
|
puts cmd if verbose
|
32
33
|
`#{cmd}`
|
33
34
|
end
|
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.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -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: 1571913647041927257
|
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: 1571913647041927257
|
121
121
|
requirements:
|
122
122
|
- ffmpeg
|
123
123
|
rubyforge_project:
|