Rwrapper.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(rwrapper.sh)
 
(40 dazwischenliegende Versionen von 19 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 +
Vorschlag für ein einfaches ''Wrapper''-Skript, welches ''vor / nach / editieren'' einer Aufnahme ausgeführt werden kann.
 +
 +
==Übergabe==
 +
-r [[Struktur|$PATH]]/rwrapper.sh
 +
--record=[[Struktur|$PATH]]/rwrapper.sh
 +
 +
Siehe auch [[VDR Optionen]].
 +
 +
==rwrapper.sh==
 +
{{Box Datei | [[Struktur|$PATH]]/rwrapper.sh |
 
<pre>
 
<pre>
 
#!/bin/sh
 
#!/bin/sh
 
#
 
#
# rwrapper.sh - v.0.1
+
# rwrapper.sh
 
#
 
#
 
# an example script for use with the '-r' option could look like this:
 
# an example script for use with the '-r' option could look like this:
  
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
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,2=manual edit)
  
case "$1" in
+
# set the noad online-mode here
    before)
+
# 1 means online for live-recording only
        echo "Before recording $2"
+
# 2 means online for every recording
        test -x /etc/vdr/scripts/clipinc/vdrrecinfo.pl && {
+
ONLINEMODE="--online=1"
            /etc/vdr/scripts/clipinc/vdrrecinfo.pl "$@"
+
 
        }
+
# set additional noad args for every call here here (not used by AutoCutter, see README)
test -x /usr/local/bin/marks2pts && {
+
ADDOPTS="--ac3 --overlap --jumplogo --comments --statisticfile=/var/log/noadstat"
    echo "/usr/local/bin/marks2pts $1 \"$2\"" | at now
+
 
}
+
# AutoCutter Options - see AutoCutter README/INSTALL for more
        ;;
+
ACBINDIR=/usr/local/vdr/bin
    after)
+
NOADQ=/var/spool/vdrconvert/noad
        echo "After recording $2"
+
AUTOCUTLOG=/var/log/autocutter.log
         test -x /usr/local/bin/noad && {
+
 
            /usr/local/bin/noad nice --background \
+
case $1 in
                                    --jumplogo \
+
    before)
                                    --ac3 \
+
echo "Before recording $2"
                                    --overlap \
+
 
                                    --OSD \
+
############
                                    --statisticfile=/var/log/noadstat "$@"
+
# clipinc
        }
+
############
         ;;
+
case $CLIPINC in
    edited)
+
    1) vdrrecinfo.pl $1 "$2"
echo "Edited recording ${2}"
+
;;
test -x /usr/local/bin/marks2pts && {
+
esac
    echo "/usr/local/bin/marks2pts -upload $1 \"$2\"" | at now
+
 
}
+
############
        ;;
+
# noad
    *)
+
############
        echo "ERROR: unknown state: $2"
+
case $NOAD in
        ;;
+
    2) noad $1 $ADDOPTS $ONLINEMODE "$2"
 +
;;
 +
esac
 +
 
 +
;;
 +
    after)
 +
echo "After recording $2"
 +
 
 +
         ############
 +
        # noad
 +
        ############
 +
        case $NOAD in
 +
            1) noad $1 $ADDOPTS "$2"
 +
                ;;
 +
            2) noad $1 $ADDOPTS $ONLINEMODE "$2"
 +
                ;;
 +
        esac
 +
 
 +
        ############
 +
        # AutoCutter
 +
        ############
 +
        case $AUTOCUTTER in
 +
            1|2) grep -q "$2" $NOADQ 2>/dev/null
 +
                if [ $? -ne 0 ]; then
 +
                  printf "%s " "$2" >>$NOADQ
 +
                  # Start NoAD Scan in 7 min.
 +
                  echo "printf '\n' >>$NOADQ" | at now+7 min
 +
                fi
 +
              ;;
 +
         esac
 +
;;
 +
    edited)
 +
echo "Edited recording $2"
 +
 
 +
############
 +
# sharemarks
 +
############
 +
case $SHAREMARKS in
 +
      2) marks2pts --non-interactive --upload $1 "$2"
 +
;;
 +
esac
 +
 
 +
############
 +
# AutoCutter
 +
############
 +
case $AUTOCUTTER in
 +
      2) $ACBINDIR/autocutter-edited.sh $* >>$AUTOCUTLOG 2>&1 &
 +
;;
 +
esac
 +
 
 +
;;
 +
    *)
 +
echo "ERROR: unknown state: $1"
 +
;;
 
esac
 
esac
 +
 +
exit $?
 
</pre>
 
</pre>
 +
}}
 +
 +
==Quellen==
 +
* ''INSTALL'' (VDR)
 +
* ''rwrapper.sh'' [[sharemarks]]
 +
* ''scripts'' von [[noad]]
  
[[Kategorie:Scripts]]
+
[[Kategorie:Skripte]]

Aktuelle Version vom 22. Oktober 2007, 19:36 Uhr

Vorschlag für ein einfaches Wrapper-Skript, welches vor / nach / editieren einer Aufnahme ausgeführt werden kann.

[Bearbeiten] Übergabe

-r $PATH/rwrapper.sh
--record=$PATH/rwrapper.sh

Siehe auch VDR Optionen.

[Bearbeiten] rwrapper.sh

Datei
$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,2=manual edit)

# set the noad online-mode here
# 1 means online for live-recording only
# 2 means online for every recording
ONLINEMODE="--online=1"

# set additional noad args for every call here here (not used by AutoCutter, see README)
ADDOPTS="--ac3 --overlap --jumplogo --comments --statisticfile=/var/log/noadstat"

# AutoCutter Options - see AutoCutter README/INSTALL for more
ACBINDIR=/usr/local/vdr/bin
NOADQ=/var/spool/vdrconvert/noad
AUTOCUTLOG=/var/log/autocutter.log

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

	;;
     after)
	echo "After recording $2"

        ############
        # noad
        ############
        case $NOAD in
             1) noad $1 $ADDOPTS "$2"
                ;;
             2) noad $1 $ADDOPTS $ONLINEMODE "$2"
                ;;
        esac

        ############
        # AutoCutter
        ############
        case $AUTOCUTTER in
             1|2) grep -q "$2" $NOADQ 2>/dev/null
                 if [ $? -ne 0 ]; then
                   printf "%s " "$2" >>$NOADQ
                   # Start NoAD Scan in 7 min.
                   echo "printf '\n' >>$NOADQ" | at now+7 min
                 fi
               ;;
        esac
	;;
     edited)
	echo "Edited recording $2"

	############
	# sharemarks
	############
	case $SHAREMARKS in
	      2) marks2pts --non-interactive --upload $1 "$2"
		;;
	esac

	############
	# AutoCutter
	############
	case $AUTOCUTTER in
	      2) $ACBINDIR/autocutter-edited.sh $* >>$AUTOCUTLOG 2>&1 &
		;;
	esac

	;;
     *)
	echo "ERROR: unknown state: $1"
	;;
esac

exit $?


[Bearbeiten] Quellen