extract stream title from the output of mplayer

J

Jabba Laci

Hi,

I have a simple command-line radio player and I want to extract song
titles from the output of mplayer.

Example:

$ mplayer http://relay2.slayradio.org:8000/

It produces a streamed output of this form:

MPlayer2 UNKNOWN (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
....
ICY Info: StreamTitle='Alexander 'Taxim' Nev - Unsound minds feat.
SAM';StreamUrl='http://www.SLAYRadio.org/';
....

At the end it shows a progress indicator, thus the output is streamed.
The problem is I can't get this output in a string. My idea is to
launch mplayer with a timeout of 2 seconds for instance, get the
produced output and find the line that starts with "ICY Info". But
when I kill the process after the timeout, I don't know how to fetch
the output produced so far.

Thanks,

Laszlo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top