FfmpegProgress

Execute ffmpeg commands while displaying a pretty progress bar instead of the usual garbage.

Convert from the shell with default options:

# Will save to ./converted/test.mp4
ruby -rffmpeg_progress -e "FfmpegProgress::Ffmpeg.new('test.avi').run"

Example Use

require 'ffmpeg_progress'

include FfmpegProgress

f = Ffmpeg.new 'input.avi'

# Occurrences of '_INPUT_' will be replaced with the input file name.
f.options = '-y -threads 0 -c:v libx264 -crf 22 -preset medium -c:a copy'

# Directories will be created if necessary.
f.output = 'output.mkv'

f.command
# => "ffmpeg -i input.avi -y -threads 0 -c:v libx264 -crf 22 " \
#   "-preset medium -c:a copy output.mkv &> ffmpeg.log"

# The optional block is passed self as a parameter and appended to
# the progress bar.
f.run { |ffmpeg| ffmpeg.output }