[Icecast-dev] Icecast protocol

sci-fi at hush.ai sci-fi at hush.ai
Thu Jan 4 23:06:23 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Thu, 04 Jan 2007 21:57:12 -0600,
Ian Descôteaux <descoteauxi at gmail.com> wrote:
> I'm writting a simple app which is gonna take FLAC file and
> convert them to ogg and mp3 format before sending them to
> icecast upon streaming.  I have search a lot over and can't
> find a icecast protocol definition, or even an overview
> anywhere.  Is somebody can point me on this one or I have to
> read the whole icecast source code (I know java but C/C++ is
> another thing...).
>
> Regars.

I wonder if you've studied Xiph's EZStream project located at:
<http://www.icecast.org/ezstream.php>
<http://downloads.xiph.org/releases/ezstream/>

I've used EZStream in the past quite a lot (I don't do netcasts
anymore...) but it sounds like EZStream will already do what
you're striving for.  ;)

If you'd like, let me try to clarify some things about it:

Please don't get mixed-up with the <decode/encode> pairs noted
in the documentation.  It is enough that EZStream can be told
how to do each half on its own.

The source tarball has some sample .xml files which will show in
particular how it can use the flac command-line tool (provided
by the FLAC package itself) to decode .flac files.

You set up your .xml file to decide what <format> to _en_code
the resulting piped data (coming from the <decode>rs).  The
(re)encoded data are then streamed to your icecast server.

Yes this means you could conceivably have all kinds of input
files in different formats and encoded bitrates etc. i.e. not
just .flac but also a mix of .mp3 and others -- just make sure
the .xml file's <reencode> section has <decode> lines for each
kind of expected input file in your playlists.

The earlier <format> parm then determines what is sent to your
icecast server -- and make sure the .xml file has suitable
<encode> lines in its <reencode> section for the chosen output
stream.  (Like I said, forget about the apparent "pairing" of
the decode/encode sections as shown in the examples.  ;)  )

EZStream relies on external command-line tools, but that is the
very nature of UNIX-like systems.  :)  It is also easily
expandable without needing to change EZStream's own code itself.
And I dare say much more "portable" (which has been a
historical problem with MacOSX I use here, so it is doubly nice
to have portable tools like these).

Here is proof that EZStream can easily be expanded with simple
tools:  Since we had to use Apple's Lossless Audio Codec (ALAC)
because QuickTime-based apps still can't do FLAC directly, I
have been able to find an alac-decoder that'll use stdout, then
I simply added a new <decode> section into the .xml file.
Automatically EZStream now will recognise .alac/.mp4/.mpa files
and convert them on-the-fly to the chosen mp3/ogg <format>
stream for icecast to send out.

IIRC, with expert coding in the .xml file, EZStream can process
a few metadata tags, too, and tell your icecast server about
them.

EZStream is powerful like this, but also quite simplistic.  It
can handle playlists, and you can change the playlist on-the-fly
in a basic manner.

EZStream is suppose to be able to accept stdin-piped data, too,
but I haven't been keen on how to use it that way.

If anything, maybe EZStream can be used as a basis for your
project I hope?

-----BEGIN PGP SIGNATURE-----
Note: This signature can be verified at https://www.hushtools.com/verify
Version: Hush 2.5

wkYEARECAAYFAkWd+O8ACgkQZbt5KOxKrtRDjgCfd6jpY8E+tLFi3cTiipPH63UREssA
n18arCO1Xdzk9FBo6S/9caVQoAac
=ia02
-----END PGP SIGNATURE-----




Concerned about your privacy? Instantly send FREE secure email, no account required
http://www.hushmail.com/send?l=480

Get the best prices on SSL certificates from Hushmail
https://www.hushssl.com?l=485



More information about the Icecast-dev mailing list