Problem: PHP starting VLC using proc_open()

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
lokrain
New Cone
New Cone
Posts: 6
Joined: 09 Feb 2007 17:09

Problem: PHP starting VLC using proc_open()

Postby lokrain » 09 Feb 2007 17:33

1. PHP Code to start a stream.

Code: Select all

$path = "vlc -vvv --color --ttl 12 --ts-es-id-pid --programs=7,12 dvb: --dvb-frequency=11596000 --dvb-srate=28800000 --dvb-voltage=13 --sout-standard-access=udp --sout-standard-mux=ts --sout '#duplicate{dst=standard{dst=239.255.12.42,port=1239}, select=program=7,dst=standard{dst=239.255.12.43,port=1244}, select=program=12}' -d"; $process = proc_open( $path, $this->descriptorspec, this->pipes, '/var/www/html', NULL ); if( is_resource( $process ) ) { // We get in here so everything must be fine but!
2. Let run PS program
14322 ? S 0:00 vlc -vvv --color --ttl 12 --ts-es-id-pid --programs=7,12 dvb: --dvb-frequency=11596000 --dvb-srate=28800000 --dvb-voltage=13 --sout-standard-access=udp --sout-standard-mux=ts --sout #duplicate{dst=standard{dst=239.255.12.42,port=1239}, select=program=7,dst=standard{dst=239.255.12.43,port=1244}, select=program=12} -d
14323 ? Ssl 0:00 vlc -vvv --color --ttl 12 --ts-es-id-pid --programs=7,12 dvb: --dvb-frequency=11596000 --dvb-srate=28800000 --dvb-voltage=13 --sout-standard-access=udp --sout-standard-mux=ts --sout #duplicate{dst=standard{dst=239.255.12.42,port=1239}, select=program=7,dst=standard{dst=239.255.12.43,port=1244}, select=program=12} -d
Interesting 2 processes started. 14322 by root and 14323 by apache.

3. Let's check vlc file permissions:

-rwsrwsrwx 1 root 1187080 Oct 7 03:03 /usr/bin/vlc

I have made vlc +s so I can access the dvb-s card. ( Error if not +s ).

4. Ok. We have no stream now!

5. Sounds stupid but let's run the command shown in (2.) which we got from starting as we call the php, and using ps program.

6. I paste exactly the same not working line as process 14322 on a shell.

7. Run it.

8. WTF!? IT IS STREAMING CORRECTLY!?

Do you know any problems with the vlc syntax and proc_open function in php? I mean with symbols like ' or "

Thanks in advance

muse
Blank Cone
Blank Cone
Posts: 30
Joined: 18 Jul 2006 10:31
VLC version: 0.86c
Operating System: Linux
Location: Italy
Contact:

Postby muse » 14 Feb 2007 16:53

i have a similar problem.. look here :

viewtopic.php?t=30993

:roll:
The only winning move is not to play

silid
New Cone
New Cone
Posts: 8
Joined: 14 Apr 2007 21:16

Postby silid » 14 Apr 2007 21:27

the problem is probably not vlc file permissions but apache permissions

you should add your apache user to the video group in /etc/groups

you may need to restart apache or your computer before it works.

si


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 5 guests