Created
January 29, 2014 14:33
-
-
Save cstroie/8689208 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/bash | |
# Convert all mjpg AVI movies created by Niokon camera to mp4 | |
if [ ! "$1" ] | |
then | |
find . -iname '*.avi' -exec "$0" "{}" \; | |
exit 1 | |
fi | |
I="$1" | |
B="${I##*/}" | |
P="${I%/*}" | |
N="${B%.*}" | |
X="${B##*.}" | |
[ "$X" = "AVI" ] && Z="MP4" || Z="mp4" | |
O="$N.$Z" | |
if [ ! -f "$P/$O" ] | |
then | |
echo "Converting $I to $P/$O" | |
HandBrakeCLI -C 1 -O -Z Normal -i "$I" -o "$P/$O" | |
fi | |
# vim: set ft=sh ai ts=2 sts=2 et sw=2 sta nowrap nu: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment