-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm trying to write a PHP script that communicates with the Icecast2 server directly to retrieve current song information. Since the documentation for the ICE/SHOUT protocol is, frankly, pretty much non-existant, I did a search on Google and eventually came up with this site: http://www.smackfu.com/stuff/programming/shoutcast.html I did some experimenting with this information and my Icecast2 server and, after a few telnet sessions, determined that those instructions were incorrect (at least with Icecast servers). I assume that this is due to the fact that there is no constant bitrate for Ogg Vorbis streams and, therefore, information on how far apart meta-intervals is not available at the time the packet is sent out. Should I just buffer the socket until I find "StreamName=" (hopefully THIS isn't different) or is there a better way of doing this? (Please say there is, and please don't say it's by doing 'directory' sends to the script, since I really want the titles to be live, not delayed. This will, however, be my temporary solution, as soon as I figure out what data THAT sends.) Thanks for any help you can give me! __________ Colin Snover -----BEGIN PGP SIGNATURE----- Version: PGP 7.0.4 iQA/AwUBPiNxbdAVcJC+uaATEQJnugCg18NXyPZo5h9WPCI3ceynxl3MZ5EAnAo1 NfQ4I34Og+L5mjjIU44anCJM =UQSr -----END PGP SIGNATURE----- --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
msmith@labyrinth.net.au
2004-Aug-06 14:57 UTC
[icecast-dev] ice-metadata header incomplete?
Colin Snover <colin@zetafleet.com> said:> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm trying to write a PHP script that communicates with the Icecast2 server > directly to retrieve current song information. Since the documentation for > the ICE/SHOUT protocol is, frankly, pretty much non-existant, I did a search > on Google and eventually came up with this site: > http://www.smackfu.com/stuff/programming/shoutcast.html >If you're streaming mp3, and your streaming client supports setting metadata on icecast2 servers (this requires, among other things, a version of icecast2 no more than two weeks old. I know of no source clients other than very recent versions of oddsock that can do this correctly), then this should work. However, this is horrifically inefficient - you're getting the entire stream even though you're interested solely in the metadata. It also only works for mp3. If you're streaming ogg vorbis, then the metadata is transmitted in the actual ogg vorbis data, according to the specification. You can read the specification for details on how to make use of this. A better way to do this is to request /admin/stats.xml from the server, and parse the information you're interested in out of this (I think it's included, though I haven't checked). You'll need to authenticate to get this document, with username "source", and whatever password you have configured. Mike --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike, I followed your advice on using stats.xml (thanks!). One thing I should point out for future reference is that it's actually just in the root / and not in /admin/. Anyway, there seems to be a problem with the XML parser, since it does not return the full name of the artist if there is, for example, an ampersand (&) in the artist name. This could very well be a problem with LIBXML. In any case, someone on the devel team should probably take a look. (You guys out there? ;)) This does not occur with other characters I would assume would give problems (forward- and backward-slashes, dashes), and trying to escape it by either "&&" or "\&" did not fix the problem. __________ Colin Snover -----BEGIN PGP SIGNATURE----- Version: PGP 7.0.4 iQA/AwUBPiSEgdAVcJC+uaATEQKtOwCdHQs2l7ZNyQ1hz9qQYR9qrhAeLooAn1DE UkFYDwUZIcn2UJOTyXhBO0o8 =Zfcb -----END PGP SIGNATURE----- --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.