marquis wrote:OK, it's me again![]()
I managed to compile the latest version from handbrake in a virtual machine and it's working now with the export of the $TMPDIR variable. So my /tmp is no longer filled and now I can convert my DVDs![]()
For those of you who would like to upgrade you can find my version here: http://dl.dropbox.com/u/19006011/handbrakecli-0.9.5-rev3980.7z
Enjoy
M.
#!/bin/sh
function config ()
{
echo "Setting environment"
# Working directories
ENCDIR=/share/HDC_DATA/Multimedia/DVD # Source Path to scan for DVDs
DSTDIR=/share/HDC_DATA/Multimedia/Video # Destination Path to copy encoded files
DVDBACKUPDIR=/share/Backup/DVD # Destination Path for a Backup of the original DVD
TEMPD=/share/HDD_DATA/tmp # Destination folder for temp files ** DO NOT SET TO RAM DRIVE **
# Command line for converting a DVD and BD
DVD="/opt/bin/nice --adjustment=15 /share/scripts/sbin/handbrake -i ./VIDEO_TS -o $FILENAME --main-feature --markers --large-file --encoder x264 --vb 2500 --two-pass --turbo --aencoder ac3 --drc 2.0 --deinterlace slow --decomb 1:2:6:9:80:16:16 --subtitle scan --native-language deu --native-dub --subtitle-burn --subtitle-forced -x ref=3:mixed-refs:bframes=6:weightb:direct=auto:me=umh:subme=9:analyse=all:8x8dct:trellis=1:no-fast-pskip:psy-rd=1,1"
BD="/opt/bin/nice --adjustment=15 /share/scripts/sbin/handbrake -i . -o $FILENAME --main-feature --markers --large-file --subtitle scan --native-language deu --native-dub --subtitle-burn --subtitle-forced --encoder x264 -E ac3 -q 20 -v"
Process_Time_Stamp=`date +"%s"`
AppName="dvdripper" # token to identify the script in the list of running processes
Temp_File="$TEMPD/$Process_Time_Stamp"
}
function check_startconditions ()
{
### Check if this script is already working. Cancel if another conversion is detected.
i=$(ps ax | grep "$AppName" | grep -v "grep" | wc -l)
if [ $i -gt 2 ]; then
echo "A conversion is already in progress. Please wait until it's finished and try again." | tee $Temp_File.error
exit 0
fi
# Start logfile
echo "----- Start log -----" | tee $Temp_File.log
}
function start ()
{
# Look for DVDs
# Read directorys on 1st level
find $ENCDIR -maxdepth 1 -type d -name "*" | while read DIR
do
if [ "$DIR" != "$ENCDIR" ]
then
if [ -d "$DIR"/VIDEO_TS ]
then
echo "$DIR: DVD gefunden" | tee $Temp_File.log
FILENAME=`echo $DIR.mkv | sed -e "s/\ /_/g"`
COMMAND="$DVD"
encode $DIR
fi
if [ -d "$DIR"/BDMV ]
then
echo "$DIR: BDMV gefunden" | tee $Temp_File.log
FILENAME=`echo $DIR.mkv | sed -e "s/\ /_/g"`
COMMAND="$BD"
encode $DIR
fi
fi
done
}
function encode ()
{
echo "Input............: $DIR" | tee $Temp_File.log
echo "Output...........: $FILENAME" | tee $Temp_File.log
echo "Final destination: $DSTDIR" | tee $Temp_File.log
echo
cd "$DIR"
let i=10
while [ $i -gt 0 ]
do
echo -en "\r\033[KStart conversion in $i seconds"
sleep 1
let i=i-1
done
echo
export TMPDIR=$TEMPD
echo "Encoding begins now" | tee $Temp_File.log
Result=`$COMMAND`
if [ -f $FILENAME ]
then
echo "$FILENAME wurde erfolgreich erzeugt" | tee $Temp_File.log
mv $FILENAME $DSTDIR/
echo "$FILENAME moved to $DSTDIR" | tee $Temp_File.log
mv "$DIR" $DVDBACKUPDIR/
echo "$DIR moved to $DVDBACKUPDIR" -m | tee $Temp_File.log
else
echo "$FILENAME not found. Something strange happened on the way..." | tee $Temp_File.log
fi
}
clear
config
check_startconditions $*
start $*
rm "${Temp_File}*"Users browsing this forum: No registered users and 2 guests