VLC PHP Issues

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
Andre
New Cone
New Cone
Posts: 2
Joined: 02 Nov 2007 13:22

VLC PHP Issues

Postby Andre » 12 Dec 2007 15:59

Hey,

I am trying to create an "on-demand streaming server"
For each client that logs on, I want to start a new vlc

Code: Select all

$cmd = "vlc --sout udp:" . $ip . ":1234 -I rc --rc-host 0.0.0.0:9568"; echo (shell_exec ($cmd));
I cannot launch vlc with the remote control interface listening on a socket
when launching it from something else then a bash shell.

I've also tried a python script but that doesn't work either, while
starting vlc with the same parameters from a bash shell does work.

Can anyone well me what is going wrong here?

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 12 Dec 2007 16:56

you should use VLM system to start only one instance of VLC and then control each 'channel' via php

its better for performance
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 13 Jan 2008 02:56

revolunet,


can you show an example of how to set that up?

Andre
New Cone
New Cone
Posts: 2
Joined: 02 Nov 2007 13:22

Re: VLC PHP Issues

Postby Andre » 13 Jan 2008 09:19

Status Update: The problem was solved by adding the --fake-tty option to the command line.

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 13 Jan 2008 20:54

please look at http://wiki.videolan.org/VLM for details
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 29 Jan 2008 07:38

i have but if you could give us a working example on how to do this it would be helpful as the docs are confusing

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 29 Jan 2008 10:41

ok

i wont write a step by step tuto but some ways to do that :

in this example we'll use HTTP to control our VLC process and VLM instances. you can use telnet too

First, launch a VLC process with http admin interface :

Code: Select all

vlc --intf=http --http-host=127.0.0.1:8080
check on the machine if on http://localhost:8080 you have the vlc admin interface running

then, from PHP, you can do something like :

Code: Select all

<?php $http_admin_uri = "http://127.0.0.1:8080"; $url = $http_admin_uri.'/requests/vlm_cmd.xml?command=new test1 broadcast enabled input "D:\strip.mpeg" output #transcode{vcodec=mp1v,vb=512,scale=1,acodec=mpga,ab=128}:std{access=http,mux=ps,dst=0.0.0.0:9000}'; echo file_get_contents($url); $url2 = $http_admin_uri."/requests/vlm_cmd.xml?command=control test1 play"; echo file_get_contents($url2); ?>
this will first prepare the VLM broadcast (file=d:\strip.mpeg, dst=http on port 9000)
and then launch this stream

a little bonus : with apache, mod_rewrite and mod_proxy, you can proxify the resulting stream, this way, no need to open port 9000

in VLC, do dst=127.0.0.1:9000
in Apache, do the transparent proxy in a .htaccess :

RewriteRule vlcproxy/(.*) http://127.0.0.1:$1 [P]

last step is to affect one port by user ;)

to know other VLM commands, checks the Wiki or sniff http with FireBug when you play with the http "VLM admin interface"

let us know and... ENJOY ;)
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 01 Feb 2008 20:18

revolunet


i posted another PHP question and was wondering if you could shed some light if that was possible?

also was wondering if you had an example of your mozilla plugin with out controls?

also how do i add a local file or a webcam to view?

i have videos located like this:

Code: Select all

C:\Documents and Settings\oem\Escritorio\videos\rambo.avi
i tried that but was wondering if the spaces caused a issue or maybe cause i'm using version 0.8.6d

what about a webcam ? can that be viewed?

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 01 Feb 2008 20:25

post me the link to your question, i'll try

for the demo, see : http://vlc.revolunet.com

if your question is about WITHOUT controls, see http://code.revolunet.com/VLCobject/EN

To experiment with VLM, use standard VLM HTTP admin interface and sniff with Firebug. You need to send the same commands, but from php.

Webcam can be share as any stream
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 01 Feb 2008 20:33

viewtopic.php?f=16&t=44009

can you tell me why i cant show a local file?

what about a webcam how would i put that into the MRL?

is it possible to add a browse for video files and check for video and audio in the case of webcam , so visitors can do without know the location and change video and audio sources?

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 02 Feb 2008 18:11

revolunet

i also added this post, hopefully to help people when searching

viewtopic.php?f=16&t=44011

thanks so much for you help, its tough getting responses on this board. i have a list of pver 20 posts that haven't been responded too on my questions So i really appreciate all your help

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 04 Feb 2008 15:51

can you tell me why i cant show a local file?
where ? in the VLC plugin ? you can, why not ?
what about a webcam how would i put that into the MRL?
it depends of the webcam and how you can access it; is it standalone or connected to your pc ? which OS ?

i use an AXIS webcam and can access it via http://webcam/..../live.swf
is it possible to add a browse for video files and check for video and audio in the case of webcam , so visitors can do without know the location and change video and audio sources?
i dont understand your sentence.... im french so please speak clear english

