Streaming Opus audio with MPD's httpd output

11 Aug 2019

With MPD ≥ 0.18 if you add this to your mpd.conf file…

audio_output {
    type            "httpd"
    name            "OwlCast"
    encoder         "opus"
    port            "8000"
    bind_to_address "0.0.0.0"
    bitrate         "96000"
    format          "44100:16:2" # use :1 for mono
    max_clients     "0"          # max of zero means no limit
    always_on       "yes"        # don't drop listeners when audio stops
    tags            "yes"        # send artist/title metadata
}

…you'll get a new MPD output on port 8000 for HTTP streaming. The 96 kbps bitrate is suitable for music streaming and in my testing it sounds great, but you could bump it to 128 if you wanted. Note: for some reason you have to specify the bitrate in bits per second for Opus, despite Ogg Vorbis being specified in kilobits.

Now you can easily listen to your music collection from any vaguely modern hardware/software that supports HTTP audio streaming. Using Opus instead of MP3 or Ogg is a nice step-up in quality while using less bandwidth.

Other notes

2019

2016

2014

2013

2012

2011

2010