Skip to main content

Posts about multimedia

mpd

mpd

Music Player Daemon. server-client architecture.

mpd.conf

You can specify audio output type and device in /etc/mpd.conf. Various types are available including http streaming. This is example for 2nd alsa device.

audio_output {
    type            "alsa"
    name            "My ALSA Device"
    device          "hw:1,0"
}

mpc

command line interface of mpd

option

-h <host> # specify server

subcommands

play
pause
next
prev

consume [on|off]

ls <directory> # lists all files in directory
listall <file> # lists all files
add <file> # add file to queue
clear # empty the queue

search <type> <query> # for example: $ mpc search filename ENYA
find <type> <query> # similar to search. but match exactly
list <type> # shows a list of all tags of type
update <path> # scans for updated files in the path

lsplaylists # lists available playlists
playlist <playlist name> # lists all songs in playlist
rm <playlist> # remove playlist
save <playlist> # save playlist

load <playlist> # load <playlist> in the queue

We can load m3u or cue files in a music directory as playlist. The file path in a playlist should be relative path from the playlist. M3U can be extended M3U.

mpc load <subdir in music dir>/<any subdir>/playlistfile ; mpc playlist

MPDroid

client for android

MaximumMPD

client for iOS

KODI Add-on:MPD Client

Add-on of KODI formerly known as XBMC. If HDMI-CEC is enabled on your monitor device, you can controll MPD with your remote controller.

vlc

VLC is opensource and crossplatform multimedia player. cvlc is command line version of vlc.

VLC(or cvlc) can stream via http. See Streaming HowTo/Command Line Examples or Streaming HowTo/Advanced Streaming Using the Command Line for detail

cvlc
--sout '#standard{access=http,mux=mp3,dst=192.168.x.x:xxxx}' # http stream. mux=dummy or raw will be ok
vlc://quit

http interface

VLC(or cvlc) could be controlled with http request. See VLC HTTP requests for detail

start cvlc with http interface

cvlc
-I HTTP # start http interface
--http-password <password> # specify http password
--aout alsa --alsa-audio-device plughw:2,0 # specify audio output device
vlc://quit

You can control vlc with not only web browser but also command line tool

curl
-I # fetche the headers only
--user ":<mypassword>" # specify http passowrd (user name is null)
http://127.0.0.1:8080/requests/status.xml 
?command=pl_play
?command=pl_pause
?command=volume&val=+<int>
?command=volume&val=-<int>