title: Streaming to Shoutcast

h3. Streaming to Shoutcast

Although Liquidsoap is primarily aimed at streaming to Icecast servers (that provide 
much more features than Shoutcast), it is also able to stream to Shoutcast.

h4. Shoutcast output

Shoutcast server accept streams encoded with the MP3 or AAC/AAC+ codec. You to compile Liquidsoap with 
@lame@ support, so it can encode in MP3. Liquidsoap also has support for AAC+ encoding
using libaacplus or using an "external encoder":external_encoders.html. The recommended format is MP3.

Shoutcast output are done using the @output.shoutcast@ operator with the appropriate parameters.
An example is:

%%(shoutcast.liq)
source = single("audiofile.ogg")

output.shoutcast(%mp3, host="shoutcast.example.org",
                     port=8000, password="changeme",
                     source)
%%

As usual, @liquidsoap -h output.shoutcast@ gives you the full list of options for this operator.

h4. Shoutcast as relay

A side note for those of you who feel they "need" to use Shoutcast for non-technical reasons (such as their stream 
directory service...): you can still benefit from Icecast's power by streaming to an Icecast server, and then relaying 
it through a shoutcast server.

In order to do that, you have to alias the root mountpoint ("<code>/</code>") to your MP3 mountpoint in your icecast server 
configuration, like this:

<pre>
&lt;alias source="/" dest="/mystream.mp3" /&gt;
</pre>


Be careful that icecast often aliases the status page (<code>/status.xsl</code>) with the <code>/</code>. In this case, comment 
out the status page alias before inserting yours.
