-
-
Save jbfink/4464616 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
# This script converts any kind of video the HandBrake CLI can handle | |
# into a 1000 kbit MPEG4 video and shrinks it down to a max width of 640 px. | |
# | |
# Usage: | |
# Running the script without any parameters just uses *all* files in the | |
# current directory and converts them, so make sure you only have video files | |
# in the directory you're in. | |
# | |
# You can specify an input and output directory if you want: | |
# 'script <INPUT> <OUTPUT>' | |
# | |
# The script also assumes you're using Mac OS X and have 'Growl' and 'growlnotify' | |
# installed, if you don't then just comment out the last line. | |
if [ ! -n "$1" ]; then | |
IN='.' | |
OUT='.' | |
else | |
IN=$1 | |
OUT=$2 | |
fi | |
cd "$IN" | |
for InputItem in *;do | |
/usr/bin/HandBrakeCLI -Z Normal -i "$InputItem" -o "$OUT/${InputItem}.mkv" | |
done | |
#growlnotify "Conversion done" -m 'Have fun with your new files' -s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment