Page 1 of 1

Problem: PHP starting VLC using proc_open()

Posted: 09 Feb 2007 17:33
by lokrain
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

Posted: 14 Feb 2007 16:53
by muse
i have a similar problem.. look here :

viewtopic.php?t=30993

:roll:

Posted: 14 Apr 2007 21:27
by silid
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