how to integrate a vlc command in php code?

About encoding, codec settings, muxers and filter usage
iboadi
New Cone
New Cone
Posts: 8
Joined: 10 Nov 2004 15:57

how to integrate a vlc command in php code?

Postby iboadi » 10 Nov 2004 16:10

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

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Postby dionoea » 10 Nov 2004 21:00

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.

iboadi
New Cone
New Cone
Posts: 8
Joined: 10 Nov 2004 15:57

again...

Postby iboadi » 10 Nov 2004 23:54

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

daouid
New Cone
New Cone
Posts: 4
Joined: 20 Aug 2006 20:52

php and vlc , under debian

Postby daouid » 27 Feb 2007 00:18

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}

daouid
New Cone
New Cone
Posts: 4
Joined: 20 Aug 2006 20:52

Postby daouid » 27 Feb 2007 00:51

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]

fayya
New Cone
New Cone
Posts: 3
Joined: 24 Oct 2006 04:03

Postby fayya » 02 Mar 2007 23:28

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


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 21 guests