EZSTREAM(1) | General Commands Manual | EZSTREAM(1) |
ezstream
— source
client for Icecast with external de-/encoder support
ezstream |
[-hqrVv ] -c
configfile
[-p pidfile] |
ezstream |
-s file |
ezstream
is a command line source client
for media streams, primarily for streaming to Icecast servers.
It allows the creation of media streams based on input from files or standard input that is piped through an optional external de- and encoder. As every part of this chain is highly configurable, ezstream can be useful in a large number of streaming setups.
-c
configfile-h
-p
pidfileezstream
process ID (a single number) to
pidfile. The file will be written even when it
already exists. A file lock is maintained until the main
ezstream
process terminates. If the file cannot be
written for any reason, ezstream
will log this,
but not consider it a fatal error.-q
-r
-q
.)-s
fileezstream
as a line-based shuffling utility. If
a playlist argument of “-” 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.-V
ezstream
version number and exit.-v
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.
SIGHUP
ezstream
attempts to find the previously streamed file and continue with the one
following it, or restarts from the beginning of the list otherwise.SIGUSR1
SIGUSR2
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.
A configuration file may contain multiple named server configurations. The stream configuration determines what server configuration should be used.
The name is case-aware, but not case-sensitive.
Default: default
Default: HTTP
Default: 8000
Default: source
Default: 0
Default: May
This option is ignored when <protocol /> is set to HTTPS, which implies a value of Required.
For example (modern cipher suites, PFS, TLS 1.2 or better): HIGH:!RSA:!SHA:!DH:!aNULL:!eNULL:!TLSv1.
Default: libshout default cipher suite
Default: system default
Default: system default
Default: no client certificate authentication
Note: While multiple stream configurations
are supported by the file format, only the one configuration with the
name default will be used by
ezstream
.
The name is case-aware, but not case-sensitive.
Note: At this time, only the stream configuration with the default name is used and must be present.
Default: default
Default: default
Default: default
ezstream
stream input media files as-is.
The configured encoder's output stream format must match what is configured in <format />.
Default: none
Default: none
Default: none
Default: none
Default: none
Default: none
Default: none
Default: none
A configuration file may contain multiple named intake configurations. The stream configuration determines what intake (media input) configuration should be used.
The name is case-aware, but not case-sensitive.
Default: default
.m3u
” and
“.txt
” file name extensions.
(This is the default.)#
’ sign at the beginning of a
line and ignored by ezstream
.ezstream
should exit
after streaming its media input, or start over.
@M@
’ placeholder, when quering for
metadata from an executable.
Default: @a@ - @t@
The name is case-aware, but not case-sensitive.
Default: default
The canonical format should be the same for all configured decoders, e.g. RAW audio with a specific signedness, bitrate, and samplerate that can be consumed by encoders.
For exotic use cases, metadata placeholders may be used here.
Example:
<program>oggdec -R -o -
@T@</program>
It is possible to specify more than one <file_ext /> element per decoder to associate more than one file extension to the same decoder.
A filename extension can only be associated with one decoder.
The name is case-aware, but not case-sensitive.
Default: default
Metadata placeholders may be used here.
Example:
<program>oggenc -r -q 1.5
-t @M@ -</program>
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
argument 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.
Note: All placeholders are replaced with content enclosed in single quotes, with escaped single quote and backslash characters in between, so that interpretation by the shell does not occur. Do not add any additional quoting!
/ezstream/decoders/decoder/program
. Available in
/ezstream/metadata/format_str
./ezstream/decoders/decoder/program
and /ezstream/encoders/encoder/program
./ezstream/decoders/decoder/program
,
/ezstream/encoders/encoder/program
and
/ezstream/metadata/format_str
./ezstream/decoders/decoder/program
,
/ezstream/encoders/encoder/program
and
/ezstream/metadata/format_str
./ezstream/decoders/decoder/program
,
/ezstream/encoders/encoder/program
and
/ezstream/metadata/format_str
./ezstream/metadata/program
when called without any
command line arguments. Available only in
/ezstream/metadata/format_str
.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 (/ezstream/metadata/program AND /ezstream/metadata/format_str) Replace with format string result. Else If (NOT /ezstream/metadata/program 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
eccentric 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.
Additional limitations in Icecast may apply as well, where one historic example is that of all possible Ogg-based streams, only Ogg Vorbis can have its metadata manipulated.
The ID3v1 tags (relevant when streaming in MP3 format) do not
specify any character encoding, so ezstream
operates
in a manner of “best effort”. In case of encoding issues, 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 only 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 ⟨mgrimm@mrsserver.net⟩
This manual was written by Moritz Grimm.
August 1, 2022 | ezstream 1.0.2 |