Convert all .mkv files in a directory to .mp4 for ipad

Alec Jacobson

March 30, 2014

weblog/

Here's a bash "one-liner" to convert all movie files in the current directory to a format that works with the ipad. It renames the files from .mkv to .mp4.

for f in *.mkv; do ffmpeg -i $f -acodec aac -ac 2 -strict experimental -ab 160k -s 1920x1080 -vcodec copy -f mp4 -threads 0 ${f%.*}.mp4; done