Cutinplace.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(+ added maxvideofilesize check)
Zeile 1: Zeile 1:
<pre>
+
#!/bin/sh
#!/bin/sh
+
#
#
+
# cutinplace.sh - v.0.2
# cutinplace.sh - v.0.2
+
#
#
+
# add this lines to your [[reccmds.conf]]:
# add this lines to your reccmds.conf:
+
# folgende zeilen in die [[reccmds.conf]] eintragen:
# folgende zeilen in die reccmds.conf eintragen:
+
#
#
+
# cutinplace (at) : /usr/local/bin/cutinplace.sh -at
# cutinplace (at) : /usr/local/bin/cutinplace.sh -at
+
# cutinplace      : /usr/local/bin/cutinplace.sh -start
# cutinplace      : /usr/local/bin/cutinplace.sh -start
+
#
#
+
# history
# history
+
# --------
# --------
+
# 20041214,ronny: added maxvideofilesize check
# 20041214,ronny: added maxvideofilesize check
+
 
+
# 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."
  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=$PATH:/usr/local/bin
+
 
+
MAXFILESIZE=`grep -s ^MaxVideoFileSize /etc/vdr/setup.conf|cut -d' ' -f3`
MAXFILESIZE=`grep -s ^MaxVideoFileSize /etc/vdr/setup.conf|cut -d' ' -f3`
+
VAR=${MAXFILESIZE##*[^0-9]*}
VAR=${MAXFILESIZE##*[^0-9]*}
+
 
+
eval ${VAR:+test ${MAXFILESIZE} -gt 100 && echo ${MESSAGE}}
eval ${VAR:+test ${MAXFILESIZE} -gt 100 && echo ${MESSAGE}}
+
 
+
case "${1}" in
case "${1}" in
+
      -at)
      -at)
+
at now <<EOF
at now <<EOF
+
svdrpsend.pl MESG "Editing process started"
svdrpsend.pl MESG "Editing process started"
+
cutinplace "${2}"
cutinplace "${2}"
+
svdrpsend.pl MESG "Editing process finished"
svdrpsend.pl MESG "Editing process finished"
+
EOF
EOF
+
        ;;
;;
+
 
       -start)
 
       -start)
VAR=$(($(find "${2}" -printf %k+)0))
+
        VAR=$(($(find "${2}" -printf %k+)0))
test "$((VAR/1024))" -gt "${MAX_IN_MB}" && {
+
        test "$((VAR/1024))" -gt "${MAX_IN_MB}" && {
    echo "Record to large ($((VAR/1024))Mb -gt ${MAX_IN_MB}Mb), use better at..."
+
            echo "Record to large ($((VAR/1024))Mb -gt ${MAX_IN_MB}Mb), use better at..."
    exit 1
+
            exit 1
}
+
        }
cutinplace "${2}"
+
        cutinplace "${2}"
;;
+
        ;;
esac
+
esac
</pre>
+
  
 
[[Kategorie:Scripts]]
 
[[Kategorie:Scripts]]

Version vom 26. Dezember 2004, 12:43 Uhr

#!/bin/sh
#
# cutinplace.sh - v.0.2
#
# add this lines to your reccmds.conf:
# folgende zeilen in die reccmds.conf eintragen:
#
# cutinplace (at) : /usr/local/bin/cutinplace.sh -at
# cutinplace      : /usr/local/bin/cutinplace.sh -start
#
# history
# --------
# 20041214,ronny: added maxvideofilesize check

# CONFIG START
  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

PATH=$PATH:/usr/local/bin

MAXFILESIZE=`grep -s ^MaxVideoFileSize /etc/vdr/setup.conf|cut -d' ' -f3`
VAR=${MAXFILESIZE##*[^0-9]*}

eval ${VAR:+test ${MAXFILESIZE} -gt 100 && echo ${MESSAGE}}

case "${1}" in
      -at)
at now <<EOF
svdrpsend.pl MESG "Editing process started"
cutinplace "${2}"
svdrpsend.pl MESG "Editing process finished"
EOF
        ;;
     -start)
        VAR=$(($(find "${2}" -printf %k+)0))
        test "$((VAR/1024))" -gt "${MAX_IN_MB}" && {
            echo "Record to large ($((VAR/1024))Mb -gt ${MAX_IN_MB}Mb), use better at..."
            exit 1
        }
        cutinplace "${2}"
        ;;
esac