Page 1 of 1

how to integrate a vlc command in php code?

Posted: 10 Nov 2004 16:10
by iboadi
hey,
I'm new with videolan and php. what I want to do is run a vlc command (vlc -vvv one ofmympgs.mpg, which is a local file) from a php page that is on my apache server for local tests.
I used shell_exec(vlc -vvv....) but nothing happens. if I do this into the shell itself, it works
but not from the php page.
to be sure that shell_exec works, I tested shell_exec(vlc --longhelp) and it works.
If anyone can help, please do because I am a bit lost...
Adrian

Posted: 10 Nov 2004 21:00
by dionoea
you should exec "/usr/bin/vlc ..." (can change depending on your config). If you just want to control vlc, note that there is an http interface available.

again...

Posted: 10 Nov 2004 23:54
by iboadi
I've replaced "vlc -vvv..." with "/usr/bin/vlc" and it still does nothing. I've regarded the /usr/bin and vlc is insiden so I don't think it's because of the configuration

php and vlc , under debian

Posted: 27 Feb 2007 00:18
by daouid
Hello, i am having exactly the same problem,

im trying to code a VOD server using php and vlc, i've allready got it working great under windows, but i cannot make it work on debian for some reason.

this is the command my php page generates, but it doesnt work from the page,

if i run it in a terminal it works fine !!!

Code: Select all

/usr/bin/vlc -v -I http --http-host 192.168.1.123:7001 --extraintf=logger /home/vod/video/some.avi :sout#transcode{vcodec=h264,acodec=mp4a,vb=144,ab=8,channels=2,width=352,height=288,fps=17,scale=0.5}:standard{access=http,mux=ts,url=192.168.1.123:7000}

Posted: 27 Feb 2007 00:51
by daouid
ok the problem was coming from PHP who was waiting for the shell_exec command to end.

to solve this issue , i used the following method:

where $cmd is the vlc command used

$runvlcbg = shell_exec("$cmd -d /dev/null");

echo $runvlcbg;
[/code]

Posted: 02 Mar 2007 23:28
by fayya
daouid, I've tried your solution and added "d /dev/null" at the back of the command, but it is still not streaming properly through php, you mind putting out your php code so I can give that a shot, thanks in advance. :D