File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ EXT=ts
4+
5+ for i in * ; do
6+ if [ " ${i} " != " ${i% .${EXT} } " ]; then
7+ echo " convertible file found: $i "
8+ fi
9+ done
10+
11+ for i in * ; do
12+ if [ " ${i} " != " ${i% .${EXT} } " ]; then
13+ echo " converting file $i "
14+ convert " $i "
15+ fi
16+ done
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ NOW=$( date +" %m%d%Y" )
4+ PGMNAME=/usr/bin/HandBrakeCLI
5+ check_errs ()
6+ {
7+ # Function. Parameter 1 is the return code
8+ # Para. 2 is text to display on failure.
9+ if [ " ${1} " -ne " 0" ]; then
10+ echo " ERROR # ${1} : ${2} "
11+ # as a bonus, make our script exit with the right error code.
12+ exit ${1}
13+ fi
14+ }
15+
16+ BASEPATH=$( dirname " $1 " )
17+ BASEFILE=$( basename " $1 " )
18+ FILENAME=" ${BASEFILE%% .* } "
19+
20+ echo " Starting $NOW "
21+ ${PGMNAME} --input " $1 " --format mkv --aencoder aac --ab 192 --encoder x264 --x264-preset veryfast --quality 23 --turbo --encoder-level 4.1 --output " $BASEPATH /$FILENAME .mkv"
22+ check_errs $? " Failed to convert file $1 "
23+
24+ echo " Removing original file."
25+ rm -f " $1 "
26+ check_errs $? " Failed to remove original file $1 "
27+
28+ exit
You can’t perform that action at this time.
0 commit comments