Last active
September 10, 2017 21:04
-
-
Save ice-blaze/c9d990e10dfdcc3ffcdeeb016b3c16c5 to your computer and use it in GitHub Desktop.
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 | |
IFS=$'\n'; set -f | |
for filepath in $(find ./ -name '*.avi' -or -name '*.mp4' -or -name '*.wmv'); do | |
if [[ $filepath == *".ignore"* ]]; then | |
continue | |
fi | |
dir=$(dirname $filepath) | |
base=$(basename $filepath) | |
encodeFolder="$dir/encode/" | |
mkdir -p "$encodeFolder" | |
HandBrakeCLI -i "$filepath" -o "$encodeFolder${base%.*}.mp4" -e x265 -q 20 -B 160 | |
done | |
unset IFS; set +f | |
# TODO replace the generate with original only if they are the same size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment