Skip to content

Instantly share code, notes, and snippets.

@anaglik
Last active August 29, 2015 14:02
Show Gist options
  • Save anaglik/71e87bcf07f66b07b8ef to your computer and use it in GitHub Desktop.
Save anaglik/71e87bcf07f66b07b8ef to your computer and use it in GitHub Desktop.
Handy script for converting videos using HandBrakeCLI.
DIRECTORY = "/videos/"
Dir.foreach(DIRECTORY) { |file|
next if !file.end_with?(".mov")
new_file = file.sub(".mov",".mp4")
puts "converting #{file} into #{new_file} ... \n"
%x{HandBrakeCLI -Z HigherProfile --strict-anamorphic --crop "0:0:0:0" -i "#{DIRECTORY}#{file}" -o "#{DIRECTORY}#{new_file}" }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment