/[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

Annotation of /record-stream.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21 - (hide annotations)
Sat Oct 31 13:54:17 2009 UTC (14 years, 5 months ago) by dpavlin
File MIME type: application/x-sh
File size: 755 byte(s)
use $duration

1 dpavlin 8 #!/bin/sh
2    
3     # based on http://www.turtlespond.net/scripts/dvb-t.html
4    
5     adapter=$1
6     channel=$2
7 dpavlin 13 duration=$3
8 dpavlin 8
9 dpavlin 21 if [ -z "$adapter" -o -z "$channel" -o -z "$duration" ] ; then
10 dpavlin 8 echo "Usage: $0 adapter_nr Channel_name duration"
11     exit 1;
12     fi
13    
14 dpavlin 13 dir=/mnt/tv/
15 dpavlin 8 uid=`date +%Y-%m-%d_%H:%M:%S`
16 dpavlin 9 file=$dir/$uid-$channel.ts
17 dpavlin 8
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 dpavlin 13 echo "record $duration s"
33     sleep $duration
34 dpavlin 8
35     kill $TZAP_PID
36     kill $STREAM_PID
37    
38     ls -al $file

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26