Skip to content

Instantly share code, notes, and snippets.

@brettbuddin
Created April 8, 2011 15:26
Show Gist options
  • Save brettbuddin/910100 to your computer and use it in GitHub Desktop.
Save brettbuddin/910100 to your computer and use it in GitHub Desktop.
Using the new Preset API to define a preset in another location from where you are actually calling `convert`.
require "rubygems"
require "bundler/setup"
require "ffmpeg" #=> https://github.com/brettbuddin/ffmpeg
include FFMpeg
Presets.define(:mp4_240x180_400k_aac, "mp4") do
resolution "240x180"
audio_codec "libfaac"
video_bitrate "400k"
video_codec "mpeg4"
end
convert("input_file.avi", :preset => :mp4_240x180_400k_aac)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment