John Selbie
2014-Jul-06 06:43 UTC
[Icecast-dev] How do you escape characters within the metadata block
When "Icy-MetaData: 1" is in the HTTP request to the server, that indicates that the client wants to receive meta data inlined with the mp3 data stream. The metadata interval is reported by the server via the "icy-metaint" header in the response stream. Such data looks like the following within the mp3 stream StreamTitle='Ozzy Osbourne - Crazy Train';StreamUrl='http://myserver.org'; Essentially a series of name/value pairs formatted with single-tick quotes around each value and delimited with Equals and Semicolon chars. Here is the question. If the song title itself contains a quote char in it: StreamTitle='Destiny's Child - Emotion'; How is the tick mark within that stream title expected to be escaped such that the StreamTitle isn't parsed as just "Destiny" ? Is it a URL Encoding (StreamTitle='Destiny%27s Child - Emotion';) ? A C style Encoding (StreamTitle='Destiny\'s Child - Emotion';) ? Or something else? I didn't see any escape code in the icecast server sources. But I did see URL encodings for metadata in the libshout broadcast client sources. So I suspect that's the answer. But I wasn't sure if the server did any re-encoding on the strings. Can someone confirm? jrs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast-dev/attachments/20140705/464a88bb/attachment.htm
"Thomas B. Rücker"
2014-Jul-10 11:35 UTC
[Icecast-dev] How do you escape characters within the metadata block
On 07/06/2014 06:43 AM, John Selbie wrote:> When "Icy-MetaData: 1" is in the HTTP request to the server, that > indicates that the client wants to receive meta data inlined with the > mp3 data stream. The metadata interval is reported by the server via > the "icy-metaint" header in the response stream. > > Such data looks like the following within the mp3 stream > > StreamTitle='Ozzy Osbourne - Crazy > Train';StreamUrl='http://myserver.org'; > > Essentially a series of name/value pairs formatted with single-tick > quotes around each value and delimited with Equals and Semicolon chars. > > Here is the question. If the song title itself contains a quote char > in it: > > StreamTitle='Destiny's Child - Emotion'; > > How is the tick mark within that stream title expected to be escaped > such that the StreamTitle isn't parsed as just "Destiny" ? > > Is it a URL Encoding (StreamTitle='Destiny%27s Child - Emotion';) ? > > A C style Encoding (StreamTitle='Destiny\'s Child - Emotion';) ? > > Or something else? > > I didn't see any escape code in the icecast server sources. But I did > see URL encodings for metadata in the libshout broadcast client > sources. So I suspect that's the answer. But I wasn't sure if the > server did any re-encoding on the strings. > > Can someone confirm?That's legacy-metadata, modelled after Shoutcast. So you'd need to look how they do it and how players then expect it. It is possible that there is a genuine bug in Icecast for not escaping this, but the core team has no time to spend on legacy support. So if someone wants to see this fixed, send a patch please, together with some explanation how it follows general practice (there is no standard). Cheers Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast-dev/attachments/20140710/fbef370a/attachment.htm
"Thomas B. Rücker"
2014-Jul-10 17:27 UTC
[Icecast-dev] How do you escape characters within the metadata block
Hi, On 07/10/2014 05:17 PM, John Selbie wrote:> Since you call it legacy, that implies there might be a new way to > accomplish what I am I trying to do.The "new" way is to use an open encapsulation format like Ogg or WebM. Ogg has well defined metadata and is well suited for streaming. WebM doesn't deal well with metadata updates. Support for Vorbis, Opus and WebM is decent in players nowadays. Also Android can handle that and should deal much better with the metadata as it's part of the Ogg spec and not retrofitted into a raw bit-stream. Cheers Thomas