ezstream.1.in.in 18.7 KB
Newer Older
1
.\" Copyright (c) 2007, 2009, 2015 Moritz Grimm <mgrimm@mrsserver.net>
moritz's avatar
moritz committed
2
3
4
5
6
7
8
9
10
11
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License version 2 as
.\" published by the Free Software Foundation.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
12
.Dd @BUILD_DATE@
moritz's avatar
moritz committed
13
.Dt EZSTREAM 1
14
.Os @PACKAGE_NAME@ @PACKAGE_VERSION@
moritz's avatar
moritz committed
15
16
.Sh NAME
.Nm ezstream
17
.Nd source client for Icecast with external de-/encoder support
moritz's avatar
moritz committed
18
19
20
.Sh SYNOPSIS
.Nm
.Bk -words
Moritz Grimm's avatar
Moritz Grimm committed
21
.Op Fl hqrVv
moritz's avatar
moritz committed
22
.Fl c Ar configfile
moritz's avatar
moritz committed
23
.Ek
24
25
.Nm
.Bk -words
Moritz Grimm's avatar
Moritz Grimm committed
26
.Fl s Ar file
27
.Ek
moritz's avatar
moritz committed
28
29
30
31
32
33
34
35
.Sh DESCRIPTION
The
.Nm
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
.Qq as-is
\(em such as Ogg Vorbis, Ogg Theora and MP3 \(em to a server.
moritz's avatar
moritz committed
36
It can also use various external decoders and encoders to re-encode from one
moritz's avatar
moritz committed
37
38
39
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.
Moritz Grimm's avatar
Moritz Grimm committed
40
.Ss Command line arguments
moritz's avatar
moritz committed
41
42
43
44
45
.Bl -tag -width Ds
.It Fl c Ar configfile
Use the XML configuration in
.Ar configfile .
.It Fl h
Moritz Grimm's avatar
Moritz Grimm committed
46
Print a summary of available command line arguments with short descriptions
moritz's avatar
moritz committed
47
48
49
50
and exit.
.It Fl q
Be more quiet.
Suppress the output that external programs send to standard error.
Moritz Grimm's avatar
Moritz Grimm committed
51
52
53
54
55
56
57
58
.It Fl r
Maintain a line of real-time status information about the stream on standard
output.
.Po
Implies
.Fl q .
.Pc
.It Fl s Ar file
59
60
61
Run
.Nm
as a line-based shuffling utility.
62
If a
63
.Ar playlist
64
65
66
argument of
.Dq -
is given, a list of media file names is read from standard input
67
68
69
70
71
instead of an input file.
After successfully reading the entire list, it is shuffled and printed to
standard output, and
.Nm
will exit.
72
73
74
75
.It Fl V
Print the
.Nm
version number and exit.
moritz's avatar
moritz committed
76
.It Fl v
Moritz Grimm's avatar
Moritz Grimm committed
77
78
Increase logging verbosity.
May be used up to three times to also include debug logging output.
moritz's avatar
moritz committed
79
80
81
82
.El
.Ss Runtime control
On POSIX systems,
.Nm
83
offers limited runtime control via signals.
moritz's avatar
moritz committed
84
85
86
87
88
89
90
91
92
93
94
95
96
By sending a signal to the ezstream process, e.g. with the
.Xr kill 1
utility, a certain action will be triggered.
.Bl -tag -width -Ds
.It Cd SIGHUP
Rereads the playlist file after the track that is currently streamed.
If the playlist is not to be shuffled,
.Nm
attempts to find the previously streamed file and continue with the one
following it, or restarts from the beginning of the list otherwise.
.It Cd SIGUSR1
Skips the currently playing track and moves on to the next in playlist mode, or
restarts the current track when streaming a single file.
97
98
.It Cd SIGUSR2
Triggers rereading of metadata for the stream by running the program or script
99
100
specified in
.Li \&<metadata_progname/\&>
101
102
.Pq see below.
This is the only meaningful signal when streaming from standard input.
moritz's avatar
moritz committed
103
104
105
106
107
108
109
110
111
112
113
114
115
116
.El
.Pp
.Sh CONFIGURATION FILE SYNTAX
The
.Nm
utility uses a simple XML configuration file format.
It has a tree-like structure and is made up of
.Em XML elements .
Of all the possible XML features, only regular elements that contain text or
other elements, and comments, appear in an
.Nm
configuration file.
.Pp
Each element in the configuration file consists of a
117
.Em start tag ,
Moritz Grimm's avatar
Moritz Grimm committed
118
its content, and an
119
.Em end tag .
moritz's avatar
moritz committed
120
121
122
123
124
125
126
127
128
129
130
131
For example:
.Pp
.Dl \&<filename\&>playlist.m3u<\&/filename\&>
.Dl \&<\&!-- XML comments look like this. --\&>
.Sh XML CONFIGURATION
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
.Em start tag + content + end tag ,
like in the introductory example shown above.
.Ss Root element
132
.Bl -tag -width -Ds
moritz's avatar
moritz committed
133
134
135
.It Sy \&<ezstream\ /\&>
.Pq Mandatory.
The configuration file's root element.
Moritz Grimm's avatar
Moritz Grimm committed
136
137
It contains all other configuration elements:
.Pp
moritz's avatar
moritz committed
138
.El
Moritz Grimm's avatar
Moritz Grimm committed
139
.Ss Server block
140
.Bl -tag -width -Ds
Moritz Grimm's avatar
Moritz Grimm committed
141
.It Sy \&<server\ /\&>
moritz's avatar
moritz committed
142
.Pq Mandatory.
Moritz Grimm's avatar
Moritz Grimm committed
143
144
145
146
147
148
149
150
151
This element contains the entire server configuration as child elements.
Its parent is the
.Sy \&<ezstream\ /\&>
element.
.El
.Ss Server configuration
.Bl -tag -width -Ds
.It Sy \&<protocol\ /\&>
Transport protocol used to stream to the server:
moritz's avatar
moritz committed
152
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
153
154
155
.Bl -tag -width HTTPS -compact
.It Ar HTTP
Unencrypted HTTP (the default).
156
157
.It Ar HTTPS
HTTP over TLS.
Moritz Grimm's avatar
Moritz Grimm committed
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
.El
.It Sy \&<hostname\ /\&>
.Pq Mandatory.
The FQDN host name or IP address of the server.
.It Sy \&<port\ /\&>
Port number on which the server is listening.
.Pp
Default:
.Ar 8000
.It Sy \&<user\ /\&>
User to authenticate as on the server.
.Pp
Default:
.Ar source
.It Sy \&<password\ /\&>
.Pq Mandatory.
Password to authenticate with on the server.
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
.It Sy \&<ca_dir\ /\&>
Directory in which OpenSSL finds root CA certificates for validating the
.Ar HTTPS
server identity.
.Pp
Default:
.Em no server validation
.It Sy \&<ca_file\ /\&>
Path of a root CA bundle file for validating the
.Ar HTTPS
server identity.
.Pp
Default:
.Em no server validation
.It Sy \&<client_cert\ /\&>
X.503 client certificate for authentication on an
.Ar HTTPS
server.
.Pp
Default:
.Em no client certificate authentication
.It Sy \&<client_key\ /\&>
Private key that matches the public key and certificate in
.Sy \&<client_cert\ /\&> .
.Pp
Default:
.Em no client certificate authentication
Moritz Grimm's avatar
Moritz Grimm committed
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
.It Sy \&<reconnect_attempts\ /\&>
Number of reconnect attempts in case of connection issues with the server,
or 0
.Pq zero
for trying indefinitely (the default).
.El
.Ss Stream block
.Bl -tag -width -Ds
.It Sy \&<stream\ /\&>
.Pq Mandatory.
This element contains the entire stream configuration as child elements.
Its parent is the
.Sy \&<ezstream\ /\&>
element.
.El
.Ss Stream configuration
.Bl -tag -width -Ds
.It Sy \&<mountpoint\ /\&>
moritz's avatar
moritz committed
220
.Pq Mandatory.
Moritz Grimm's avatar
Moritz Grimm committed
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
Stream mountpoint on the server.
.It Sy \&<name\ /\&>
Informational name of the broadcast.
.Pp
Default:
.Em none
.It Sy \&<url\ /\&>
Informational URL associated with the broadcast, e.g. the web site.
.Pp
Default:
.Em none
.It Sy \&<genre\ /\&>
Informational genre of the broadcast.
.Pp
Default:
.Em none
.It Sy \&<description\ /\&>
Informational description of the broadcast.
.Pp
Default:
.Em none
.It Sy \&<quality\ /\&>
Informational quality setting of the VBR broadcast.
.Pp
Default:
.Em none
.It Sy \&<bitrate\ /\&>
Informational bitrate setting of the CBR broadcast.
.Pp
Default:
.Em none
.It Sy \&<samplerate\ /\&>
Informational sample rate of the broadcast audio.
.Pp
Default:
.Em none
.It Sy \&<channels\ /\&>
Informational number of audio channels of the broadcast.
.Pp
Default:
.Em none
.It Sy \&<server_public\ /\&>
Boolean setting of whether the broadcast may be listed in a public YP
directory, or not.
.Pp
.Bl -tag -width 0|NO|FALSE -compact
.It Ar 0|No|False
The broadcast is private (the default).
.It Ar 1|Yes|True
The broadcast is public.
.El
moritz's avatar
moritz committed
272
273
.It Sy \&<format\ /\&>
.Pq Mandatory.
Moritz Grimm's avatar
Moritz Grimm committed
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
The stream format.
.Pp
.Bl -tag -width VORBIS -compact
.It Ar Vorbis
Ogg Vorbis audio format
.It Ar MP3
MP3 audio format
.It Ar Theora
Ogg Theora video format
.El
.It Sy \&<encoder\ /\&>
Set the encoder by its configured symbolic name
.Pq see below ,
which should be used to (re)encode the stream.
Not configuring an encoder makes
moritz's avatar
moritz committed
289
.Nm
Moritz Grimm's avatar
Moritz Grimm committed
290
291
292
293
294
295
296
297
298
stream input media files as-is.
.Pp
The configured encoder's output stream format must match what is configured
in
.Sy \&<format\ /\&> .
.El
.Ss Media block
.Bl -tag -width -Ds
.It Sy \&<media\ /\&>
moritz's avatar
moritz committed
299
.Pq Mandatory.
Moritz Grimm's avatar
Moritz Grimm committed
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
This element contains the entire input media configuration as child elements.
Its parent is the
.Sy \&<ezstream\ /\&>
element.
.El
.Ss Media configuration
.Bl -tag -width -Ds
.It Sy \&<type\ /\&>
Configure the input media type:
.Pp
.Bl -tag -width AUTODETECT -compact
.It Ar autodetect
Attempt to autodetect, whether the input is a playlist, or a single media
file.
Playlists are detected by their
.Dq Li .m3u
and
.Dq Li .txt
file name extensions.
.Pq This is the default.
.It Ar file
The input is one single media file.
.It Ar playlist
The input is a playlist.
Playlists are a newline-delimited list of media file path names.
moritz's avatar
moritz committed
325
326
327
328
Comments in playlists are introduced by a
.Sq Li #
sign at the beginning of a line and ignored by
.Nm .
Moritz Grimm's avatar
Moritz Grimm committed
329
330
331
332
333
334
335
336
337
338
339
340
341
.It Ar program
The input is an executable
.Dq Playlist Program .
See
.Xr SCRIPTING
for more information.
.It Ar stdin
The input is read from standard input.
.El
.It Sy \&<filename\ /\&>
The input media file name; mandatory for all but the
.Ar stdin
type.
moritz's avatar
moritz committed
342
.It Sy \&<shuffle\ /\&>
Moritz Grimm's avatar
Moritz Grimm committed
343
344
345
346
347
348
349
350
351
352
353
354
Boolean setting of whether the
.Ar playlist
type media should be shuffled, or not.
.Pp
.Bl -tag -width 0|NO|FALSE -compact
.It Ar 0|No|False
Stream the playlist content sequentially (the default).
.It Ar 1|Yes|True
Shuffle the playlist prior to streaming its content.
.El
.It Sy \&<stream_once\ /\&>
Boolean setting of whether
355
.Nm
Moritz Grimm's avatar
Moritz Grimm committed
356
should exit after streaming its media input, or start over.
357
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
.Bl -tag -width 0|NO|FALSE -compact
.It Ar 0|No|False
Attempt to start over whenever the end of the media input is reached (the
default).
.It Ar 1|Yes|True
After streaming all media input, exit.
.El
.El
.Ss Metadata block
.Bl -tag -width -Ds
.It Sy \&<metadata\ /\&>
This element contains the entire metadata configuration as child elements.
Its parent is the
.Sy \&<ezstream\ /\&>
element.
.El
.Ss Metadata configuration
.Bl -tag -width -Ds
.It Sy \&<program\ /\&>
Set an executable
.Dq Metadata Program
to be queried for all metadata on
.Sy SIGUSR2
or whenever a new track begins.
See
.Xr SCRIPTING
for more information.
385
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
386
387
388
Default:
.Em use metadata as contained in media files
.It Sy \&<format_str\ /\&>
389
Set the format of the string that should be used for the
390
.Sq Li @M@
Moritz Grimm's avatar
Moritz Grimm committed
391
placeholder, when quering for metadata from an executable.
392
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
393
Default:
Moritz Grimm's avatar
Moritz Grimm committed
394
.Em Li @a@ - @t@
Moritz Grimm's avatar
Moritz Grimm committed
395
396
397
398
399
400
401
402
403
404
405
.It Sy \&<refresh_interval\ /\&>
Configure a time interval for additional metadata updates via a
.Dq Metadata Program :
.Pp
.Bl -tag -width -1 -compact
.It Ar -1
Do not trigger any additional metadata updates (the default).
.It Ar 0
Trigger metadata updates at the highest reasonable frequency.
.It Ar \&>0
Configure the time
406
.Pq in seconds
Moritz Grimm's avatar
Moritz Grimm committed
407
408
409
410
411
412
413
414
415
416
417
418
in between additional metadata updates.
.El
.It Sy \&<normalize_strings\ /\&>
Boolean setting of whether metadata strings should have excess whitespace
removed, or not.
.Pp
.Bl -tag -width 0|NO|FALSE -compact
.It Ar 0|No|False
Use metadata strings as-is (the default).
.It Ar 1|Yes|True
Trim leading and trailing whitespace, as well as remove excess whitespace
in case that there is more than one in sequence.
moritz's avatar
moritz committed
419
.El
Moritz Grimm's avatar
Moritz Grimm committed
420
421
422
423
424
425
426
427
428
429
430
431
.It Sy \&<no_updates\ /\&>
Boolean setting of whether metadata updates should be suppressed altogether,
or not.
.Pp
.Bl -tag -width 0|NO|FALSE -compact
.It Ar 0|No|False
Update metadata in the usual manner (the default).
.It Ar 1|Yes|True
Disable all metadata updates, and keep existing metadata in streams untouched.
.El
.El
.Ss Decoders block
432
.Bl -tag -width -Ds
Moritz Grimm's avatar
Moritz Grimm committed
433
434
435
436
.It Sy \&<decoders\ /\&>
This element contains all decoder blocks as child elements.
Its parent is the
.Sy \&<ezstream\ /\&>
437
element.
moritz's avatar
moritz committed
438
.El
Moritz Grimm's avatar
Moritz Grimm committed
439
.Ss Decoder block
440
.Bl -tag -width -Ds
Moritz Grimm's avatar
Moritz Grimm committed
441
442
443
444
445
.It Sy \&<decoder\ /\&>
This element contains all configuration of a single decoder.
Its parent is the
.Sy \&<decoders\ /\&>
element.
moritz's avatar
moritz committed
446
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
Many decoders can be configured, but a filename extension can only be
associated with one decoder.
.El
.Ss Decoder configuration
.Bl -tag -width -Ds
.It Sy \&<name\ /\&>
Set the name of the decoder configuration.
Choosing a meaningful, unique name is beneficial for logging and debugging.
.Pp
Default:
.Em autoincrementing index
.It Sy \&<program\ /\&>
.Pq Mandatory.
Set the full command line to decode a media input file, represented by the
.Sq @T@
placeholder, into a
.Dq canonical internal format
on standard output.
moritz's avatar
moritz committed
465
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
466
467
468
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.
469
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
For exotic use cases, metadata placeholders may be used here.
.Pp
Example:
.Dl \&<program\&>oggdec -R -o - @T@\&</program\&>
.It Sy \&<file_ext\ /\&>
.Pq Mandatory.
Set a filename extension to be associated with this decoder.
.Pp
It is possible to specify more than one
.Sy \&<file_ext\ /\&>
element per decoder to associate more than one file extension to the same
decoder.
.El
.Ss Encoders block
.Bl -tag -width -Ds
.It Sy \&<encoders\ /\&>
This element contains all encoder blocks as child elements.
Its parent is the
.Sy \&<ezstream\ /\&>
489
element.
Moritz Grimm's avatar
Moritz Grimm committed
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
.El
.Ss Encoder block
.Bl -tag -width -Ds
.It Sy \&<encoder\ /\&>
This element contains all configuration of a single encoder.
Its parent is the
.Sy \&<encoders\ /\&>
element.
.Pp
Many encoders can be configured.
.El
.Ss Encoder configuration
.Bl -tag -width -Ds
.It Sy \&<name\ /\&>
.Pq Mandatory.
Set the name of the encoder configuration, to be referenced in the
.Sy \&<stream\ /\&>
block in case (re)encoding is desired.
.Pp
The name is case-aware, but not case-sensitive.
.It Sy \&<format\ /\&>
.Pq Mandatory.
Stream format produced by this encoder.
This must be one of the available stream formats as specified for the
.Sy \&<stream\ /\&>
block.
.It Sy \&<program\ /\&>
.Pq Mandatory.
Set the full command line to encode
.Dq canonical internal format
from standard input into a supported stream format on standard output.
moritz's avatar
moritz committed
521
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
522
Metadata placeholders may be used here.
moritz's avatar
moritz committed
523
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
524
525
Example:
.Dl \&<program\&>oggenc -r -q 1.5 -t @M@ -\&</program\&>
moritz's avatar
moritz committed
526
.El
527
528
529
530
531
532
533
534
535
536
537
538
539
540
.Sh SCRIPTING
The
.Nm
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.
.Ss Common Rules
.Bl -dash -compact
.It
The program must be an executable file.
.It
The program must write one line to standard output and exit.
.It
moritz's avatar
moritz committed
541
The program must not require arbitrary command line options to function.
542
543
544
545
546
547
548
549
550
551
A wrapper script must be used if there is no other way.
.El
.Ss Playlist Programs
.Bl -dash -compact
.It
The program must return only filenames, with one filename per execution.
.It
The program should not return an empty line unless
.Nm
is supposed to know that the end of the playlist has been reached.
552
553
554
This is significant when the
.Li \&<stream_once/\&>
option is enabled.
555
556
557
558
559
560
561
.El
.Ss Metadata Programs
.Bl -dash -compact
.It
The program must not return anything (just a newline character is okay) if it
is called by
.Nm
Moritz Grimm's avatar
Moritz Grimm committed
562
with a command line argument that the program does not support.
563
.It
Moritz Grimm's avatar
Moritz Grimm committed
564
When called without command line arguments, the program should return a
565
566
complete string that should be used for metadata.
.It
Moritz Grimm's avatar
Moritz Grimm committed
567
When called with the command line argument
568
.Qq Li artist ,
569
570
571
the program should return only the artist information of the metadata.
.Pq Optional.
.It
Moritz Grimm's avatar
Moritz Grimm committed
572
When called with the command line argument
573
.Qq Li title ,
574
575
the program should return only the title information of the metadata.
.Pq Optional.
576
.It
577
The supplied metadata must be encoded in UTF-8.
578
.El
579
580
581
582
583
.Sh METADATA
The main tool for handling metadata with
.Nm
is placeholders in decoder and encoder commands that are replaced with real
content during runtime.
584
585
.Pp
.Em Note:
Moritz Grimm's avatar
Moritz Grimm committed
586
587
588
589
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.
.Em Do not add any additional quoting!
590
591
592
593
.Ss Metadata Placeholders
.Bl -tag -width -Ds
.It Sy @T@
Replaced with the media file name.
594
Required in
Moritz Grimm's avatar
Moritz Grimm committed
595
596
597
.Li /ezstream/decoders/decoder/program .
Available in
.Li /ezstream/metadata/format_str .
598
599
.It Sy @M@
Replaced with a metadata string.
Moritz Grimm's avatar
Moritz Grimm committed
600
.Pq See below for a detailed explanation.
601
Available in
Moritz Grimm's avatar
Moritz Grimm committed
602
.Li /ezstream/decoders/decoder/program
603
and
Moritz Grimm's avatar
Moritz Grimm committed
604
.Li /ezstream/encoders/encoder/program .
605
606
.It Sy @a@
Replaced with the artist information.
607
Available in
Moritz Grimm's avatar
Moritz Grimm committed
608
609
.Li /ezstream/decoders/decoder/program ,
.Li /ezstream/encoders/encoder/program
610
and
Moritz Grimm's avatar
Moritz Grimm committed
611
.Li /ezstream/metadata/format_str .
612
613
.It Sy @t@
Replaced with the title information.
614
Available in
Moritz Grimm's avatar
Moritz Grimm committed
615
616
.Li /ezstream/decoders/decoder/program ,
.Li /ezstream/encoders/encoder/program
617
and
Moritz Grimm's avatar
Moritz Grimm committed
618
.Li /ezstream/metadata/format_str .
619
.It Sy @s@
620
Replaced with the string returned by
Moritz Grimm's avatar
Moritz Grimm committed
621
622
.Li /ezstream/metadata/program
when called without any command line arguments.
623
Available only in
Moritz Grimm's avatar
Moritz Grimm committed
624
.Li /ezstream/metadata/format_str .
625
626
627
628
.El
.Ss The @M@ Placeholder
While all other placeholders are simply replaced with whatever data they are
associated with,
629
.Sq Li @M@
630
631
632
633
634
635
is context-sensitive.
The logic used by
.Nm
is the following:
.Bd -literal -offset indent
If ('@M@ is present')
Moritz Grimm's avatar
Moritz Grimm committed
636
    If (/ezstream/metadata/program AND /ezstream/metadata/format_str)
637
638
        Replace with format string result.
    Else
Moritz Grimm's avatar
Moritz Grimm committed
639
        If (NOT /ezstream/metadata/program AND '@t@ is present')
640
641
642
643
644
645
646
647
648
            Replace with empty string.
        else
            Replace with generated metadata string.
        Endif
    Endif
Endif
.Ed
.Pp
The generated metadata string for
649
.Sq Li @M@
650
is of the format
651
.Dq Em Artist - Title ,
652
653
654
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
655
656
657
.Dq Em Artist .
If neither artist nor title are available, the name of the media file \(em
without its file extension \(em is used.
658
659
660
661
662
663
.Ss Metadata Caveats
It is possible to generate strange results with odd combinations of
placeholders, external metadata programs and updates during runtime via
.Sy SIGUSR2 .
If things start to become just confusing, simplify.
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
664
Metadata updates during runtime are done with a eccentric feature of libshout.
665
666
667
668
669
670
671
Additional metadata information that is already present in the stream sent via
.Nm
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
.Sy SIGUSR2
feature will continue to end up entirely in the
672
.Qq Em Title
673
field of a stream.
674
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
675
676
677
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.
678
.Pp
Moritz Grimm's avatar
Moritz Grimm committed
679
680
681
The ID3v1 tags
.Pq relevant when streaming in MP3 format
do not specify any character encoding, so
682
.Nm
Moritz Grimm's avatar
Moritz Grimm committed
683
684
685
686
operates in a manner of
.Dq best effort .
In case of encoding issues, it may help to explicitly set a codeset to work
with via the
687
.Ev LC_CTYPE
688
689
690
691
692
693
694
environment variable, as
.Nm
assumes ID3v1 tags to be in the user's current locale.
Note that, even though support for different locales is provided by
.Nm ,
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
Moritz Grimm's avatar
Moritz Grimm committed
695
to use only the characters available in the ISO-8859-1 codeset.
696
697
698
.Pp
External encoders may put additional, and possibly artificial, restrictions on
valid characters in metadata.
moritz's avatar
moritz committed
699
700
701
702
.Sh FILES
.Bl -tag -width "!!EXAMPLES_DIR!!" -compact
.It Pa !!EXAMPLES_DIR!!
Directory containing example configuration files for various uses of
703
704
.Nm ,
as well as example playlist and metadata scripts.
moritz's avatar
moritz committed
705
.El
706
707
.Sh SEE ALSO
.Xr ezstream-file.sh 1
moritz's avatar
moritz committed
708
709
710
711
712
.Sh AUTHORS
.Nm
was written by:
.Pp
.An Ed Zaleski Aq oddsock@oddsock.org
713
.An Moritz Grimm Aq mgrimm@mrsserver.net
moritz's avatar
moritz committed
714
.Pp
715
716
717
.An -nosplit
This manual was written by
.An Moritz Grimm .