I need to extract the ICY metadata from a live audio stream and was looking at doing this using mplayer as this outputs the metadata as it plays the audio stream. I'm open to other ways of doing this, the goal is to have the updated metadata (song info) saved to a text file that will update whenever the song (or data) changes.
One of the reasons I want to use mplayer is to ensure it works on the most diverse streams available (rather than just Shoutcast/Icecast).
I am able to extract the metadata now using this simple line : mplayer http://streamurl
The problem is that I do not want to keep calling it every x seconds as it fills up the destination server logs with x second calls (connect/disconnect).
I'd rather have it permanently connected to the stream and use the output of mplayer to output the icy metadata whenever the song updates.
The reason I do not want to just connect every x seconds is because I need quite a bit of granularity and would be checking every 10-15 seconds for an update.
I'd be happy to do this a different way, but would ultimately need the data outputted to a .txt file somehow.
Any pointers on how to achieve this would be greatly appreciated.