ez_video 1.0.1 → 1.0.2
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.
- data/lib/rvideo/inspector.rb +4 -2
- data/lib/rvideo/version.rb +1 -1
- metadata +1 -1
data/lib/rvideo/inspector.rb
CHANGED
@@ -150,7 +150,7 @@ module RVideo # :nodoc:
|
|
150
150
|
# t.capture_frame('10%') # => '/path/to/screenshot/input-10p.jpg'
|
151
151
|
#
|
152
152
|
|
153
|
-
def capture_frame(timecode, output_file = nil)
|
153
|
+
def capture_frame(timecode, output_file = nil, dimension=nil)
|
154
154
|
t = calculate_time(timecode)
|
155
155
|
unless output_file
|
156
156
|
output_file = "#{TEMP_PATH}/#{File.basename(@full_filename, ".*")}-#{timecode.gsub("%","p")}.jpg"
|
@@ -158,7 +158,9 @@ module RVideo # :nodoc:
|
|
158
158
|
# do the work
|
159
159
|
# mplayer $input_file$ -ss $start_time$ -frames 1 -vo jpeg -o $output_file$
|
160
160
|
# ffmpeg -i $input_file$ -v nopb -ss $start_time$ -b $bitrate$ -an -vframes 1 -y $output_file$
|
161
|
-
|
161
|
+
dimension_option=""
|
162
|
+
dimension_option="-s #{dimension}" unless dimension.nil?
|
163
|
+
command = "ffmpeg -i #{@full_filename} -ss #{t} -t 00:00:01 -r 1 -vframes 1 #{dimension_option} -f image2 #{output_file}"
|
162
164
|
Transcoder.logger.info("\nCreating Screenshot: #{command}\n")
|
163
165
|
frame_result = `#{command} 2>&1`
|
164
166
|
|
data/lib/rvideo/version.rb
CHANGED