473,287 Members | 1,880 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Launch recording from PHP

Hello,

I'm working on a small web-script that would allow me to remotely setup
recordings to my tv-tuner (on my linux box). The idea is simple, but I'm
unsure how to accomplish it.

The idea: Using PHP generated www-page user could set mencoder to start
recording at some specified time. The command is put to the crontab
using linux "at" command.

Problem is that I don't think it is an good idea to grant www-data user
(that runs apache/php process) to tinker with audio and video hardware.
Even worse idea is to grant www-user rights to use "at" command.

I use mysql database to store some recording information and thus I
could use mysql TRIGGER-functionality to put the recording command to
crontab, however at that case I should give mysql user video and audio
priviledges. Again - not so good.

Can anybody give an good advice how to do this wihtout dangering system
security?

yours,
Jussi Rasku
Oct 18 '05 #1
3 2162
The idea: Using PHP generated www-page user could set mencoder to start
recording at some specified time. The command is put to the crontab
using linux "at" command. Problem is that I don't think it is an good idea to grant www-data user
(that runs apache/php process) to tinker with audio and video hardware.
Even worse idea is to grant www-user rights to use "at" command.


Set up a cron job to periodically run a script that will perform the
action you want. The script should check the database for any work to
do at this time, and if there is nothing to do then it just exits.
Adjust the frequency of the cron job so that it matches the accuracy of
recording start time you require - say, every 5 minutes.

This way, no-one else has to be given permissions to add "at" commands
or mess with the hardware.

---
Steve

Oct 18 '05 #2
Can't you use some in-between storage?
Like: the webpage puts a record in the database,
Another process regularly checks for new entries in the database and
acts if it finds a new one.
Using this "token passing", the web process needs no access except to
the database and the tv "listener" needs no web access.

Best regards

Jussi Rasku wrote:
Hello,

I'm working on a small web-script that would allow me to remotely setup
recordings to my tv-tuner (on my linux box). The idea is simple, but I'm
unsure how to accomplish it.

The idea: Using PHP generated www-page user could set mencoder to start
recording at some specified time. The command is put to the crontab
using linux "at" command.

Problem is that I don't think it is an good idea to grant www-data user
(that runs apache/php process) to tinker with audio and video hardware.
Even worse idea is to grant www-user rights to use "at" command.

I use mysql database to store some recording information and thus I
could use mysql TRIGGER-functionality to put the recording command to
crontab, however at that case I should give mysql user video and audio
priviledges. Again - not so good.

Can anybody give an good advice how to do this wihtout dangering system
security?

yours,
Jussi Rasku

Oct 18 '05 #3
Dikkie Dik wrote:
Can't you use some in-between storage?
Like: the webpage puts a record in the database,
Another process regularly checks for new entries in the database and
acts if it finds a new one.
Using this "token passing", the web process needs no access except to
the database and the tv "listener" needs no web access.


Thanks for the tip, altough I don't like the idea of polling. However it
seems its the easiest way to do this nicely.

Perhaps I will do some kind of semaphore file the polling script checks
and the php script sets. That way there is no need for the polling sript
to handle the database everytime (shouldn't take too much system resources).

-Jussi
Oct 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Manfred Schwab | last post by:
Recording messages and print statements in a textfile during program execution. Is there a similar command to redirect errormessages or print statements into a standart asciifile during...
0
by: ajac | last post by:
In the windows xp system the sound recording system give us only 1 minute of recording time. I would like to get the "recording time Length " to the maximum. please let me know Urgently. ...
6
by: Dovelet | last post by:
Hi all, I would like to write DOS program to change the MS Windows Sound Recording source. When I run it with the parameter, it will change the recording source as follow: C:\> abc.exe...
0
by: Mad Scientist | last post by:
Has anyone been able to play back a mono WAV while recording, and saving the results as a stereo WAV (left channel = first mono recording, right channel = new recording)? Any sample code would...
1
by: Sakharam Phapale | last post by:
Hi All, I am developing an application like sound recorder. While recording if there is a silence for more than given time (say 5 seconds), Recording should be paused.
0
by: The Woo | last post by:
After years of dreaming, finally have my Access db set up to dial a highlighted phone number at my office (AT&T Merlin system, no less). My question: are there folks here familiar with any good...
1
by: zhangzhi | last post by:
HI£º i have a big problem about audio recording. my boss wanna a application of audio monitor, and he wanna it will detect voice and start recording automatically, avoiding recording silences....
8
by: jer | last post by:
I've noticed you've helped a lot of people that were trying to do sound recording through VB.net. I'm searched all over the internet, and I'm still having problems write sound to a wav file. My...
0
by: =?Utf-8?B?TmFndGFnZXQ=?= | last post by:
Hi, I am looking for an old MSDN Webcast recording. Here are the details: Recording Subject: MSDN Webcast: Dave's Top Ten Ways To Secure Your Desktop App Recording ID: 1032250371...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.