Skip to content

Instantly share code, notes, and snippets.

@mikecharles
Created October 24, 2016 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikecharles/22c0f96356dfdc0bdba1a95f0bab507a to your computer and use it in GitHub Desktop.
Save mikecharles/22c0f96356dfdc0bdba1a95f0bab507a to your computer and use it in GitHub Desktop.
Batch convert video files using HandbrakeCLI
#!/bin/sh
find . -type f -iname "*.avi" -print0 | while IFS= read -r -d $'\0' infile ; do
outfile="${infile%.*}.m4v"
echo "Converting ${infile} to ${outfile}..."
HandbrakeCLI -Z 'AppleTV 3' -q 25 -i "$infile" -o "$outfile"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment