Created
November 6, 2011 17:30
-
-
Save jbarratt/1343205 to your computer and use it in GitHub Desktop.
Bulk HandbrakeCLI Encoder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -name "*.mkv" | while read FILE | |
do | |
# What would the output file be? | |
DST=/Volumes/USBRAID/Converted/$(dirname "$FILE") | |
MKV=$(basename "$FILE") | |
MP4=${MKV%%.mkv}.mp4 | |
# If it already exists, don't overwrite it | |
if [ -e "$DST/$MP4" ] | |
then | |
echo "NOT overwriting $DST/$MP4" | |
else | |
echo "\"$FILE\" \"$DST/$MP4\"" | |
mkdir -p "$DST" | |
echo "" | HandbrakeCLI --preset "AppleTV 2" -i "$FILE" -o "$DST/$MP4" | |
if [ $? != 0 ] | |
then | |
echo "$FILE had problems" >> errors.log | |
fi | |
fi | |
done | |
# test of editing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment