Sure.
One script is the record.cgi which get's it's data by GET, checks a DB,
returns the values and passes them to a second script.
###############-------SKRIPT
START--------------###############---------------------###############------
---------------
#!/usr/bin/perl
# PERL MODULES WE WILL BE USING
use DBI;
use DBD::mysql;
use CGI qw(:standard);
use LWP::Simple;
use Shell;
# HTTP HEADER
print "Content-type: text/html \n\n";
# read in our parameters
$requested = $ENV{'QUERY_STRING'};
# Here the script checks epg-data for the exact show an returns the values
(cut because quite long and I think not necessary for this problem)
system("sh /var/www/tv/script/tvrecord -c $sendercode -n \"$title\" -s
\"$Hstart $datum\" -e \"$Hstop\"");
}
###############-------SKRIPT
STOP--------------###############---------------------###############-------
--------------
The record.cgi starts the second script - tvrecord.
This is the tvrecord shell script.
I've got it from the ivtv example script pages and edited it a little bit.
###############-------SKRIPT
START--------------###############---------------------###############------
---------------
#!/bin/bash
#function usage () {
# echo "Usage: `basename $0` -c channel -n \"showname\" -s start_time
[-t] [-e end_time |-d duration]"
#}
RECTIME="?"
ENDTIME="?"
TIMEFORMAT=""
while getopts c:d:n:s:e:h:t o
do case "$o" in
c) CHANNEL="$OPTARG";;
d) RECTIME="$OPTARG";;
n) SHOWNAME="$OPTARG";;
s) STARTTIME="$OPTARG";;
e) ENDTIME="$OPTARG";;
t) TIMEFORMAT="-t";;
h) usage
exit 1;;
esac
done
if [ $ENDTIME != "" ] && [ $ENDTIME != "?" ] ; then
at $TIMEFORMAT $STARTTIME << EoF
/var/www/tv/script/ivtv-tune-web --device=/dev/video0 -teurope-west -c
$CHANNEL & cat /dev/video0
>/storage-center/media/video/Recorder/"$SHOWNAME".mpg & ech$
EoF
at $TIMEFORMAT $ENDTIME << EOF
ps -u www-data | grep cat | awk '{print $1}' | xargs kill -9
EOF
else
at $TIMEFORMAT $STARTTIME << EoF
/var/www/tv/script/ivtv-tune-web --device=/dev/video0 -teurope-west -c
$CHANNEL & cat /dev/video0 >
/storage-center/media/video/Recorder/"$SHOWNAME".mpg & sl$
ps -u www-data | grep cat | awk '{print $1}' | xargs kill -9
EoF
Fi
###############-------SKRIPT
STOP--------------###############---------------------###############-------
--------------
These scripts work as far as they create a at entry. This entry starts and
stops the recording. But what doesn't wort is, that the channels are
changed. So the system only records that channel, which has been set last.
Kind regards,
Fabian
-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Marco Schuster
Gesendet: Samstag, 5. April 2008 19:46
An: User discussion about IVTV
Betreff: Re: [ivtv-users] ivtv-tune call from apache
[EMAIL PROTECTED] schrieb:
> Hey guys,
>
> I'm new to this Mailinglist so I hope I've done everything right.
> I'm running Ubuntu Gutsy Gibbon and a Hauppauge PVR350 installed.
Everything works fine. Now I decided to write a little cgi script, so I can
schedule recordings through the web. Even this works except one thing: I
can't change Channels. When I run the command "/var/www/tv/script/ivtv-tune
--device=/dev/video0 -teurope-west -c $CHANNEL" nothing happens.
> I swichted users and tried as www-data. Doing so I receive this error
message: "Segmentation fault".
>
> Do you have any hint for me, how I can realize switching channels via my
cgi script?
can you please give the full cgi script so we can look into it?
thanks,
marco
_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users
_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users