Couldn't you also just have a client stream locally from icecast that can do things on metadata change? I mean it's a bit icky but it'd work. ---- Philipp Schafft wrote ---->Good morning, > >On Thu, 2018-11-08 at 12:45 -0500, Alex Hackney wrote: >> I actually got this to work this morning finally. The problem was on my >> auth server. > >Perfect. :) > > >> I see the source auth hook being sent a lot, is there anyway to get the >> current metadata in that hook? > >No. The auth happens long before the client is attached to any source. >In fact in Icecast 2.5.x the auth backend can even redirect the client >to other resources. > > >> Ideally, every time the source is updated, I'd like to get a hook so I >> can track the songs that are being played. Alternatively, the only way I >> can see doing it, is to make a get request every X seconds and watch for >> the song to change. > >There currently isn't one. For 2.5.x there already is a ticket[0] for >that. > >What you can do is polling the status XML. You can also use the STATS >interface[1]. Also there is the playlist log. You can watch and follow >that file to see when updates are made. > >With best regards, > > > >[0] https://gitlab.xiph.org/xiph/icecast-server/issues/2189 >[1] Try it with: wget -qO - --method=STATS >http://admin:hackme at icecast.example.org:8000/ > > >-- >Philipp Schafft (CEO/Geschäftsführer) >Telephon: +49.3535 490 17 92 > >Löwenfelsen UG (haftungsbeschränkt) Registration number: >Bickinger Straße 21 HRB 12308 CB >04916 Herzberg (Elster) VATIN/USt-ID: >Germany DE305133015 > >_______________________________________________ >Icecast mailing list >Icecast at xiph.org >http://lists.xiph.org/mailman/listinfo/icecast-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast/attachments/20181109/b2a8d824/attachment.html>
Good morning, On Fri, 2018-11-09 at 22:56 +1300, Jake wrote:> Couldn't you also just have a client stream locally from icecast that > can do things on metadata change? I mean it's a bit icky but it'd > work.If you know any player that can do things on metadata change and works for the given setup: sure. Why not? The main downside of this is that it may require a little bit more setup and requires more resources as the player will likely decode the actual stream as well. With best regards,> ---- Philipp Schafft wrote ---- > > >Good morning, > > > >On Thu, 2018-11-08 at 12:45 -0500, Alex Hackney wrote: > >> I actually got this to work this morning finally. The problem was on my > >> auth server. > > > >Perfect. :) > > > > > >> I see the source auth hook being sent a lot, is there anyway to get the > >> current metadata in that hook? > > > >No. The auth happens long before the client is attached to any source. > >In fact in Icecast 2.5.x the auth backend can even redirect the client > >to other resources. > > > > > >> Ideally, every time the source is updated, I'd like to get a hook so I > >> can track the songs that are being played. Alternatively, the only way I > >> can see doing it, is to make a get request every X seconds and watch for > >> the song to change. > > > >There currently isn't one. For 2.5.x there already is a ticket[0] for > >that. > > > >What you can do is polling the status XML. You can also use the STATS > >interface[1]. Also there is the playlist log. You can watch and follow > >that file to see when updates are made. > > > >With best regards, > > > > > > > >[0] https://gitlab.xiph.org/xiph/icecast-server/issues/2189 > >[1] Try it with: wget -qO - --method=STATS > >http://admin:hackme at icecast.example.org:8000/ > > > > > >-- > >Philipp Schafft (CEO/Geschäftsführer) > >Telephon: +49.3535 490 17 92 > > > >Löwenfelsen UG (haftungsbeschränkt) Registration number: > >Bickinger Straße 21 HRB 12308 CB > >04916 Herzberg (Elster) VATIN/USt-ID: > >Germany DE305133015-- Philipp Schafft (CEO/Geschäftsführer) Telephon: +49.3535 490 17 92 Löwenfelsen UG (haftungsbeschränkt) Registration number: Bickinger Straße 21 HRB 12308 CB 04916 Herzberg (Elster) VATIN/USt-ID: Germany DE305133015 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: This is a digitally signed message part URL: <http://lists.xiph.org/pipermail/icecast/attachments/20181109/b315df26/attachment.sig>
Yeah it is a tad gross but here is my first (and probably only) attempt: ---------------- 8< ---------------- #!/bin/bash pipe=/tmp/testpipe trap "rm -f $pipe" EXIT if [[ ! -p $pipe ]]; then mkfifo $pipe fi mplayer -slave -playlist "http://my.icecast.stream/music" > /tmp/testpipe 2> /dev/null & while true do if read line <$pipe; then echo $line /bin/dothing "$line" fi done echo "Reader exiting" ---------------- 8< ---------------- Basically use mplayer to stream, redirecting its output to a named pipe. Then, read line on the pipe for ever, once a line comes in echo it and call /bin/dothing "$line", then go back to read line. The script is basic and would need a little work to ignore all lines that don't start with "ICY Info: " since the output is something like: ---------------- 8< ---------------- Resolving my.icecast.stream for AF_INET6... Resolving my.icecast.stream for AF_INET... Connecting to server my.icecast.stream: 80... Name : name Genre : Misc Website: http://savonet.sf.net Public : yes Cache size set to 320 KBytes ICY Info: StreamTitle='Regurgitator - ! (The Song Formerly Known As)'; ICY Info: StreamTitle='Queens of the Stone Age - Walkin' On The Sidewalks'; ICY Info: StreamTitle='foo - bar'; ICY Info: StreamTitle='Another Metadata Change'; ... ... ... ... ---------------- 8< ---------------- but yeah something like this might work fine until a better solution comes along. Jake ~ On 2018-11-09 23:09, Philipp Schafft wrote:> Good morning, > > On Fri, 2018-11-09 at 22:56 +1300, Jake wrote: >> Couldn't you also just have a client stream locally from icecast that >> can do things on metadata change? I mean it's a bit icky but it'd >> work. > > If you know any player that can do things on metadata change and works > for the given setup: sure. Why not? > > The main downside of this is that it may require a little bit more > setup > and requires more resources as the player will likely decode the actual > stream as well. > > With best regards, > >> ---- Philipp Schafft wrote ---- >> >> >Good morning, >> > >> >On Thu, 2018-11-08 at 12:45 -0500, Alex Hackney wrote: >> >> I actually got this to work this morning finally. The problem was on my >> >> auth server. >> > >> >Perfect. :) >> > >> > >> >> I see the source auth hook being sent a lot, is there anyway to get the >> >> current metadata in that hook? >> > >> >No. The auth happens long before the client is attached to any source. >> >In fact in Icecast 2.5.x the auth backend can even redirect the client >> >to other resources. >> > >> > >> >> Ideally, every time the source is updated, I'd like to get a hook so I >> >> can track the songs that are being played. Alternatively, the only way I >> >> can see doing it, is to make a get request every X seconds and watch for >> >> the song to change. >> > >> >There currently isn't one. For 2.5.x there already is a ticket[0] for >> >that. >> > >> >What you can do is polling the status XML. You can also use the STATS >> >interface[1]. Also there is the playlist log. You can watch and follow >> >that file to see when updates are made. >> > >> >With best regards, >> > >> > >> > >> >[0] https://gitlab.xiph.org/xiph/icecast-server/issues/2189 >> >[1] Try it with: wget -qO - --method=STATS >> >http://admin:hackme at icecast.example.org:8000/ >> > >> > >> >-- >> >Philipp Schafft (CEO/Geschäftsführer) >> >Telephon: +49.3535 490 17 92 >> > >> >Löwenfelsen UG (haftungsbeschränkt) Registration number: >> >Bickinger Straße 21 HRB 12308 CB >> >04916 Herzberg (Elster) VATIN/USt-ID: >> >Germany DE305133015 > > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast
On Nov 9, 2018, at 05:09, Philipp Schafft <phschafft at de.loewenfelsen.net> wrote:> If you know any player that can do things on metadata change and works > for the given setup: sure. Why not?I know of at least one: https://github.com/RadioFreeAsia/GlassPlayer Which can be invoked so as to output received metadata synchronously on STDOUT in a well-defined format. The intended use cases are things like event cueing such as is used in classic radio broadcast applications. The metadata is derived from the actual received bitstream —i.e. no mucking about with polling the administrative interface — so good timing accuracy can be maintained. Cheers! |----------------------------------------------------------------------| | Frederick F. Gleason, Jr. | Chief Developer | | | Paravel Systems | |----------------------------------------------------------------------| | A room without books is like a body without a soul. | | -- Cicero | |----------------------------------------------------------------------| -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast/attachments/20181109/c9c9c020/attachment.html>