Skip to content

Instantly share code, notes, and snippets.

@pcreux
Last active July 26, 2022 01:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save pcreux/7905485 to your computer and use it in GitHub Desktop.
Save pcreux/7905485 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