Skip to content

Instantly share code, notes, and snippets.

@syou6162
Created September 24, 2012 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syou6162/3776204 to your computer and use it in GitHub Desktop.
Save syou6162/3776204 to your computer and use it in GitHub Desktop.
HandBrakeのCLIでmp4に変換
handbrake_path = "/Volumes/HandBrake-0.9.8-MacOSX.6_CLI_x86_64/HandBrakeCLI"
preset = "--preset=\"iPhone & iPod Touch\""
native_language = "--native-language eng"
subtitle = "--subtitle 2 --subtitle-burn 2"
input_base_dir = "/Users/yasuhisa/Desktop"
output_base_dir = "/Users/yasuhisa/Desktop"
cdr_id = 1
(1..4).each {|chapter|
opts = ["-i", "#{input_base_dir}/FRIENDS_1_#{cdr_id}.cdr",
"-c", "1",
"-o", "#{output_base_dir}/FRIENDS_#{cdr_id}_#{chapter}.mp4",
subtitle, native_language, preset].join(" ")
cmd = handbrake_path + " " + opts
system cmd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment