1
.\" Copyright (C) 2007 Moritz Grimm <mdgrimm@gmx.net>
3
.\" This document may be be used and/or modified under the licensing terms
4
.\" of the Ezstream software.
11
.Nd source client for Icecast with external de-/encoder support
21
utility is a source client for the Icecast media streaming server.
22
In its basic mode of operation, it streams media files and data from standard
25
\(em such as Ogg Vorbis, Ogg Theora and MP3 \(em to a server.
26
It can also use various external decoders and encoders to re-encode from one
27
format to another, and stream the result.
28
The only requirement is that the external programs support writing to or
29
reading from standard input, and can be used from the command line.
30
.Ss Command line parameters
32
.It Fl c Ar configfile
33
Use the XML configuration in
37
Print a summary of available command line parameters with short descriptions
40
Normalize metadata strings by removing excess whitespaces.
43
Suppress the output that external programs send to standard error.
47
version number and exit.
49
Produce more verbose output from
51
Use twice for even more verbose output.
58
parameters are provided simultaneously, an additional line of information about
59
the currently streamed file \(em playlist position, approximate playing time
60
and bit rate \(em is displayed.
64
offers limited runtime control via signals.
65
By sending a signal to the ezstream process, e.g. with the
67
utility, a certain action will be triggered.
70
Rereads the playlist file after the track that is currently streamed.
71
If the playlist is not to be shuffled,
73
attempts to find the previously streamed file and continue with the one
74
following it, or restarts from the beginning of the list otherwise.
76
Skips the currently playing track and moves on to the next in playlist mode, or
77
restarts the current track when streaming a single file.
79
Triggers rereading of metadata for the stream by running the program or script
81
.Li \&<metadata_progname/\&>
83
This is the only meaningful signal when streaming from standard input.
86
.Sh CONFIGURATION FILE SYNTAX
89
utility uses a simple XML configuration file format.
90
It has a tree-like structure and is made up of
92
Of all the possible XML features, only regular elements that contain text or
93
other elements, and comments, appear in an
97
Each element in the configuration file consists of a
103
.Dl \&<filename\&>playlist.m3u<\&/filename\&>
104
.Dl \&<\&!-- XML comments look like this. --\&>
105
.Sh XML CONFIGURATION
106
In this section, each available element is listed and described.
107
Note that for this purpose, elements are introduced in their short, i.e. empty
109
In the configuration file, they need to be used as
110
.Em start tag + content + end tag ,
111
like in the introductory example shown above.
114
.It Sy \&<ezstream\ /\&>
116
The configuration file's root element.
117
It contains all other configuration elements.
119
.Ss Global configuration elements
120
Each of the global configuration elements have the
122
element as their parent.
126
Specifies the location and mount point of the Icecast server, to which the
128
The content must be of the form
129
.Pa http://server:port/mountpoint
132
.Dl \&<url\&>http://example.com:8000/stream.ogg\&</url\&>
133
.It Sy \&<sourceuser\ /\&>
135
Sets the source username for authentication with the Icecast server.
141
is used if this element is not provided.
142
.It Sy \&<sourcepassword\ /\&>
144
Sets the source password for authentication with the Icecast server.
145
.It Sy \&<format\ /\&>
147
This element has two different meanings, depending on whether re-encoding is
151
of the stream if re-encoding is enabled.
152
Otherwise, it specifies the
157
Recognized and supported values for output stream formats are
162
Other values will be ignored and cause
164
to simply pass through the data, which may or may not work.
165
.It Sy \&<filename\ /\&>
167
Set the path and name of a single media file, a playlist, the name of an
172
for streaming from standard input.
173
Playlists are recognized by their filename extension and end with either
178
A playlist consists of filenames, one entry per line.
179
Comments in playlists are introduced by a
181
sign at the beginning of a line and ignored by
183
.It Sy \&<playlist_program\ /\&>
188
to indicate that the file in
190
is actually an executable program or script.
195
content is assumed to be a media file, playlist file or the keyword
201
section for details on how the playlist program must behave.
202
.It Sy \&<shuffle\ /\&>
207
to randomly shuffle the entries of the playlist specified in
208
.Li \&<filename/\&> .
209
Files are played sequentially if set to
215
This option will be ignored if
216
.Li \&<playlist_program/\&>
219
.It Sy \&<metadata_progname\ /\&>
221
Set the path and name of an executable program or script that should be used by
223
to set the metadata of the stream.
224
The program is automatically queried when a new track is streamed, or whenever
230
.Li \&<metadata_progname/\&>
231
element is present in the configuration, no attempts will be made to read
232
metadata from files that are being streamed.
233
If this behavior is not desired, it should be removed or commented out in the
238
section for details on how the metadata program must behave.
239
.It Sy \&<metadata_format\ /\&>
241
Set the format of the string that should be used for the
243
placeholder when setting metadata with an external program or script via
244
.Li \&<metadata_progname/\&> .
248
section for details on how metadata is handled by
250
.It Sy \&<stream_once\ /\&>
254
in order to stream the content of
259
for continuous streaming
261
.It Sy \&<reconnect_tries\ /\&>
262
Set how many attempts should be made to reconnect to the Icecast server in case
263
the connection is interrupted.
264
The default is to try indefinitely, which is equal to setting this
265
configuration option to
268
.It Sy \&<svrinfoname\ /\&>
270
Set the name of the broadcast.
272
.It Sy \&<svrinfourl\ /\&>
274
Set the URL of the web site associated with the broadcast.
276
.It Sy \&<svrinfogenre\ /\&>
278
Set the genre of the broadcast.
279
Informational only, used for YP.
280
.It Sy \&<svrinfodescription\ /\&>
282
Set the description of the broadcast.
283
Informational only, used for YP.
284
.It Sy \&<svrinfobitrate\ /\&>
286
Set the bit rate of the broadcast.
287
This setting is also purely informational and only used for YP.
288
The value is set by the user and not
290
and should match the bit rate of the stream.
291
.It Sy \&<svrinfoquality\ /\&>
293
Set the quality setting of an Ogg Vorbis broadcast.
294
Informational only and needs to be set by the user, used for YP.
295
.It Sy \&<svrinfochannels\ /\&>
297
Set the number of audio channels in the broadcast, e.g.
303
Informational only and needs to be set by the user, used for YP.
304
.It Sy \&<svrinfosamplerate\ /\&>
306
Set the sample rate of the broadcast.
307
Informational only and needs to be set by the user, used for YP.
308
.It Sy \&<svrinfopublic\ /\&>
313
if the broadcast may be listed in a public YP directory.
317
the Icecast server will not submit this stream to a YP directory, which is also
319
.Li \&<svrinfopublic/\&>
321
.It Sy \&<reencode\ /\&>
323
Element that contains child elements, which specify if and how re-encoding
326
.Ss Re-encoding settings
327
Each of the re-encoding configuration elements have the
329
element as their parent.
331
.It Sy \&<enable\ /\&>
335
to enable re-encoding.
339
no re-encoding will be done, which is also the default if the
342
.It Sy \&<encdec\ /\&>
343
Element that contains child elements, which specify how to decode and encode
344
a certain media file format for streaming.
345
Each format is described by a separate
349
.Ss Decoder/Encoder settings
350
Each of the decoder/encoder configuration elements have the
352
element as their parent.
354
.It Sy \&<format\ /\&>
355
This element is used by
357
to find the appropriate encoder for the output stream format specified in the
359
element inside the global configuration.
360
For consistency reasons, it is recommended that this element is always
361
supplied, even for currently unsupported output formats, with content such as
367
.It Sy \&<match\ /\&>
368
Set the filename extension used to identify a given media file format.
371
to find the appropriate decoder for a given file.
378
for Ogg Vorbis, and so on.
379
.It Sy \&<decode\ /\&>
380
Set the command to decode the specified media file format to raw data and send
381
it to standard output.
382
During runtime, the placeholder
384
is replaced with the name of the media file, as it is specified in the
386
element or contained in a playlist file.
387
It should always be enclosed in quotes, to prevent problems with filenames that
390
Metadata placeholders can be used in the
392
element as well, for combined de-/encoder programs that produce data that can
396
section for details on how metadata is handled by
399
For example, to decode Ogg Vorbis files using the
403
.Dl \&<decode\&>oggdec -R -o - \&"@T@\&"\&</decode\&>
404
.It Sy \&<encode\ /\&>
405
Set the command to encode raw data, received from standard input, to the
406
specified stream format.
408
Metadata placeholders can be used in the
411
For details about using metadata in
417
For example, to encode an Ogg Vorbis stream using the quality setting 1.5 with
422
.Dl \&<encode\&>oggenc -r -q 1.5 -t \&"@M@\&" -\&</encode\&>
427
utility provides hooks for externally controlled playlist and metadata
429
This is done by running external programs or scripts that need to behave in
434
The program must be an executable file.
436
The program must write one line to standard output and exit.
438
The program must not require arbitrary command line options to function.
439
A wrapper script must be used if there is no other way.
441
.Ss Playlist Programs
444
The program must return only filenames, with one filename per execution.
446
The program should not return an empty line unless
448
is supposed to know that the end of the playlist has been reached.
449
This is significant when the
450
.Li \&<stream_once/\&>
453
.Ss Metadata Programs
456
The program must not return anything (just a newline character is okay) if it
459
with a command line parameter that the program does not support.
461
When called without command line parameters, the program should return a
462
complete string that should be used for metadata.
464
When called with the command line parameter
466
the program should return only the artist information of the metadata.
469
When called with the command line parameter
471
the program should return only the title information of the metadata.
474
The supplied metadata must be encoded in UTF-8.
477
The main tool for handling metadata with
479
is placeholders in decoder and encoder commands that are replaced with real
480
content during runtime.
481
The tricky part is that one of the placeholders has to be handled differently,
482
depending on where the metadata comes from.
483
This section will explain each possible scenario.
484
.Ss Metadata Placeholders
487
Replaced with the media file name.
491
.Li \&<metadata_format/\&> .
493
Replaced with a metadata string.
494
See below for a detailed explanation.
500
Replaced with the artist information.
505
.Li \&<metadata_format/\&> .
507
Replaced with the title information.
512
.Li \&<metadata_format/\&> .
514
Replaced with the string returned by
515
.Li \&<metadata_progname/\&>
516
when called without any command line parameters.
518
.Li \&<metadata_format/\&> .
520
.Ss The @M@ Placeholder
521
While all other placeholders are simply replaced with whatever data they are
524
is context-sensitive.
528
.Bd -literal -offset indent
529
If ('@M@ is present')
530
If ('\&<metadata_progname/\&>' AND '\&<metadata_format/\&>')
531
Replace with format string result.
533
If (NOT '\&<metadata_progname/\&>' AND '@t@ is present')
534
Replace with empty string.
536
Replace with generated metadata string.
542
The generated metadata string for
545
.Dq Em Artist - Title ,
546
if both artist and title information is available.
547
If one of the two is missing, the available one is displayed without a leading
548
or trailing dash, e.g. just
550
If neither artist nor title are available, the name of the media file \(em
551
without its file extension \(em is used.
553
It is possible to generate strange results with odd combinations of
554
placeholders, external metadata programs and updates during runtime via
556
If things start to become just confusing, simplify.
558
Metadata updates during runtime are done with a relatively broken feature of
560
Additional metadata information that is already present in the stream sent via
562
is usually destroyed and replaced with the new data.
563
It is not possible to properly discern between artist and title information,
564
which means that anything set with the
566
feature will continue to end up entirely in the
570
Of all possible Ogg-based streams, only Ogg Vorbis can have its metadata
571
manipulated by Icecast.
574
to update other Ogg metadata is actually a no-op.
578
tries to do its best with relaying metadata accurately to Icecast, and
579
subsequently the listeners, different codesets and locales can pose a problem.
580
Especially when streaming MP3 files, it may help to explicitly set a codeset
583
environment variable, as
585
assumes ID3v1 tags to be in the user's current locale.
586
Note that, even though support for different locales is provided by
588
Icecast itself and the listening clients also have a say in the matter.
589
The only way to ensure consistent results with metadata in non-Ogg streams is
590
to use the characters available in the ISO-8859-1 codeset.
592
External encoders may put additional, and possibly artificial, restrictions on
593
valid characters in metadata.
595
.Bl -tag -width "!!EXAMPLES_DIR!!" -compact
596
.It Pa !!EXAMPLES_DIR!!
597
Directory containing example configuration files for various uses of
599
as well as example playlist and metadata scripts.
605
.An Ed Zaleski Aq oddsock@oddsock.org
606
.An Moritz Grimm Aq mdgrimm@gmx.net
608
This manual was written by Moritz Grimm.