Class: RestFtpDaemon::Transform::TransformFfmpeg

Inherits:
TaskTransform
  • Object
show all
Defined in:
lib/plugins/rest-ftp-daemon/transform/transform_ffmpeg.rb

Instance Method Summary collapse

Instance Method Details

#prepareObject

Task operations



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/plugins/rest-ftp-daemon/transform/transform_ffmpeg.rb', line 12

def prepare
  super

  # Import command path
  FFMPEG.ffmpeg_binary = @config[:ffmpeg]
  FFMPEG.ffprobe_binary = File.join(File.dirname(@config[:ffmpeg]), "ffprobe")
  log_debug "FFMPEG binaries", {
    ffmpeg_binary: FFMPEG.ffmpeg_binary,
    ffprobe_binary: FFMPEG.ffprobe_binary,
    }

  # Ensure FFMPEG lib is available
  ffmpeg_check_binary :ffprobe_binary
  ffmpeg_check_binary :ffmpeg_binary

  # FIXME: only one source, otherwise  we don't know how to determine target name
  if @input.count>1
    raise Task::SourceShouldBeUnique, "prepare: only one source can be matched for transformation"
  end
end

#processObject



33
34
35
# File 'lib/plugins/rest-ftp-daemon/transform/transform_ffmpeg.rb', line 33

def process
  transform_each_input
end

#task_iconObject

Task attributes



7
8
9
# File 'lib/plugins/rest-ftp-daemon/transform/transform_ffmpeg.rb', line 7

def task_icon
  "facetime-video"
end