lib/rest-ftp-daemon/jobs/video.rb in rest-ftp-daemon-0.435.2 vs lib/rest-ftp-daemon/jobs/video.rb in rest-ftp-daemon-0.501.0
- old
+ new
@@ -27,21 +27,22 @@
end
def do_work
# Guess source files from disk
set_status JOB_STATUS_TRANSFORMING
- sources = @source_loc.scan_files
+ sources = @source_loc.local_files
raise RestFtpDaemon::SourceNotFound if sources.empty?
# Add the source file name if none found in the target path
target_final = @target_loc.clone
target_final.name = @source_loc.name unless target_final.name
log_info "JobVideo.work target_final.path [#{target_final.path}]"
# Ensure target directory exists
- log_info "JobVideo.work mkdir_p [#{@target_loc.dir}]"
- FileUtils.mkdir_p @target_loc.dir
+ t_dir = @target_loc.filedir
+ log_info "JobVideo.work mkdir_p [#{t_dir}]"
+ FileUtils.mkdir_p t_dir
# Do the work, for each file
set_info INFO_SOURCE_CURRENT, @source_loc.name
ffmpeg_command @source_loc, target_final
@@ -79,14 +80,14 @@
# Announce context
log_info "JobVideo.ffmpeg_command [#{FFMPEG.ffmpeg_binary}] [#{source.name}] > [#{target.name}]", options
# Build command
- movie.transcode(target.path, options) do |ffmpeg_progress|
+ movie.transcode(target.filepath, options) do |ffmpeg_progress|
# set_info :work, :ffmpeg_progress, ffmpeg_progress
set_info INFO_TRANFER_PROGRESS, (100.0 * ffmpeg_progress).round(1)
- log_debug "progress #{ffmpeg_progress}"
+ log_info "progress #{ffmpeg_progress}"
end
end
def options_from attributes
# Ensure options ar in the correct format
@@ -115,14 +116,13 @@
end
end
end
-
# require "stringio"
# def capture_stderr
# real_stderr, $stderr = $stderr, StringIO.new
# yield
# $stderr.string
# ensure
# $stderr = real_stderr
-# end
+# end
\ No newline at end of file