Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to open an MPlayer instance on my server from a PHP script (using PHP's system() function). I've looked into making mplayer a slave ( http://www.mplayerhq.hu/DOCS/tech/slave.txt ) but when I open MPlayer it returns:

svgalib: Cannot get I/O permissions.

Do I need to change the permissions of the user running apache or can I change the permissions for just the script?

Thanks

share|improve this question
    
mplayer is trying to display the video on your server's console (through SVGAlib). Is this really what you intended? –  Gilles Jun 4 '11 at 16:11
    
No, I want it to open in its own window and full screen. –  Scott Jun 4 '11 at 16:22
    
And where do you intend the window to be displayed? “server from a PHP script” suggests a web context, but that clashes with “in its own window and full screen”. Are you trying to display a video on the server or the client? If it's on the server, what's showing on its screen? (Oh, and I don't think you have a permission issue at all. You're not telling mplayer to display in the right place.) –  Gilles Jun 4 '11 at 16:39
    
Basically, I just want a web interface for a media server connected to a screen. When nothing is playing nothing is showing on the server but when I issue the command it will show the video. The PHP script can be accessed on the local network but doesn't need to show the video on that screen (ie a laptop). –  Scott Jun 4 '11 at 17:14
    
@Scott: It looks like you do want to to display the video on your server's console after all. Do you run X Window on that server (i.e. a GUI with windows, maybe Gnome or KDE or some other window manager)? Do you assume that someone is logged in on the server console? I'm still trying to determine whether you want to run mplayer under X, outside X, or you don't know and are looking for possibilities. –  Gilles Jun 4 '11 at 17:43
show 1 more comment

1 Answer 1

If you want mplayer to run on the server's X console, add:

putenv("DISPLAY=:0.0");

Before your system() call. You'll also need to give it permission on your X console. Take a look at http://linuxgazette.net/52/tag/21.html for how to do that.

share|improve this answer
    
Thanks, this displays the video but it seems to be missing the audio (even though the exact same command from in a console will play with audio). Do I need to give permission for audio? –  Scott Jun 5 '11 at 0:57
1  
@Scott: You should probably add the apache user to the audio group. –  stribika Jun 5 '11 at 1:50
    
I have tried putting the user (www-data) in the audio group, it does not give me audio. –  Scott Jun 5 '11 at 15:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.