Rwrapper.sh
Aus VDR Wiki
(Unterschied zwischen Versionen)
Viking (Diskussion | Beiträge) (→rwrapper.sh) |
(→rwrapper.sh) |
||
Zeile 20: | Zeile 20: | ||
SHAREMARKS="0" # (0=off,1=on,2=upload after cut) | SHAREMARKS="0" # (0=off,1=on,2=upload after cut) | ||
− | # set the online-mode here | + | AUTOCUTTER="0" # (0=off,1=on) |
+ | ACBINDIR=/usr/local/vdr/bin # home of AutoCutter scripts | ||
+ | AUTOCUTLOG=/var/log/autocutter.log # Logfile | ||
+ | |||
+ | # set the noad online-mode here | ||
# 1 means online for live-recording only | # 1 means online for live-recording only | ||
# 2 means online for every recording | # 2 means online for every recording | ||
Zeile 51: | Zeile 55: | ||
# sharemarks | # sharemarks | ||
############ | ############ | ||
− | case $SHAREMARKS in | + | # |
− | + | # Viking : not needed anylonger with sharemarks >= 0.1.4pre4 | |
− | + | # | |
− | esac | + | # case $SHAREMARKS in |
+ | # 1|2) marks2pts $1 "$2" | ||
+ | # ;; | ||
+ | # esac | ||
;; | ;; | ||
after) | after) | ||
Zeile 79: | Zeile 86: | ||
;; | ;; | ||
esac | esac | ||
+ | |||
+ | ############ | ||
+ | # AutoCutter | ||
+ | ############ | ||
+ | case $AUTOCUTTER in | ||
+ | 1) $ACBINDIR/autocutter-edited.sh $* >>$AUTOCUTLOG 2>&1 & | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | |||
;; | ;; | ||
*) | *) |
Version vom 8. Januar 2007, 09:22 Uhr
Vorschlag für ein einfaches Wrapper-Skript, welches vor / nach / editieren einer Aufnahme ausgeführt werden kann.
Übergabe
-r $PATH/rwrapper.sh --record=$PATH/rwrapper.sh
Siehe auch VDR Optionen.
rwrapper.sh
$PATH/rwrapper.sh
#!/bin/sh # # rwrapper.sh # # an example script for use with the '-r' option could look like this: CLIPINC="0" # (0=off,1=on) NOAD="0" # (0=off,1=on,2=online mode) SHAREMARKS="0" # (0=off,1=on,2=upload after cut) AUTOCUTTER="0" # (0=off,1=on) ACBINDIR=/usr/local/vdr/bin # home of AutoCutter scripts AUTOCUTLOG=/var/log/autocutter.log # Logfile # set the noad online-mode here # 1 means online for live-recording only # 2 means online for every recording ONLINEMODE="--online=1" # set additional args for every call here here ADDOPTS="--ac3 --overlap --jumplogo --comments --statisticfile=/var/log/noadstat" case $1 in before) echo "Before recording $2" ############ # clipinc ############ case $CLIPINC in 1) vdrrecinfo.pl $1 "$2" ;; esac ############ # noad ############ case $NOAD in 2) noad $1 $ADDOPTS $ONLINEMODE "$2" ;; esac ############ # sharemarks ############ # # Viking : not needed anylonger with sharemarks >= 0.1.4pre4 # # case $SHAREMARKS in # 1|2) marks2pts $1 "$2" # ;; # esac ;; after) echo "After recording $2" ############ # noad ############ case $NOAD in 1) noad $1 $ADDOPTS "$2" ;; 2) noad $1 $ADDOPTS $ONLINEMODE "$2" ;; esac ;; edited) echo "Edited recording $2" ############ # sharemarks ############ case $SHAREMARKS in 2) marks2pts --non-interactive --upload $1 "$2" ;; esac ############ # AutoCutter ############ case $AUTOCUTTER in 1) $ACBINDIR/autocutter-edited.sh $* >>$AUTOCUTLOG 2>&1 & ;; esac ;; *) echo "ERROR: unknown state: $1" ;; esac ############ # http://vdr-portal.de/board/thread.php?threadid=37211 # ---- # Wenn eine Aufnahme gelöscht wird, # die gerade von noad bearbeitet wird, sollte noad abbrechen. # ---- # Der folgende Schnippsel, überprüft alle 5 Sekunden ob die Verzeichnisse zum PID noch existieren, # falls nicht wird der entsprechende PID gekillt. (benötigt: ps, pidof, screen) ############ # if ! screen -ls | egrep -q noadwatch ; then # screen -dmS noadwatch sh -c "while pidof noad ; do \ # for i in \$(pidof noad) ; do \ # sleep 5s ; ARGS=\$(ps --no-heading -p \$i -o %a) ; \ # if [ ! -d \"\${ARGS##* }\" -a -n \"\${ARGS##* }\" ] ; then \ # if ps -p \$i ; then \ # kill -9 \$i ; \ # fi ; \ # fi ; \ # done ; \ # done" # fi ############ exit $?
Quellen
- INSTALL (VDR)
- rwrapper.sh sharemarks
- scripts von noad