launch vlc from php using a flow as source

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
panoramix
New Cone
New Cone
Posts: 9
Joined: 23 Nov 2006 12:21

launch vlc from php using a flow as source

Postby panoramix » 23 Nov 2006 17:50

Hi there,
this is what I'm trying to do:

PC1 : stream to PC2 from file to UDP flow
PC2: stream from flow coming from PC1 transcoding to PC3 sendind udp flow
PC3: player

I want to do all this using php code.
On PC1, I execute:
PC1> vlc 80.mpg -I dummy --sout udp://PC2:8099 --loop

On PC2: (php script)
PC2> $process = system("vlc udp://@:8099 -I dummy --sout udp://PC3:8099 &");

code for PC1 works allright written on a console or using PHP system() call.
code for PC2 works allright if I execute if from a console (tried with users root, anotheruser, and even apache [twisted, I know, I changed in /etc/passwd properties for apache so it can have a bash]).
but, if execute code from PC2 using PHP, I get the following in apache logs:
-----------------------------------------------------------------------------------
VLC media player 0.8.4a Janus
[00000271] dummy interface: Using the dummy interface module...
[00000279] access_udp access error: cannot open socket
(process:24364): libgnomevfs-WARNING **: Unable to create ~/.gnome directory: Permission denied
[00000272] main input error: no suitable access module for `udp://@:8080'
[00000267] main playlist: nothing to play
-----------------------------------------------------------------------------------

It seems like it has no permission to open the socket or something like that...
I promise I've searched all the forum, but I could not get any help on this...
I'm using Centos 4, with php PHP 5.1.6 and vlc 0.8.4a
Could anybody give me a hand on this? I would be really thankful, as I've lost some days with this issue...
Thanks so much!

tsr
Blank Cone
Blank Cone
Posts: 25
Joined: 24 Nov 2006 03:47

Postby tsr » 24 Nov 2006 07:01

Code: Select all

su apache mkdir ~/.gnome
?

... just a wild guess.

panoramix
New Cone
New Cone
Posts: 9
Joined: 23 Nov 2006 12:21

Postby panoramix » 24 Nov 2006 11:33

Yeah, I know, but 2 things to that reply:

1. user apache has no home, as it is not meant to login...
2. the line:
(process:24364): libgnomevfs-WARNING **: Unable to create ~/.gnome directory: Permission denied

is just a warning

The real error is this one:
[00000279] access_udp access error: cannot open socket
[00000272] main input error: no suitable access module for `udp://@:8080'

apparently, I am not allowed to create the socket :-(
so even if I created ~/.gnome, I don't think the error would be solved...
Thanks a lot!

andra_vlc
Blank Cone
Blank Cone
Posts: 22
Joined: 02 Nov 2006 17:08

Postby andra_vlc » 24 Nov 2006 12:22

btw, in the line
C2> $process = system("vlc udp://@:8099 -I dummy --sout udp://PC3:8099 &");
there is no 8080 as in
[00000272] main input error: no suitable access module for `udp://@:8080'
but we may guess that it is the input stream.
Which port then you use? Maybe it is already in use (by Apache, for example)?

Have you tried
$process = system("sudo vlc ....
Not that it is a solution, but to see what happens.

panoramix
New Cone
New Cone
Posts: 9
Joined: 23 Nov 2006 12:21

Postby panoramix » 24 Nov 2006 15:13

Hi!
Yes, just realised about that. I took the log from an old logfile; but in the latest one it says:
[00000272] main input error: no suitable access module for `udp://@:8099'
There is no other application running in that port; i've checked with differente port numbers.

Also, if from a console I execute:

#su - apache
$ sudo vlc...

it works ok

But if I execute that from php, I get:
unable to change to sudoers gid: Operation not permitted
:-(

panoramix
New Cone
New Cone
Posts: 9
Joined: 23 Nov 2006 12:21

Postby panoramix » 27 Nov 2006 13:41

setenforce 0 did the trick ;-)
Thanks a lot to everyone here!

csharporbflat
New Cone
New Cone
Posts: 2
Joined: 04 Dec 2006 17:00

Postby csharporbflat » 04 Dec 2006 17:13

THis is I guess 2 seperate questions , I want to do something similar but I am not quite sure how to code it.


first I wan't to be able to use VLAN with PHP to create A VIDEO on demand solution for my website visitors. I want to be able to script it so IT will work automatically and work on any site visitor without me having to do anything. It also needs to be dynamic, IN that the files are stored in a files directory and the names and paths are stored in a MYSQL database. The user will do a search for certain key words or categories, and then the PHP script will select the appropriate video based on what the user typed.

I want to be able to embed the videos into and HTML interface and when the user clicks the appropriate video A popup window will display and stream the video to whatever the users default media player is. Wheather that be Windows Media Player or some MAC equivalant. I also need to to work accrosss browsers and platforms.


Does anyone know the coding on how this would work. And can I have the video default to the users video player regardless on what that player is. Or does all of them have to be played with the VLC player. If anyone can help me with the coding that would be much appreciated. P.S. I am a fairly new programer and I only know the basics of PHP and don't really understand the System code or Java. SO if you could please comment what the code does I would be so gratefull.

Thanks


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 0 guests