FFmpegProgress
<img src=“inch-ci.org/github/Winterbraid/ffmpeg_progress.svg?branch=master” alt=“Inline docs” /> <img src=“codeclimate.com/github/Winterbraid/ffmpeg_progress/badges/gpa.svg” />
- Source code
- Gem
- Documentation
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. = '-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 }