You would use pipes or fifo files to communicate between processes through the stdin&stdout - you could send command to omxplayer from your php script, provided that it accepts commands from stdin and sends meaningful info to stdout... basically the command should be something along: 'commands_in | omxplayer ... > info_out' (where commands_in would be a (fifo) file you feed your command to omxplayer and info_out is the player output you then read. In your example above, you just redirect the omxplayer output to the fifo file, but are you reading from it?
If you just want to start the player without further control, you should be able to do it with the shell_exec() - possibly need to add the path to omxplayer and most likely run it in the background? So '/path/to/omxplayer <params> /path/to/videofile &'
You could try to narrow down the issue by running a script that writes something to a debug file:
Code: Select all
#!/bin/bash
echo Testing >/home/pi/test.log
...and make your PHP script to exec that.
Then (re-)create a shell script for running the omxplayer:
Code: Select all
#!/bin/bash
omxplayer ... >/home/pi/test.log
...and check if any errors output into the file ...I assume your server does some sort of logging as well?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'