Rwrapper.sh

Aus VDR Wiki
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
K
Zeile 9: Zeile 9:
 
# 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=$PATH:/usr/local/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)
  
case "$1" in
+
# set the online-mode here
    before)
+
# 1 means online for live-recording only
          echo "Before recording $2"
+
# 2 means online for every recording
          noad $1 "$2" --ac3 --overlap --jumplogo --comments --online=1
+
ONLINEMODE="--online=1"
          vdrrecinfo.pl $1 "$2"
+
 
          marks2pts $1 "$2"
+
# set additional args for every call here here
          ;;
+
ADDOPTS="--ac3 --overlap --jumplogo --comments --statisticfile=/var/log/noadstat
    after)
+
 
          echo "After recording $2"
+
case $1 in
          nice -n 19 noad $1 "$2" --ac3 --overlap --jumplogo --comments --online=1 --statisticfile=/var/log/noadstat
+
    before)
          ;;
+
echo "Before recording $2"
    edited)
+
 
          echo "Edited recording $2"
+
############
          marks2pts -upload $1 "$2"
+
# clipinc
          ;;
+
############
    *)
+
case $CLIPINC in
          echo "ERROR: unknown state: $1"
+
    1) vdrrecinfo.pl $1 "$2"
          ;;
+
;;
 +
esac
 +
 
 +
############
 +
# noad
 +
############
 +
case $NOAD in
 +
    2) noad $1 "$2" $ADDOPTS $ONLINEMODE
 +
;;
 +
esac
 +
 
 +
############
 +
# sharemarks
 +
############
 +
case $SHAREMARKS in
 +
    1|2) marks2pts $1 "$2"
 +
  ;;
 +
esac
 +
;;
 +
    after)
 +
echo "After recording $2"
 +
 
 +
############
 +
# noad
 +
############
 +
case $NOAD in
 +
    1) noad $1 "$2" $ADDOPTS
 +
;;
 +
    2) noad $1 "$2" $ADDOPTS $ONLINEMODE
 +
;;
 +
esac
 +
;;
 +
    edited)
 +
echo "Edited recording $2"
 +
 
 +
############
 +
# sharemarks
 +
############
 +
case $SHAREMARKS in
 +
    2) marks2pts -upload $1 "$2"
 +
;;
 +
esac
 +
;;
 +
    *)
 +
echo "ERROR: unknown state: $1"
 +
;;
 
esac
 
esac
 +
 +
############
 +
#if ! screen -ls | egrep -q noadwatch ; then
 +
#    screen -dmS noadwatch sh -c "while pidof noad ; do \
 +
# for i in \$(pidof noad) ; do \
 +
#     sleep 5s ; unset ARGS ; IFS=' ' ARGS=( \$(ps --no-heading -np \$i) ) ; \
 +
#     if [ ! -d \"\${ARGS[6]}\" -a \"\${ARGS[6]:0:1}\" = / ] ; then \
 +
# if ps -p \$i ; then \
 +
#     kill -9 \$i ; \
 +
# fi ; \
 +
#     fi ; \
 +
# done ; \
 +
#    done"
 +
#fi
 +
############
 
</pre>
 
</pre>
 
}}
 
}}
  
 
[[Kategorie:Skripte]]
 
[[Kategorie:Skripte]]

Version vom 21. April 2006, 19:55 Uhr

Skript für VDR.

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)

# set the 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 "$2" $ADDOPTS $ONLINEMODE
		;;
	esac

	############
	# sharemarks
	############
	case $SHAREMARKS in
	     1|2) marks2pts $1 "$2"
		  ;;
	esac
	;;
     after)
	echo "After recording $2"

	############
	# noad
	############
	case $NOAD in
	     1) noad $1 "$2" $ADDOPTS
		;;
	     2) noad $1 "$2" $ADDOPTS $ONLINEMODE
		;;
	esac
	;;
     edited)
	echo "Edited recording $2"

	############
	# sharemarks
	############
	case $SHAREMARKS in
	     2) marks2pts -upload $1 "$2"
		;;
	esac
	;;
     *)
	echo "ERROR: unknown state: $1"
	;;
esac

############
#if ! screen -ls | egrep -q noadwatch ; then
#    screen -dmS noadwatch sh -c "while pidof noad ; do \
#	for i in \$(pidof noad) ; do \
#	    sleep 5s ; unset ARGS ; IFS=' ' ARGS=( \$(ps --no-heading -np \$i) ) ; \
#	    if [ ! -d \"\${ARGS[6]}\" -a \"\${ARGS[6]:0:1}\" = / ] ; then \
#		if ps -p \$i ; then \
#		    kill -9 \$i ; \
#		fi ; \
#	    fi ; \
#	done ; \
#    done"
#fi
############