Cutinplace.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(M)
Zeile 12: Zeile 12:
 
# folgende zeilen in die reccmds.conf eintragen:
 
# folgende zeilen in die reccmds.conf eintragen:
 
#
 
#
# cutinplace (at) : /usr/local/bin/cutinplace.sh -at
+
# cutinplace (at) : /path_to_this_script/cutinplace.sh -at
# cutinplace      : /usr/local/bin/cutinplace.sh -start
+
# cutinplace      : /path_to_this_script/cutinplace.sh -start
  
 
# CONFIG START
 
# CONFIG START
 
   MAX_IN_MB="600"  # max size -> cut without at
 
   MAX_IN_MB="600"  # max size -> cut without at
  MESSAGE="You need to set the Maximum recording size to 100MB or something small anyway in Recordings menu to fully enjoy faster cutting times."
 
 
# CONFIG END
 
# CONFIG END
  
PATH=$PATH:/usr/local/bin
+
PATH=$PREFIX/bin:$PREFIX/sbin:$PATH
 
+
I18N=${MYPATH:?}/VDR/i18n.c
+
LANGUAGE=( `grep -s ^OSDLanguage ${VDR_CONFIG:?}/setup.conf` )
+
MAXFILESIZE=`grep -s ^MaxVideoFileSize ${VDR_CONFIG:?}/setup.conf | cut -d' ' -f3`
+
 
+
VAR=${MAXFILESIZE##*[^0-9]*}
+
eval ${VAR:+test $MAXFILESIZE -gt 100 && echo $MESSAGE}
+
  
 
case "$1" in
 
case "$1" in
 
     -at)
 
     -at)
 
at now <<EOT
 
at now <<EOT
MESG_START="$(grep -sA ${LANGUAGE[2]} '"Editing process started",$' $I18N | tail -n1 | cut -d'"' -f2)"
+
svdrpsend.pl -p ${VDR_PORT:-2001} MESG "Editing process started" >/dev/null
MESG_END="$(grep -sA ${LANGUAGE[2]} '"Editing process finished",$' $I18N | tail -n1 | cut -d'"' -f2)"
+
svdrpsend.pl -p ${VDR_PORT:-2001} MESG "\${MESG_START:-Editing process started}" >/dev/null
+
 
cutinplace "$2" >/dev/null
 
cutinplace "$2" >/dev/null
svdrpsend.pl -p ${VDR_PORT:-2001} MESG "\${MESG_END:-Editing process finished}" >/dev/null
+
svdrpsend.pl -p ${VDR_PORT:-2001} MESG "Editing process finished" >/dev/null
 
EOT
 
EOT
 
;;
 
;;

Version vom 21. Oktober 2005, 09:02 Uhr

Script für cutinplace.

Datei
$PATH/cutinplace.sh
#!/bin/sh
#
# cutinplace.sh
#
# Required: at, cutinplace
#
# add this lines to your reccmds.conf:
# folgende zeilen in die reccmds.conf eintragen:
#
# cutinplace (at) : /path_to_this_script/cutinplace.sh -at
# cutinplace      : /path_to_this_script/cutinplace.sh -start

# CONFIG START
  MAX_IN_MB="600"  # max size -> cut without at
# CONFIG END

PATH=$PREFIX/bin:$PREFIX/sbin:$PATH

case "$1" in
    -at)
	at now <<EOT
	svdrpsend.pl -p ${VDR_PORT:-2001} MESG "Editing process started" >/dev/null
	cutinplace "$2" >/dev/null
	svdrpsend.pl -p ${VDR_PORT:-2001} MESG "Editing process finished" >/dev/null
EOT
	;;
    -start)
	VAR=$(($(find "$2" -printf %k+)0))
	if [ "$((VAR/1024))" -gt "$MAX_IN_MB" ] ; then
	    echo "Record to large ($((VAR/1024))Mb -gt ${MAX_IN_MB}Mb), use better at..."
	else
	    cutinplace "$2"
	fi
	;;
esac