Page 1 of 1

VLC Command line Interface

Posted: 26 Aug 2013 16:10
by seemantshankar
Hi,

I'm trying to invoke VLC through a PHP file so it can stream out a video to a port that the browser will be listening to.
In the PHP file, i have:

Code: Select all

echo shell_exec("video.sh");
In sh file, i have:

Code: Select all

#! /bin/sh vlc videofile.ts
When i access the PHP file from the browser, this is the message i get on the browser:
"VLC media player 2.2.0-git Weatherwax Command Line Interface initialized. Type `help' for help. > Shutting down"

But when i call video.sh file directly, it opens a VLC instance and also starts streaming the video perfectly.
I basically want VLC to stream a video when called from a webpage.

Re: VLC Command line Interface

Posted: 26 Aug 2013 17:11
by RĂ©mi Denis-Courmont
VLC cannot find the X11 server. PHP must run as the user, and the DISPLAY environment variable must be set correctly.

Re: VLC Command line Interface

Posted: 29 Aug 2013 17:00
by seemantshankar
Thank you Remi. What if I am using VLC on a headless server? I have installed the noX version of VLC. I assume this should not look for the X11 server in this case.