Skip to content

Instantly share code, notes, and snippets.

@rahuljiresal
Created November 30, 2014 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuljiresal/77cec17dbc89f5bfb1bb to your computer and use it in GitHub Desktop.
Save rahuljiresal/77cec17dbc89f5bfb1bb to your computer and use it in GitHub Desktop.
Shell Script to convert many files in the folder to MP4 files using Handbrake CLI
#!/bin/bash
[ -d bkp ] || mkdir bkp
# change the file extension to whatever you want, mkv, avi, etc.
for f in *.mkv;
do
echo "========================== Processing $f ==========================";
HandBrakeCLI -i "$f" -o "${f%}.mp4" --preset="Normal"
mv "$f" bkp
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment