Dalam tulisan kali ini saya akan sedikit mengulas aplikasi GlassCOder – Audio Encoder yang minimalis dan saat ini hanya berjalan di OS Linux. Untuk rekan rekan yang suka ngoprek linux, bisa mencobanya.
Aplikasi ini sudah support beberapa format Audio :
MPEG-1/1.5 Layer 2 (‘MP2’), MPEG-1/1.5 Layer 3 (‘MP3’), MPEG-4 Advanced Audio Coding, High Efficiency Profile (‘HE-AAC+’), Ogg Opus, Ogg Vorbis
Untuk saat ini GlassCoder belum memiliki interface GUI, semua masih berbasisi command line, namun bagi yang suka ngoprek dan coding, bisa membuat script sendiri untuk ngontrol aplikasi nya. Aplikasi ini bisa mengirimkan audio ke Icecast, Shoutcast atau post dalam bentuk format HTTP Live Streams [HLS].
Berikut saya sertakan OPTION yang ada dalam DOC GlassCoder
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
Not all URL schemes are supported by all server types. The following chart breaks down the options. Table 1. Supported URL Schemes by Server Type ┌──────────────┬───────────┬───────────┬──────────┐ │ Server Type │ FILE:// │ HTTP:// │ SFTP:// │ ├──────────────┼───────────┼───────────┼──────────┤ │FILE │ Yes │ No │ No │ ├──────────────┼───────────┼───────────┼──────────┤ │FILEARCHIVE │ Yes │ No │ No │ ├──────────────┼───────────┼───────────┼──────────┤ │HLS │ Yes │ Yes [1] │ Yes [3] │ ├──────────────┼───────────┼───────────┼──────────┤ │IceCast2 │ No │ Yes [2] │ No │ ├──────────────┼───────────┼───────────┼──────────┤ │IceOut │ No │ Yes │ No │ ├──────────────┼───────────┼───────────┼──────────┤ │IceStreamer │ No │ Yes │ No │ ├──────────────┼───────────┼───────────┼──────────┤ │Shout1 │ No │ Yes [2] │ No │ ├──────────────┼───────────┼───────────┼──────────┤ │Shout2 │ No │ Yes [2] │ No │ ├──────────────┴───────────┴───────────┴──────────┤ │[1] Utilizes the HTTP PUT and DELETE methods │ ├─────────────────────────────────────────────────┤ │[2] Utilizes the HTTP GET method │ ├─────────────────────────────────────────────────┤ │[3] Supports ssh(1) password authentication only │ └─────────────────────────────────────────────────┘
METADATA
GlassCoder supports the notion of two types of metadata: "channel-based" metadata, which applies to the stream as a whole and does not change for the duration of an encoding session; and "timed" metadata, which 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 will be 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 those 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.
BUGS
SFTP:// transfers are done in "insecure" mode (due to crippled support for ssh(1) host keys in curl(1)). ssh(1) public key authentication is unsupported (due to crippled support for ed25519 keys in curl(1)). Ogg metadata support is still missing.
Oke…, mudah mudahan tulisan ini bisa bermanfaat.