1
.\" $Id: ezstream.1.in.in 16537 2009-08-30 21:55:24Z moritz $
3
.\" Copyright (c) 2007, 2009 Moritz Grimm <mdgrimm@gmx.net>
5
.\" This program is free software; you can redistribute it and/or modify
6
.\" it under the terms of the GNU General Public License version 2 as
7
.\" published by the Free Software Foundation.
9
.\" This program is distributed in the hope that it will be useful,
10
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
.\" GNU General Public License for more details.
14
.\" You should have received a copy of the GNU General Public License
15
.\" along with this program; if not, write to the Free Software
16
.\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
.Os @PACKAGE_NAME@ @PACKAGE_VERSION@
23
.Nd source client for Icecast with external de-/encoder support
38
utility is a source client for the Icecast media streaming server.
39
In its basic mode of operation, it streams media files and data from standard
42
\(em such as Ogg Vorbis, Ogg Theora and MP3 \(em to a server.
43
It can also use various external decoders and encoders to re-encode from one
44
format to another, and stream the result.
45
The only requirement is that the external programs support writing to or
46
reading from standard input, and can be used from the command line.
47
.Ss Command line parameters
49
.It Fl c Ar configfile
50
Use the XML configuration in
53
Print a summary of available command line parameters with short descriptions
56
Normalize metadata strings by removing excess whitespaces.
59
Suppress the output that external programs send to standard error.
60
.It Fl s Op Ar playlist
63
as a line-based shuffling utility.
66
argument is given, a list of media file names is read from standard input
67
instead of an input file.
68
After successfully reading the entire list, it is shuffled and printed to
75
version number and exit.
77
Produce more verbose output from
79
Use twice for even more verbose output.
86
parameters are provided simultaneously, an additional line of information about
87
the currently streamed file \(em playlist position, approximate playing time
88
and bit rate \(em is displayed.
92
offers limited runtime control via signals.
93
By sending a signal to the ezstream process, e.g. with the
95
utility, a certain action will be triggered.
98
Rereads the playlist file after the track that is currently streamed.
99
If the playlist is not to be shuffled,
101
attempts to find the previously streamed file and continue with the one
102
following it, or restarts from the beginning of the list otherwise.
104
Skips the currently playing track and moves on to the next in playlist mode, or
105
restarts the current track when streaming a single file.
107
Triggers rereading of metadata for the stream by running the program or script
109
.Li \&<metadata_progname/\&>
111
This is the only meaningful signal when streaming from standard input.
114
.Sh CONFIGURATION FILE SYNTAX
117
utility uses a simple XML configuration file format.
118
It has a tree-like structure and is made up of
120
Of all the possible XML features, only regular elements that contain text or
121
other elements, and comments, appear in an
125
Each element in the configuration file consists of a
131
.Dl \&<filename\&>playlist.m3u<\&/filename\&>
132
.Dl \&<\&!-- XML comments look like this. --\&>
133
.Sh XML CONFIGURATION
134
In this section, each available element is listed and described.
135
Note that for this purpose, elements are introduced in their short, i.e. empty
137
In the configuration file, they need to be used as
138
.Em start tag + content + end tag ,
139
like in the introductory example shown above.
142
.It Sy \&<ezstream\ /\&>
144
The configuration file's root element.
145
It contains all other configuration elements.
147
.Ss Global configuration elements
148
Each of the global configuration elements have the
150
element as their parent.
154
Specifies the location and mount point of the Icecast server, to which the
156
The content must be of the form
157
.Pa http://server:port/mountpoint
160
.Dl \&<url\&>http://example.com:8000/stream.ogg\&</url\&>
161
.It Sy \&<sourceuser\ /\&>
163
Sets the source username for authentication with the Icecast server.
169
is used if this element is not provided.
170
.It Sy \&<sourcepassword\ /\&>
172
Sets the source password for authentication with the Icecast server.
173
.It Sy \&<format\ /\&>
175
This element has two different meanings, depending on whether re-encoding is
179
of the stream if re-encoding is enabled.
180
Otherwise, it specifies the
185
Recognized and supported values for output stream formats are
190
Other values will be ignored and cause
192
to simply pass through the data, which may or may not work.
193
.It Sy \&<filename\ /\&>
195
Set the path and name of a single media file, a playlist, the name of an
200
for streaming from standard input.
201
Playlists are recognized by their filename extension and end with either
206
A playlist consists of filenames, one entry per line.
207
Comments in playlists are introduced by a
209
sign at the beginning of a line and ignored by
211
.It Sy \&<playlist_program\ /\&>
216
to indicate that the file in
218
is actually an executable program or script.
223
content is assumed to be a media file, playlist file or the keyword
229
section for details on how the playlist program must behave.
230
.It Sy \&<shuffle\ /\&>
235
to randomly shuffle the entries of the playlist specified in
236
.Li \&<filename/\&> .
237
Files are played sequentially if set to
243
This option will be ignored if
244
.Li \&<playlist_program/\&>
247
.It Sy \&<metadata_progname\ /\&>
249
Set the path and name of an executable program or script that should be used by
251
to set the metadata of the stream.
252
The program is automatically queried when a new track is streamed, or whenever
258
.Li \&<metadata_progname/\&>
259
element is present in the configuration, no attempts will be made to read
260
metadata from files that are being streamed.
261
If this behavior is not desired, it should be removed or commented out in the
266
section for details on how the metadata program must behave.
267
.It Sy \&<metadata_format\ /\&>
269
Set the format of the string that should be used for the
271
placeholder when setting metadata with an external program or script via
272
.Li \&<metadata_progname/\&> .
276
section for details on how metadata is handled by
278
.It Sy \&<stream_once\ /\&>
282
in order to stream the content of
287
for continuous streaming
289
.It Sy \&<reconnect_tries\ /\&>
290
Set how many attempts should be made to reconnect to the Icecast server in case
291
the connection is interrupted.
292
The default is to try indefinitely, which is equal to setting this
293
configuration option to
296
.It Sy \&<svrinfoname\ /\&>
298
Set the name of the broadcast.
300
.It Sy \&<svrinfourl\ /\&>
302
Set the URL of the web site associated with the broadcast.
304
.It Sy \&<svrinfogenre\ /\&>
306
Set the genre of the broadcast.
307
Informational only, used for YP.
308
.It Sy \&<svrinfodescription\ /\&>
310
Set the description of the broadcast.
311
Informational only, used for YP.
312
.It Sy \&<svrinfobitrate\ /\&>
314
Set the bit rate of the broadcast.
315
This setting is also purely informational and only used for YP.
316
The value is set by the user and not
318
and should match the bit rate of the stream.
319
.It Sy \&<svrinfoquality\ /\&>
321
Set the quality setting of an Ogg Vorbis broadcast.
322
Informational only and needs to be set by the user, used for YP.
323
.It Sy \&<svrinfochannels\ /\&>
325
Set the number of audio channels in the broadcast, e.g.
331
Informational only and needs to be set by the user, used for YP.
332
.It Sy \&<svrinfosamplerate\ /\&>
334
Set the sample rate of the broadcast.
335
Informational only and needs to be set by the user, used for YP.
336
.It Sy \&<svrinfopublic\ /\&>
341
if the broadcast may be listed in a public YP directory.
345
the Icecast server will not submit this stream to a YP directory, which is also
347
.Li \&<svrinfopublic/\&>
349
.It Sy \&<reencode\ /\&>
351
Element that contains child elements, which specify if and how re-encoding
354
.Ss Re-encoding settings
355
Each of the re-encoding configuration elements have the
357
element as their parent.
359
.It Sy \&<enable\ /\&>
363
to enable re-encoding.
367
no re-encoding will be done, which is also the default if the
370
.It Sy \&<encdec\ /\&>
371
Element that contains child elements, which specify how to decode and encode
372
a certain media file format for streaming.
373
Each format is described by a separate
377
.Ss Decoder/Encoder settings
378
Each of the decoder/encoder configuration elements have the
380
element as their parent.
382
.It Sy \&<format\ /\&>
383
This element is used by
385
to find the appropriate encoder for the output stream format specified in the
387
element inside the global configuration.
388
For consistency reasons, it is recommended that this element is always
389
supplied, even for currently unsupported output formats, with content such as
395
.It Sy \&<match\ /\&>
396
Set the filename extension used to identify a given media file format.
399
to find the appropriate decoder for a given file.
406
for Ogg Vorbis, and so on.
407
.It Sy \&<decode\ /\&>
408
Set the command to decode the specified media file format to raw data and send
409
it to standard output.
410
During runtime, the placeholder
412
is replaced with the name of the media file, as it is specified in the
414
element or contained in a playlist file.
415
It should always be enclosed in quotes, to prevent problems with filenames that
418
Metadata placeholders can be used in the
420
element as well, for combined de-/encoder programs that produce data that can
424
section for details on how metadata is handled by
427
For example, to decode Ogg Vorbis files using the
431
.Dl \&<decode\&>oggdec -R -o - \&"@T@\&"\&</decode\&>
432
.It Sy \&<encode\ /\&>
433
Set the command to encode raw data, received from standard input, to the
434
specified stream format.
436
Metadata placeholders can be used in the
439
For details about using metadata in
445
For example, to encode an Ogg Vorbis stream using the quality setting 1.5 with
450
.Dl \&<encode\&>oggenc -r -q 1.5 -t \&"@M@\&" -\&</encode\&>
455
utility provides hooks for externally controlled playlist and metadata
457
This is done by running external programs or scripts that need to behave in
462
The program must be an executable file.
464
The program must write one line to standard output and exit.
466
The program must not require arbitrary command line options to function.
467
A wrapper script must be used if there is no other way.
469
.Ss Playlist Programs
472
The program must return only filenames, with one filename per execution.
474
The program should not return an empty line unless
476
is supposed to know that the end of the playlist has been reached.
477
This is significant when the
478
.Li \&<stream_once/\&>
481
.Ss Metadata Programs
484
The program must not return anything (just a newline character is okay) if it
487
with a command line parameter that the program does not support.
489
When called without command line parameters, the program should return a
490
complete string that should be used for metadata.
492
When called with the command line parameter
494
the program should return only the artist information of the metadata.
497
When called with the command line parameter
499
the program should return only the title information of the metadata.
502
The supplied metadata must be encoded in UTF-8.
505
The main tool for handling metadata with
507
is placeholders in decoder and encoder commands that are replaced with real
508
content during runtime.
509
The tricky part is that one of the placeholders has to be handled differently,
510
depending on where the metadata comes from.
511
This section will explain each possible scenario.
512
.Ss Metadata Placeholders
515
Replaced with the media file name.
519
.Li \&<metadata_format/\&> .
521
Replaced with a metadata string.
522
See below for a detailed explanation.
528
Replaced with the artist information.
533
.Li \&<metadata_format/\&> .
535
Replaced with the title information.
540
.Li \&<metadata_format/\&> .
542
Replaced with the string returned by
543
.Li \&<metadata_progname/\&>
544
when called without any command line parameters.
546
.Li \&<metadata_format/\&> .
548
.Ss The @M@ Placeholder
549
While all other placeholders are simply replaced with whatever data they are
552
is context-sensitive.
556
.Bd -literal -offset indent
557
If ('@M@ is present')
558
If ('\&<metadata_progname/\&>' AND '\&<metadata_format/\&>')
559
Replace with format string result.
561
If (NOT '\&<metadata_progname/\&>' AND '@t@ is present')
562
Replace with empty string.
564
Replace with generated metadata string.
570
The generated metadata string for
573
.Dq Em Artist - Title ,
574
if both artist and title information is available.
575
If one of the two is missing, the available one is displayed without a leading
576
or trailing dash, e.g. just
578
If neither artist nor title are available, the name of the media file \(em
579
without its file extension \(em is used.
581
It is possible to generate strange results with odd combinations of
582
placeholders, external metadata programs and updates during runtime via
584
If things start to become just confusing, simplify.
586
Metadata updates during runtime are done with a relatively broken feature of
588
Additional metadata information that is already present in the stream sent via
590
is usually destroyed and replaced with the new data.
591
It is not possible to properly discern between artist and title information,
592
which means that anything set with the
594
feature will continue to end up entirely in the
598
Of all possible Ogg-based streams, only Ogg Vorbis can have its metadata
599
manipulated by Icecast.
602
to update other Ogg metadata is actually a no-op.
606
tries to do its best with relaying metadata accurately to Icecast, and
607
subsequently the listeners, different codesets and locales can pose a problem.
608
Especially when streaming MP3 files, it may help to explicitly set a codeset
611
environment variable, as
613
assumes ID3v1 tags to be in the user's current locale.
614
Note that, even though support for different locales is provided by
616
Icecast itself and the listening clients also have a say in the matter.
617
The only way to ensure consistent results with metadata in non-Ogg streams is
618
to use the characters available in the ISO-8859-1 codeset.
620
External encoders may put additional, and possibly artificial, restrictions on
621
valid characters in metadata.
623
.Bl -tag -width "!!EXAMPLES_DIR!!" -compact
624
.It Pa !!EXAMPLES_DIR!!
625
Directory containing example configuration files for various uses of
627
as well as example playlist and metadata scripts.
630
.Xr ezstream-file.sh 1
635
.An Ed Zaleski Aq oddsock@oddsock.org
636
.An Moritz Grimm Aq mdgrimm@gmx.net
638
This manual was written by Moritz Grimm.