/[mplayer-eee-tv]/record-stream.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /record-stream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8 - (show annotations)
Tue Oct 27 15:20:22 2009 UTC (14 years, 5 months ago) by dpavlin
File MIME type: application/x-sh
File size: 771 byte(s)
record using tzap and cat

1 #!/bin/sh
2
3 # based on http://www.turtlespond.net/scripts/dvb-t.html
4
5 adapter=$1
6 channel=$2
7 time=$3
8
9 if [ -z "$adapter" -o -z "$channel" -o -z "$time" ] ; then
10 echo "Usage: $0 adapter_nr Channel_name duration"
11 exit 1;
12 fi
13
14 dir=/mnt/usb/
15 uid=`date +%Y-%m-%d_%H:%M:%S`
16 file=$dir/$channel-$uid.ts
17
18 # If frontend0 is active, kill it.
19 fuser -k /dev/dvb/adapter$adapter/frontend0
20
21 # Tune in and lock channel
22 tzap -a $adapter -c channels.conf -r "$channel" &
23 # Then get the pid of tzap
24 TZAP_PID=$!
25
26 cat /dev/dvb/adapter$adapter/dvr0 > "$file" &
27 STREAM_PID=$!
28
29 trap "kill $TZAP_PID $STREAM_PID" 1 2 15
30
31 # Set duration of recording after converting minutes to seconds
32 DURATION=$(($time*60))
33 echo "record $DURATION s"
34 sleep $DURATION
35
36 kill $TZAP_PID
37 kill $STREAM_PID
38
39 ls -al $file

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26