Skip to content

Controlling mplayer from a separate process

Brad edited this page Apr 8, 2017 · 2 revisions

Create a named pipe (needs to happen each boot):

mkfifo /tmp/mceiling
chmod 666 /tmp/mceiling

Start mplayer and have it read commands from the named pipe:

mplayer -idle -really-quiet -slave -input file=/tmp/mceiling

Commands can now be sent to the named pipe and mplayer will receive them:

echo "loadlist http://somafm.com/startstream=lush.pls" > /tmp/mceiling

Note that media files are played with loadfile but playlists are played with loadlist.

These commands will pause/play and stop playback:

echo "pause" > /tmp/mceiling
echo "stop" > /tmp/mceiling
Clone this wiki locally