ezstream
source client for Icecast with external de-/encoder support
- Provided by: ezstream (Version: 0.5.6~dfsg-1.1)
- Report a bug
source client for Icecast with external de-/encoder support
ezstream |
[-hnqVv] -c
configfile |
ezstream |
-s [playlist] |
The ezstream utility is a source client
for the Icecast media streaming server. In its basic mode of operation, it
streams media files and data from standard input "as-is" —
such as Ogg Vorbis, Ogg Theora and MP3 — to a server. It can also use
various external decoders and encoders to re-encode from one format to
another, and stream the result. The only requirement is that the external
programs support writing to or reading from standard input, and can be used
from the command line.
-c
configfile-h-n-q-s
[playlist]ezstream as a line-based shuffling utility. If
no playlist argument is given, a list of media file
names is read from standard input instead of an input file. After
successfully reading the entire list, it is shuffled and printed to
standard output, and ezstream will exit.-Vezstream version number and exit.-vezstream. Use
twice for even more verbose output.When the -q and -v
parameters are provided simultaneously, an additional line of information
about the currently streamed file — playlist position, approximate
playing time and bit rate — is displayed.
On POSIX systems, ezstream offers limited
runtime control via signals. By sending a signal to the ezstream process,
e.g. with the kill(1) utility, a certain action will be
triggered.
SIGHUPezstream
attempts to find the previously streamed file and continue with the one
following it, or restarts from the beginning of the list otherwise.SIGUSR1SIGUSR2<metadata_progname/>
(see below.) This is the only meaningful signal when streaming from
standard input.The ezstream utility uses a simple XML
configuration file format. It has a tree-like structure and is made up of
XML
elements. Of all the possible XML features, only regular elements
that contain text or other elements, and comments, appear in an
ezstream configuration file.
Each element in the configuration file consists of a start tag, its content and an end tag. For example:
<filename>playlist.m3u</filename><!-- XML comments look like this.
-->In this section, each available element is listed and described. Note that for this purpose, elements are introduced in their short, i.e. empty form. In the configuration file, they need to be used as start tag + content + end tag, like in the introductory example shown above.
Each of the global configuration elements have the
<ezstream/> element as their parent.
<url>http://example.com:8000/stream.ogg</url>source”) is used if this element is
not provided.ezstream to simply pass through the data, which
may or may not work.A playlist consists of filenames, one entry per line. Comments
in playlists are introduced by a
‘#’ sign at the beginning of a
line and ignored by ezstream.
<filename/> is actually an executable
program or script. If set to 0 (zero),
<filename/> content is assumed to be a media
file, playlist file or the keyword stdin (the
default).
See the SCRIPTING section for details on how the playlist program must behave.
<filename/>. Files are played sequentially
if set to 0 (zero) or when the
<shuffle/> element is absent. This option
will be ignored if <playlist_program/> is
set to 1 (one.)ezstream to set the metadata of
the stream. The program is automatically queried when a new track is
streamed, or whenever the SIGUSR2 signal is received.
If the <metadata_progname/>
element is present in the configuration, no attempts will be made to
read metadata from files that are being streamed. If this behavior is
not desired, it should be removed or commented out in the configuration
file.
See the SCRIPTING section for details on how the metadata program must behave.
@M@’ placeholder when setting
metadata with an external program or script via
<metadata_progname/>.
See the METADATA section for details on how
metadata is handled by ezstream.
<filename/> only once, and to
0 (zero) for continuous streaming (the default).ezstream, and should match the bit rate of the
stream.<svrinfopublic/>
element is absent.Each of the re-encoding configuration elements have the
<reencode/> element as their parent.
<enable/> element is
absent.<encdec/> element.Each of the decoder/encoder configuration elements have the
<encdec/> element as their parent.
ezstream to find the
appropriate encoder for the output stream format specified in the
<format/> element inside the global
configuration. For consistency reasons, it is recommended that this
element is always supplied, even for currently unsupported output formats,
with content such as VORBIS, MP3,
THEORA,
FLAC, et
cetera.ezstream to find the appropriate
decoder for a given file. Should be set to
.mp3 for
MP3,
.flac
for FLAC,
.ogg for
Ogg Vorbis, and so on.@T@’ is replaced with the name of
the media file, as it is specified in the
<filename/> element or contained in a
playlist file. It should always be enclosed in quotes, to prevent problems
with filenames that contain whitespaces.
Metadata placeholders can be used in the
<decode/> element as well, for combined
de-/encoder programs that produce data that can be streamed. See the
METADATA section for details on how metadata is
handled by ezstream.
For example, to decode Ogg Vorbis files using the
oggdec utility:
<decode>oggdec -R -o -
"@T@"</decode>Metadata placeholders can be used in the
<encode/> element. For details about using
metadata in ezstream, see below in the
METADATA section.
For example, to encode an Ogg Vorbis stream using the quality
setting 1.5 with the oggenc utility:
<encode>oggenc -r -q 1.5 -t
"@M@" -</encode>The ezstream utility provides hooks for
externally controlled playlist and metadata management. This is done by
running external programs or scripts that need to behave in ways explained
here.
ezstream is supposed to know that the end of the
playlist has been reached. This is significant when the
<stream_once/> option is enabled.ezstream with a command line
parameter that the program does not support.artist", the program should return only
the artist information of the metadata. (Optional.)title", the program should return only
the title information of the metadata. (Optional.)The main tool for handling metadata with
ezstream is placeholders in decoder and encoder
commands that are replaced with real content during runtime. The tricky part
is that one of the placeholders has to be handled differently, depending on
where the metadata comes from. This section will explain each possible
scenario.
<decode/> and is available in
<metadata_format/>.<decode/> and
<encode/>.<decode/>,
<encode/> and
<metadata_format/>.<decode/>,
<encode/> and
<metadata_format/>.<metadata_progname/> when called without any
command line parameters. Available only in
<metadata_format/>.While all other placeholders are simply replaced with whatever
data they are associated with, ‘@M@’
is context-sensitive. The logic used by ezstream is
the following:
If ('@M@ is present')
If ('<metadata_progname/>' AND '<metadata_format/>')
Replace with format string result.
Else
If (NOT '<metadata_progname/>' AND '@t@ is present')
Replace with empty string.
else
Replace with generated metadata string.
Endif
Endif
Endif
The generated metadata string for
‘@M@’ is of the format
“Artist - Title”, if both artist and title
information is available. If one of the two is missing, the available one is
displayed without a leading or trailing dash, e.g. just
“Artist”. If neither artist nor title are
available, the name of the media file — without its file extension
— is used.
It is possible to generate strange results with odd combinations of placeholders, external metadata programs and updates during runtime via SIGUSR2. If things start to become just confusing, simplify.
Metadata updates during runtime are done with a
relatively broken feature of libshout. Additional metadata information that
is already present in the stream sent via ezstream
is usually destroyed and replaced with the new data. It is not possible to
properly discern between artist and title information, which means that
anything set with the SIGUSR2 feature will continue to end
up entirely in the
"Title"
field of a stream.
Of all possible Ogg-based streams, only Ogg Vorbis can have its
metadata manipulated by Icecast. Any attempt of
ezstream to update other Ogg metadata is actually a
no-op.
While ezstream tries to do its best with
relaying metadata accurately to Icecast, and subsequently the listeners,
different codesets and locales can pose a problem. Especially when streaming
MP3 files, it may help to explicitly set a codeset to work with via the
LC_CTYPE environment variable, as
ezstream assumes ID3v1 tags to be in the user's
current locale. Note that, even though support for different locales is
provided by ezstream, Icecast itself and the
listening clients also have a say in the matter. The only way to ensure
consistent results with metadata in non-Ogg streams is to use the characters
available in the ISO-8859-1 codeset.
External encoders may put additional, and possibly artificial, restrictions on valid characters in metadata.
ezstream, as well as example playlist and metadata
scripts.ezstream was written by:
Ed Zaleski
⟨oddsock@oddsock.org⟩
Moritz Grimm ⟨mdgrimm@gmx.net⟩
This manual was written by Moritz Grimm.