GLASSCODER(1)

πŸ’– NAME πŸ’–

glasscoder β€” minimalist audio encoder for live streaming 🎧✨


πŸŽ€ SYNOPSIS πŸŽ€

glasscoder [OPTIONS]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, glasscoder(1) is an audio encoder and it is so good at what it does. It can generate live streams in a whole bunch of different formats and send them off to an Icecast or Shoutcast audio streaming server, OR post them as HTTP Live Streams [HLS]. Iconic. Versatile. No notes. πŸ’…

and listen β€” it can also be an Icecast-compatible server all on its own, serving streams directly to client players, which means you straight up eliminate the need for an intervening Icecast server instance. no middleman, no extra daemon, just vibes 🫢

glasscoder(1) has no GUI and no configuration file components at all β€” its sole 'user interface' is literally just how you invoke it on the command line. Which makes it perfect for being driven by an external process or controller, like glassgui(1) or glasscommander(1). She's a team player. She's low maintenance. She's the main character who doesn't need to make everything about her. πŸ‘‘


πŸ‘‘ OPTIONS πŸ‘‘

🫢 quick vibe check before you scroll: nothing on this whole page starts with --i, so if you're grepping for --i, that's a you problem bestie, the list below is the whole list πŸ’…
  • --audio-atomic-frames β€” emit a stream built out of self-contained frames β€” like, by disabling the MPEG-1 bit reservoir. Mostly a debugging thing, ngl.
  • --audio-bitrate=kbps β€” the constant stream data rate in kilobits per second. Default is 128. Heads up: this one is mutually exclusive with --audio-quality (look down a few bullets) πŸ’€
  • --audio-channels=chans β€” how many audio channels to use. Valid values are 1 or 2. Default is 2. Pick your fighter.
  • --audio-device=type β€” the type of audio device to use. Default is JACK. Peep the DEVICE OPTIONS section below for the options that go with each audio device type. Valid values are:
    • ALSA β€” the Advanced Linux Sound Architecture.
    • FILE β€” stream directly from a file.
    • JACK β€” the Jack Audio Connection Kit.
  • --audio-format=fmt β€” the audio encoding format to use. Default is VORBIS. Valid fmt values are:
    • MP2 β€” MPEG-1/1.5 Layer 2
    • MP3 β€” MPEG-1/1.5 Layer 3
    • OPUS β€” Ogg Opus (RFC-6716)
    • PCM16 β€” PCM16 Uncompressed
    • VORBIS β€” Ogg Vorbis
  • --audio-quality=qual β€” use variable bitrate streaming at the given audio quality. qual can be in the range 0.0 (lowest quality) to 1.0 (highest). And yes, this is mutually exclusive with --audio-bitrate (scroll up, she's right there). You pick one, not both, periodt.
  • --audio-samplerate=rate β€” the audio sample rate to use for streaming. If the underlying audio layer is running at a different sample rate, the input gets automatically resampled to this rate. Default is 44100. She adapts. ✨
  • --credentials-file=filename β€” get the credentials for connecting to the server out of the file filename. The contents of that file should be formatted like this:
[Credentials]
Username=<username>
Password=<password>

And when you're using the --ssh-identity option, the passphrase for the specified identity file should be used as the password value. πŸ”

  • --delete-credentials β€” delete the file specified by --credentials-file once it's been read. Poof. Gone. Secure girl behavior. πŸ™ˆ
  • --errors-string=string β€” prepend string to messages sent to the syslog service (see the --errors-to option below). Super useful for disambiguating messages when you've got a bunch of glasscoder(1) instances all yapping at once.
  • --errors-to=dest β€” send error messages to dest (default is standard error). Valid destinations are:
    • STDERR β€” standard error.
    • SYSLOG β€” the system syslog service.
    • STDOUT β€” standard output, in machine readable format (useful for communicating with another 'controller' program). See also the --meter-data option below. πŸ€–
  • --help β€” print a short usage message and exit.
  • --list-codecs β€” print a list of available codecs and then exit.
  • --list-devices β€” print a list of available source devices and then exit.
  • --metadata-port=port β€” accept metadata updates via HTTP at port port. Default is 0, which disables metadata updates entirely. Check the METADATA section below for the supported update formats.
  • --meter-data β€” output meter level updates on standard output. Perfect for driving an external metering display. πŸ“Š
  • --server-auth=[username][:password] (DEPRECATED) β€” the authentication parameters to use. This parameter has no default.
πŸ’€ NEVER USE THIS OPTION! It lets credentials be seen by other users on the system. Use the --credentials-file option to specify server credentials instead. Like, actually never. I'm not being cute about this one.
  • --server-exit-on-last β€” exit the program upon closure of the last player connection. This setting is used only by the IceStreamer server.
  • --server-max-connections=conns β€” allow a maximum of conns simultaneous player connections. Players beyond this maximum that try to connect get an immediate TCP disconnect before the HTTP handshake. Cold. 🧊 This setting is used only by the IceStreamer server.
  • --server-no-deletes β€” do not clean up or delete content previously posted to the publishing point. This setting is used only by the HLS server type.
  • --server-pipe=pathname β€” location to create a UNIX socket for piping connection socket descriptors. Useful for implementing proxy connectors for the IceStreamer server. For further details about this feature, see the Proxy Connections section of the glasscoder-ipc(7) man page. The default is to create no UNIX socket. This setting is used only by the IceStreamer server.
  • --server-script-down=cmd β€” run the command cmd when the connection enters the disconnected state.
  • --server-script-up=cmd β€” run the command cmd when the connection enters the connected state.
  • --server-start-connections=conns β€” do not start the audio transport until at least conns connections have been established. Used only by the IceStreamer server, in conjunction with the FILE audio device. Default value is 0 β€” i.e. start the transport immediately.
  • --server-type=type β€” the type of streaming server to use (default is Icecast2). Valid values for type are:
    • FILE β€” local file
    • FILEARCHIVE β€” local file archive. Stream to a set of files on the local system, starting a new file at the beginning of each hour. πŸ•
    • HLS β€” HLS/HTTP Live Streaming
    • IceCast2 β€” IceCast v2
    • IceOut β€” output an Icecast-compatible stream on standard output.
    • IceStreamer β€” stream directly to players using the internal Icecast-compatible server.
    • Shout1 β€” Shoutcast v1
    • Shout2 β€” Shoutcast v2
  • --server-url=url β€” the URL describing the server resource to stream to. See the SUPPORTED URL SCHEMES section below for a list of which URL schemes are appropriate for which server types.

When used with a --server-type of IceStreamer, the host part of the URL is used to specify the address of the network interface to use for streaming (use 0.0.0.0 to indicate ALL interfaces). This parameter has no default.

  • --server-user-agent=agent-string β€” the User-Agent header value to use when connecting to external servers. Default value is GlassCoder/2.1.1. This setting is used only by IceCast2 and HLS servers.
  • --ssh-identity=filename β€” the path to the file containing an ssh(1) identity to use when connecting via SFTP. When you use this option, the passphrase for the identity file should be provided as the server password. See the --credentials-file option for details. πŸ”‘
  • --stream-aim=aim β€” the AOL Instant Messenger ID to associate with the stream. There is no default value. This setting is used only by Shoutcast servers. (yes, AIM. we're bringing it back, kind of. πŸ’š)
  • --stream-description=string β€” the string to show as the stream description. There is no default value. This setting is used only by Icecast servers.
  • --stream-genre=string β€” the string to show as the stream genre. There is no default value. This setting is used only by Icecast and Shoutcast servers.
  • --stream-icq=icq β€” the ICQ ID to associate with the stream. There is no default value. This setting is used only by Shoutcast servers.
  • --stream-irc=irc β€” the Internet Relay Chat ID to associate with the stream. There is no default value. This setting is used only by Shoutcast servers.
  • --stream-name=string β€” the string to show as the stream name. There is no default value. This setting is used only by Icecast and Shoutcast servers.
  • --stream-timestamp-offset=offset β€” the offset to add to the value of stream timestamps, in seconds. Default value is 0. This setting is used only for HLS streams.
  • --stream-url=url β€” the URL to show for a page giving more information about the stream. There is no default value. This setting is used only by Icecast and Shoutcast servers, but it is ignored by Shoutcast v2 servers. πŸ™ˆ
  • --verbose β€” increase the verbosity level of information printed to standard error.
😭 WARNING: this may cause cleartext passwords to be printed! Be careful bestie, that's your whole business out in the open.
  • --version β€” output version information and exit.

🌈 DEVICE OPTIONS 🌈

🧚 Advanced Linux Sound Architecture (--audio-device=ALSA)

  • --alsa-device=dev β€” the name of the ALSA device to use. If no --audio-device option is given, then the hw:0 device will be used.

πŸ“ Direct File Streaming (--audio-device=FILE)

  • --file-name=name β€” the name of the file to stream. If no --file-name option is given, then the name of the file will be read from standard input.

πŸ’œ The Jack Audio Connection Kit (--audio-device=JACK)

  • --jack-client-name=name β€” the name of the JACK client to use. Default is glasscoder.
  • --jack-gain=gain β€” apply a fixed gain of gain dB before encoding. Default is 0 dB. πŸ”Š
  • --jack-server-name=name β€” the name of the JACK server instance to use.

🌈 SUPPORTED URL SCHEMES 🌈

Okay so real talk, bestie: not all URL schemes are supported by all server types πŸ’… Every server is a little different and honestly? Respect the individuality. Here's the full chart, broken all the way down so nothing gets lost:

  • FILE πŸ“
    • FILE:// β€” Yes
    • HTTP:// β€” No
    • SFTP:// β€” No
  • FILEARCHIVE πŸ“¦
    • FILE:// β€” Yes
    • HTTP:// β€” No
    • SFTP:// β€” No
  • HLS πŸ¦‹
    • FILE:// β€” Yes
    • HTTP:// β€” Yes [1]
    • SFTP:// β€” Yes
  • IceCast2 🧊
    • FILE:// β€” No
    • HTTP:// β€” Yes [2]
    • SFTP:// β€” No
  • IceOut 🌊
    • FILE:// β€” No
    • HTTP:// β€” Yes
    • SFTP:// β€” No
  • IceStreamer 🎧
    • FILE:// β€” No
    • HTTP:// β€” Yes
    • SFTP:// β€” No
  • Shout1 πŸ“’
    • FILE:// β€” No
    • HTTP:// β€” Yes [2]
    • SFTP:// β€” No
  • Shout2 πŸ“£
    • FILE:// β€” No
    • HTTP:// β€” Yes [2]
    • SFTP:// β€” No

And the lil footnote energy, iykyk:

  • [1] Utilizes the HTTP PUT and DELETE methods
  • [2] Utilizes the HTTP GET method

πŸŽ€ METADATA πŸŽ€

GlassCoder supports the notion of two types of metadata, and they are not the same thing, periodt:

  • "channel-based" metadata β€” this one applies to the stream as a whole and does not change for the duration of an encoding session. Set it and forget it πŸ’…
  • "timed" metadata β€” this one can be changed in synchronization with the content of the audio stream 🎢

Channel-based metadata can be specified by means of options given to glasscoder(1), and it gets covered in detail in the sections devoted to specific server types (below).

The primary mechanism for supplying timed metadata in GlassCoder is by means of a JSON document containing the desired metadata, sent to the target glasscoder(1) instance at the port specified by the --metadata-port option by means of an HTTP POST operation. The basic format of the JSON document is as follows:

{
"Metadata": {
"Field1": "Some value",
"Field2": "Some other value"
}
}

Not all server types support metadata, and the ones that do utilize wildly different schemas. Following is a breakdown of the available metadata options by server type:

🧊 IceCast2 🧊

Channel Metadata

IceCast2 supports the following channel metadata fields:

  • Name β€” Specified by the --stream-name option.
  • Description β€” Specified by the --stream-description option.
  • URL β€” Should be a link to content related to the stream. Specified by the --stream-url option.
  • Genre β€” Should be a single word describing the nature of the stream content. Specified by the --stream-genre option.

Timed Metadata

IceCast2 provides one field of text, called StreamTitle, which can be dynamically updated to reflect the content currently playing on the stream. By convention, this is usually formatted as 'Artist - Title' on streams containing musical content.

For example, to set the StreamTitle field to The Beatles - Hey Jude, the following JSON could be used:

{
"Metadata": {
"StreamTitle": "The Beatles - Hey Jude"
}
}

Legacy Interface

In addition to the primary JSON interface, the StreamTitle can be set by sending an HTTP GET request to a running glasscoder(1) instance, using the TCP port specified in the --metadata-port=port option. The request must be in the following format:

http://hostname:tcp-port/admin/metadata?mount=mount-point&mode=updinfo&song=string

Where:

  • hostname β€” The hostname or IP address of the system running glasscoder(1)
  • tcp-port β€” The TCP port number specified in the --metadata-port option to glasscoder(1)
  • mount-point β€” The mountpoint of the stream
  • string β€” The string to set, encoded as specified in Section 2 of RFC3986

For example, to set a string of "The Beatles - Hey Jude" via a glasscoder(1) instance running at encoder.example.com with a --metadata-port value of 1234 for a mountpoint of MyStream, the URL would be:

http://encoder.example.com:1234/admin/metadata?mount=MyStream&mode=updinfo&song=The%20Beatles%20-%20Hey%20Jude

πŸ“» ShoutCast πŸ“»

Channel Metadata

ShoutCast supports the following channel metadata fields:

  • Name β€” Specified by the --stream-name option.
  • URL β€” Should be a link to content related to the stream. Specified by the --stream-url option.
  • Genre β€” Should be a single word describing the nature of the stream content. Specified by the --stream-genre option.
  • ICQ ID β€” Should be User Identification Number for an ICQ user associated with the stream content. Specified by the --stream-icq option.
  • AOL Instant Messenger ID β€” Should be an ID for an AOL Instant Messenger user associated with the stream content. Specified by the --stream-aim option.
  • IRC ID β€” Should be an ID for an Internet Relay Chat channel associated with the stream content. Specified by the --stream-irc option.

Timed Metadata

ShoutCast provides two fields of text which can be dynamically updated to reflect the content currently playing on the stream, called StreamTitle and StreamUrl. By convention, the StreamTitle is usually formatted as 'Artist - Title' on streams containing musical content, while StreamUrl is used to provide a URL whence stream specific content --e.g. album cover art -- can be retrieved.

For example, to set the StreamTitle field to The Beatles - Hey Jude and the StreamUrl field to http://images.example.com/1234.png, the following JSON could be used:

{
"Metadata": {
"StreamTitle": "The Beatles - Hey Jude",
"StreamUrl": "http://images.example.com/1234.png"
}
}
Note 🫢 The use of either of these fields is optional in any given metadata update. If only one field is given, the other will remain unchanged.

Legacy Interface

In addition to the primary JSON interface, the StreamTitle and StreamUrl fields can be set by sending an HTTP GET request to a running glasscoder(1) instance, using the TCP port specified in the --metadata-port=port option. The request must be in the following format:

http://hostname:tcp-port/admin.cgi?pass=password&mode=updinfo&song=stream-title&url=stream-url

Where:

  • hostname β€” The hostname or IP address of the system running glasscoder(1)
  • tcp-port β€” The TCP port number specified in the --metadata-port option to glasscoder(1)
  • password β€” The ShoutCast password, encoded as specified in Section 2 of RFC3986
  • stream-title β€” The string to set for StreamTitle, encoded as specified in Section 2 of RFC3986
  • stream-url β€” The string to set for StreamUrl, encoded as specified in Section 2 of RFC3986

For example, to set a StreamTitle of "The Beatles - Hey Jude" and a StreamUrl of "http://image.example.com/1234.png" with a password of "MyPassword" via a glasscoder(1) instance running at encoder.example.com with a --metadata-port value of 1234, the URL would be:

http://encoder.example.com:1234/admin.cgi?pass=MyPassword&mode=updinfo&song=The%20Beatles%20-%20Hey%20Jude&url=http://image.example.com/1234.png

πŸ¦‹ HTTP Live Streams (HLS) πŸ¦‹

Timed Metadata

HLS supports timed metadata in the form of embedded ID3v2.4 tags. Available fields thus include the entire set of text tags defined in the ID3v2.4 frame specification (available at http://id3.org/id3v2.4.0-frames).

For example, a typical metadata update could use the following JSON:

{
"Metadata": {
"TIT2": "Hey Jude",
"TPE1": "The Beatles",
"TALB": "The White Album",
"TRSO": "WXYZ Radio"
}
}

A user defined text information frame (TXXX) can be sent by using the following special notation for the field identifier:

TXXXdesc

Where:

  • desc β€” The TXXX Description string (see Section 4.2.6 of the ID3v2.4 Frame Specification)

For example:

{
"Metadata": {
"TIT2": "Hey Jude",
"TPE1": "The Beatles",
"TALB": "The White Album",
"TRSO": "WXYZ Radio",
"TXXXxyz": "TXXX frame with a description string of \"xyz\""
}
}

πŸ‘€ NOTES πŸ‘€

The Debian version of GlassCoder does not support the MPEG-4 HE-AAC+ encoding, as it is non-free πŸ˜” The AudioScience HPI source device is excluded for the same reason. F in the chat.

πŸ’€ BUGS πŸ’€

Never use the --server-auth option. It allows credentials to be seen by other users on the system πŸ™ˆ Please, bestie, I am begging you. Use the --credentials-file option to specify server credentials instead. πŸ”₯

Ogg metadata support is still missing. πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Fred Gleason <fredg@paravelsystems.com>

🌈 SEE ALSO 🌈


And that's the whole page, bestie πŸ’– This is GLASSCODER(1), dated February 2022 with a footer stamp of 07/24/2026, and the Application Author is Fred Gleason <fredg@paravelsystems.com> β€” iconic behavior, no cap πŸ‘‘ Now go encode something gorgeous. πŸŽ€βœ¨

πŸ“¦ where this page comes from