yes we can add a 'browse' button in the html page but it will show THEIR local files
yes you can make a webcam button that open the webcams when you click it
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 04 Feb 2008 19:41

it depends of the web cam and how you can access it; is it standalone or connected to your pc ? which OS ?
would be connected to a persons PC and win xp

yes we can add a 'browse' button in the html page but it will show THEIR local files
do you have an example of this?

yes you can make a web cam button that open the web cams when you click it
and what about this? any working examples?

I have searched the forums and the Wiki for either of these things actually being used or have a working example. And have found nothing.

Thanks for your help

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 04 Feb 2008 19:59

would be connected to a persons PC and win xp
1) you should see http://wiki.videolan.org/Documentation: ... DirectShow
do you have an example of this?
2) i've just added this feature to my demo page : http://vlc.revolunet.com

3) On the demo page, there's also a link to a webcam (click icon webcam) that opens a webcam somehere on the net. But it uses an axis standalone webcam. You can do the same as any other source when you'll know the 1)
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 04 Feb 2008 22:16

great, i got it to work with IE but not in Firefox...

your other files work just fine but not the local ones.

what i wanted to do with the directshow is click a button like browse and it will browse for webcams on your pc or switch between ones you have like you can in the flash player

hope that is easier to understand for you

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 05 Feb 2008 11:12

i think its not possible for the moment to list the local webcams from a web page
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 05 Feb 2008 13:11

for Firefox it seems its a little but with path encoding

D:\test_rambo.mpeg doesnt work but D:\\test_rambo.mpeg does
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dynamitemedia
Blank Cone
Blank Cone
Posts: 60
Joined: 15 Jul 2007 23:30

Re: VLC PHP Issues

Postby dynamitemedia » 22 Mar 2008 06:46

im having some huge issues with this in IE 6

it keeps crashing.

has something changed?

i had went back to check this over as i am interested in possibly adding this to my page.

also was wondering something, how easy is to customize the controls?

taking out the french for one as it is confusing to some people. what about colors etc? maybe a web 2.0 look

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 23 Mar 2008 11:59

Which VLC plugin version do you use ?

I use IE6 and i have no special problems in 'normal' use. The official uri is : http://code.revolunet.com/VLCcontrols/EN (check if the demos work)

If you know javascript you can easyly tweak the library, modify control and style, and the buttons are images so you can change what you want.

I plan an update soon so tell me you feature requests
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dadedvd
New Cone
New Cone
Posts: 7
Joined: 05 Jun 2008 14:51

Re: VLC PHP Issues

Postby dadedvd » 01 Jul 2008 17:34

Hi!
with this code

Code: Select all

<?php $http_admin_uri = "http://localhost:8080"; $url = $http_admin_uri.'/requests/vlm_cmd.xml?command=new test1 broadcast enabled input "C:\video\legione.avi" output #transcode{vcodec=mp1v,vb=512,scale=1,acodec=mpga,ab=128}:std{access=http,mux=ps,dst=0.0.0.0:9000}'; echo file_get_contents($url); $url2 = $http_admin_uri."/requests/vlm_cmd.xml?command=control test1 play"; echo file_get_contents($url2); ?>
the browser return me this error:

new : Wrong command syntax control : Wrong command syntax.

can anybody help me? Please!!! :roll:

Thanks.

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: VLC PHP Issues

Postby revolunet » 01 Jul 2008 17:54

Hello

did you read http://wiki.videolan.org/VLM#Command_line_syntax ?

You have to first create the stream :

Code: Select all

new test1 broadcast enabled
then set options

Code: Select all

setup my_test1 input "C:\video\legione.avi" setup my_test1 output #transcode{vcodec=mp1v,vb=512,scale=1,acodec=mpga,ab=128}:std{access=http,mux=ps,dst=0.0.0.0:9000}
then start the stream

Code: Select all

control test1 play

hope this helps
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

dadedvd
New Cone
New Cone
Posts: 7
Joined: 05 Jun 2008 14:51

Re: VLC PHP Issues

Postby dadedvd » 01 Jul 2008 18:17

Yes i had read the page...

and it doesn't work... :? I don't know why...

I would to create the stream through PHP...

and then the option.

Thanks

dadedvd
New Cone
New Cone
Posts: 7
Joined: 05 Jun 2008 14:51

Re: VLC PHP Issues

Postby dadedvd » 03 Jul 2008 14:54

I have resolved... :D

The problem was in the space between "new test broadcast enabled" and it is replace " " with %20 "new%20test%20broadcast%20enabled"

Code: Select all

$http_admin_uri = "http://localhost:8080"; $url = $http_admin_uri.'/requests/vlm_cmd.xml?command=new%20test1%20broadcast%20enabled'; echo file_get_contents($url);


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 14 guests