Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to filter metadata

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Listener Clients
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Thu Dec 01, 2005 7:56 pm    Post subject: how to filter metadata Reply with quote

hello,

i have a one-line player

echo "GET / HTTP/1.0\n\n" | netcat localhost 8888 | sox -t mp3 - -t ossdsp /dev/dsp

which works very fine, but how i can filter (grep) metadata off the stream?

please think simple, thanks.

sorry for my bad english.

greetings from germany,

terx
Back to top
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Thu Dec 01, 2005 8:33 pm    Post subject: Reply with quote

With that you won't get an MP3 metadata as you haven't requested any, what you can do with 2.3.x is use a stats client, a simple example is

curl -X STATS http://admin:hackme@host:8000/

Just filter for the stats relating to the mountpoint. You'll be able to use netcat in a similar way if need be.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Guest






PostPosted: Thu Dec 01, 2005 9:00 pm    Post subject: Reply with quote

> With that you won't get an MP3 metadata as you haven't requested any

how can i request this? is there any documentation, rfc, or something else?

terx
Back to top
Guest






PostPosted: Thu Dec 01, 2005 9:34 pm    Post subject: Reply with quote

here, i wrote a small perl script (getmeta.pl):

#!/usr/bin/perl -w
$|=1;
while (<STDIN>) {
print;
if ($_ =~ /StreamTitle='([^\']+)';/) {
print STDERR ((scalar localtime time) . " $1\n");
}
}

that filter the metadata off the stream and write them to stderr (with a time stamp). stdin is directly forwarded to stdout.

the new command:

echo "GET / HTTP/1.0\nIcy-MetaData:1\n\n" | netcat localhost 8000 | ./getmeta.pl | sox -t mp3 - -t ossdsp /dev/dsp

or with ripping

echo "GET / HTTP/1.0\nIcy-MetaData:1\n\n" | netcat localhost 8000 | ./getmeta.pl | sox -t mp3 - -t ogg - | tee streamrip.ogg | sox -t ogg - -t ossdsp /dev/dsp

and without filtering metadata

echo "GET / HTTP/1.0\n\n" | netcat localhost 8000 | sox -t mp3 - -t ogg - | tee streamrip.ogg | sox -t ogg - -t ossdsp /dev/dsp

and all of them works fine! (please ignore any error messages from sox.)
Back to top
Guest






PostPosted: Thu Dec 01, 2005 9:36 pm    Post subject: Reply with quote

all (c) by terx, tux@nemero.com and the perl script is free and open (gpl)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Listener Clients All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber