Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3871412
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:49:17+00:00 2026-05-19T21:49:17+00:00

I’m trying to open VLC via browser and make it instantly play the given

  • 0

I’m trying to open VLC via browser and make it instantly play the given video file on Mac OS X.

This runs on my local server and is only meant to run locally – therefore I already run apache (MAMP) with my username and with group “staff” (defined in httpd.conf).

YES – I do know that VLC has http interface – however that is not what I need, so do not suggest that…

My current system works without any problems when I run it via Terminal:

php /var/www/Movies/index.php  

-> This leads to VLC opening and video starts playing fullscreen like intented.

Problems start when I run the same PHP-page with browser. Then the VLC-process starts, but there’s no GUI for it, video file won’t start playing and the VLC-process takes nearly 100% of CPU.

  • Both; terminal and browser started VLC-processes run with the same user (mine)
  • Both have “Parent process” bash
  • VLC-process begun with Terminal has empty “Process group” (only process id-number) and browser started has “httpd” + (id-number)
  • VLC-process started via browser makes 1000-times more “Mach System Calls” than it’s Terminal-started counterpart.

Could anyone give me any pointers on how to get this thing working?

index.php

# $j is a file path to the videofile and is defined before
exec('/var/www/Movies/vlc.sh "' . $j . '" > /dev/null 2>&1 & echo $!;'); 

# If I do this in the given PHP-page it tells me that apache is running 
# with my username and with the group "staff" like it should be...
exec('whoamI');

vlc.sh

#!/bin/bash 
# Activate VLC in 5 seconds to make it the front-most window 
(sleep 5; open -a VLC) & 

# Open video file 
/Applications/VLC.app/Contents/MacOS/VLC --quiet --fullscreen "$1"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T21:49:18+00:00Added an answer on May 19, 2026 at 9:49 pm

    Just for the sake of closing this question, the final solution which worked for me was this:

    exec('echo "OS_X_ROOT_PASSWORD" | sudo -S launchctl bsexec LOGIN_WINDOW_PROCESS_ID osascript -e \'do shell script "PATH_TO_vlc.sh" & " \"MOVIE_FILE_PATH\" \"SUBTITLE_FILE_PATH\""\' > /dev/null 2>&1 & echo $!;');
    

    Contents of vlc.sh

    #!/bin/bash
    
    # Activate VLC in x seconds to make it the front-most window
    (sleep 4; open -a VLC) &
    
    # Open video file
    su - YOUR_MAC_OS_USERNAME -c "/Applications/VLC.app/Contents/MacOS/VLC --quiet --volume=1024 --fullscreen --sub-file=\"$2\" \"$1\""
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.