lib/rest-ftp-daemon/jobs/video.rb in rest-ftp-daemon-0.422.0 vs lib/rest-ftp-daemon/jobs/video.rb in rest-ftp-daemon-0.423.0
- old
+ new
@@ -40,50 +40,47 @@
# Ensure target directory exists
log_info "JobVideo.work mkdir_p [#{@target_loc.dir}]"
FileUtils.mkdir_p @target_loc.dir
# Do the work, for each file
- set_info :source, :current, @source_loc.name
+ set_info :source_current, @source_loc.name
ffmpeg_command @source_loc, target_final
# Done
- set_info :source, :current, nil
+ set_info :source_current, nil
end
def do_after
# Done
- set_info :source, :current, nil
+ set_info :source_current, nil
end
def ffmpeg_command source, target
- set_info :source, :current, source.name
+ set_info :source_current, source.name
# Read info about source file
movie = FFMPEG::Movie.new(source.path)
- set_info :source, :ffmpeg_size, movie.size
- set_info :source, :ffmpeg_duration, movie.duration
- set_info :source, :ffmpeg_resolution, movie.resolution
+ set_info :ffmpeg_size, movie.size
+ set_info :ffmpeg_duration, movie.duration
+ set_info :ffmpeg_resolution, movie.resolution
-
-
-
# Build options
options = {
threads: JOB_FFMPEG_THREADS,
custom: options_from(@video_custom)
}
JOB_FFMPEG_ATTRIBUTES.each do |name|
options[name] = @video_options[name] unless @video_options[name].nil?
end
- set_info :work, :ffmpeg_options, options
+ set_info :work_ffmpeg_options, options
# 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|
# set_info :work, :ffmpeg_progress, ffmpeg_progress
- set_info :work, :progress, (100.0 * ffmpeg_progress).round(1)
+ set_info INFO_PROGRESS, (100.0 * ffmpeg_progress).round(1)
log_debug "progress #{ffmpeg_progress}"
end
end
def options_from attributes