Skip to content

Instantly share code, notes, and snippets.

@venj
Created March 14, 2013 05:27
Show Gist options
  • Save venj/5159037 to your computer and use it in GitHub Desktop.
Save venj/5159037 to your computer and use it in GitHub Desktop.
Convert videos (mjpeg) shot with Canon Powershot to m4v(h264).
#!/usr/bin/env ruby
require 'rubygems'
require 'colorize'
require 'shellwords'
Dir["*"].each do |f|
next if f == File.basename(__FILE__)
fname = File.basename(f.downcase, '.avi')
print "Encoding #{f}..."
system("ffmpeg -v error -i #{f.shellescape} -map_metadata 0:g -acodec libfaac -ab 256 -ar 44100 -ac 1 -c:v h264 #{fname}.m4v")
puts "done.".green
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment