huceke / omxplayer

omxplayer
GNU General Public License v2.0
522 stars 502 forks source link

Programmatic control #287

Open rocketinventor opened 7 years ago

rocketinventor commented 7 years ago

I would like to be able to control omxplayer out of frame. In other words, I want to be able to have omxplayer running in one process and to be able to control it from another. I am trying to make a custom interface and I want to be a able to control it from a web-server. I imagine that there is already some sort of way to do this with a command line arg? Built in API? Maybe with a named pipe? I'd like to have something non-blocking.

In practice this could look like this: An instance of "Internet music player" is opened from the command line (perhaps via SSH) and starts an instance omxplayer (in the "background") to play the track that was selected. While omxplayer is working in the background, "Internet music player" is still showing a playlist and handling key-presses/commands. As long as omxplayer is playing it will continue to post updates on track playback/buffering/metadata/errors (either directly to the program that invoked it or to the named pipe.

Any help would be appreciated, Thanks!

matthijskooijman commented 5 years ago

It seems omxplayer can be controlled through dbus. See for example https://github.com/popcornmix/omxplayer/blob/master/dbuscontrol.sh and https://github.com/willprice/python-omxplayer-wrapper

I think with that, this issue can be closed?