view do-record.sh.pt1 @ 117:f5d58cf2842f

merged with upstream
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 14 Mar 2010 16:31:50 +0900
parents 74a174a245d2
children 190a3c46611d
line wrap: on
line source

#!/bin/sh
echo "CHANNEL : $CHANNEL"
echo "DURATION: $DURATION"
echo "OUTPUT  : $OUTPUT"
echo "TUNER : $TUNER"
echo "TYPE : $TYPE"
echo "MODE : $MODE"
echo "SID  : $SID"

RECORDER=/usr/local/bin/recpt1

# fail safe
case $CHANNEL in
    101|102|191|192|193)
	if [ $SID = 'hd' ]; then
	    SID=$CHANNEL
	fi ;;
esac
if [ -z $SID ]; then
    SID='hd'
fi

if [ ${MODE} = 0 ]; then
   # MODE=0では必ず無加工のTSを吐き出すこと
   $RECORDER --b25 --strip $CHANNEL $DURATION ${OUTPUT} >/dev/null
elif [ ${MODE} = 1 ]; then
   # 目的のSIDのみ残す
   $RECORDER --b25 --strip --sid $SID $CHANNEL $DURATION ${OUTPUT} >/dev/null
elif [ ${MODE} = 2 ]; then
   $RECORDER $CHANNEL $DURATION ${OUTPUT}.tmp.ts --b25 --strip
   ffmpeg -i ${OUTPUT}.tmp.ts ... 適当なオプション ${OUTPUT}
fi