view do-record.sh.pt1 @ 105:29e7a40e6587

operator == will fail on ubuntu where dash has been used as the sh equivalent.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 09 Mar 2010 05:42:26 +0900
parents 82aac84c3665
children 74a174a245d2
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 ;;
    *)
	if [ -z $SID ]; then
	    SID='hd'
	fi ;;
esac

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