forked from mean00/avidemux2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtv_record
51 lines (38 loc) · 1.12 KB
/
tv_record
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# record script for nxtvepg
# add the following to nxtvepg's context menu:
# Title: record
# Command: tv_record ${title} ${network} ${start} ${stop} ${relstart} ${duration}
videorecdir=/home/mteske/DVD/videoaufnahmen
title=`echo $1 | sed 's/\///g'`
network=$2
start=$3
stop=$4
relstart=$5
duration=$6
filename="$videorecdir/$network-$title-$start"
logfilename="$filename.log"
echo 2>&1 > "$logfilename" $relstart $duration
# start recording 5 minutes before, if possible
let relstart=$relstart-5
if [ $relstart -lt 0 ] ; then
#let duration=$duration+5+$relstart
relstart=0
else
#enough time. increase duration as well!
let duration=$duration+5
fi
# 5 minutes longer
let duration=$duration+5
echo 2>&1 >> "$logfilename" $relstart $duration
at -m now + $relstart minutes <<EOF
echo >> "$logfilename" "Will kill all running xawdecode/nxtvepg!"
xawdecode_cmd "quit"
sleep 2
killall xawdecode 2>/dev/null
killall nxtvepg 2>/dev/null
killall ffv1rec
echo >> "$logfilename" "see: $filename"
#cd $videorecdir
ffv1rec 2>&1 >> "$logfilename" -t $duration -P "$network" -C MPEG4 -W 704 -H 576 "$filename"
EOF