Sunday, April 28, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 4340  / 2 Years ago, thu, october 20, 2022, 3:10:10

I am running uBuntu 12.04.3, 32 bit OS on a 8 CPU, 8GB RAM 64-bit Intel Xeon machine. I have installed all backports as well.



I have this problem which is eating my head for the last 3 days. I created a play.sh file with the following code...



Code:



#! /bin/sh 

vlc -vvv sasural.ts


Where sasural.ts is a video file that resides under home and in the same level as Apache. I am invoking the .sh file by using the following PHP code...



Code:



shell_exec('play.sh');



I also tried both the exec() / system() methods to invoke the .sh file.



Whenever I do so, I get the following message...



VLC media player 2.2.0-git Weatherwax Command Line Interface initialized. Type `help' for help. > Shutting down.


play.sh works if I execute it from the terminal command prompt outside of the PHP code. I guess I am doing something wrong when I invoke it from within PHP.



I have performed the following tasks...




  1. Given Apache Root Access

  2. Linked all folders to Apache


More From » command-line

 Answers
1

Gentlemen,



I have been able to solve this issue by using the following steps...




  • Install vlc nox version

  • In the PHP file:
    echo shell_exec("sh /var/www/play1.sh");


  • In the play1.sh file:
    #!/bin/sh
    vlc -Idummy /var/www/media.ts --sout '#standard{access=http,mux=ts,dst=:1935/}'


  • Invoke the PHP file via a browser and VLC will start streaming to port 1935




To access the file from the client end...



1) Point VLC or any media player to the URL + Port. Ex. http://www.something.com:1935
2) The client player will start to receive the file and play it back.



Now the next step is to enable this file on demand. Will post how I did that as well so stay tuned!!



Thank you everybody who have helped me in solving this problem. I have added +reps wherever it was possible.


[#29764] Friday, October 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theurn

Total Points: 30
Total Questions: 110
Total Answers: 111

Location: Bahrain
Member since Fri, Sep 16, 2022
2 Years ago
theurn questions
Tue, Apr 5, 22, 14:18, 2 Years ago
Mon, Feb 14, 22, 16:29, 2 Years ago
Sat, Apr 8, 23, 05:26, 1 Year ago
Tue, Jan 10, 23, 23:59, 1 Year ago
Fri, Apr 8, 22, 01:36, 2 Years ago
;