Skip to content

Instantly share code, notes, and snippets.

@shanshiwu
Forked from pcreux/convert-to-ipad.rb
Created October 15, 2016 07:45
Show Gist options
  • Select an option

  • Save shanshiwu/abb86403080604ea79a72b88f1c43619 to your computer and use it in GitHub Desktop.

Select an option

Save shanshiwu/abb86403080604ea79a72b88f1c43619 to your computer and use it in GitHub Desktop.
ffmpeg - avi to mp4 - iPad
# ruby convert-to-ipad.rb video1.avi video2.avi video3.avi
#
# Prereq: brew install ffmpeg
ARGV.each do |input_file|
output_file = input_file.gsub('.avi', '.ipad.mp4')
cmd = "ffmpeg -i #{input_file} -acodec aac -ac 2 -strict experimental -ab 160k -s 1024x768 -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 #{output_file}"
puts cmd
system cmd
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment