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 

Official Icecast`s protocol

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> F.A.Q.
View previous topic :: View next topic  
Author Message
Anonymous
Guest





PostPosted: Sun Dec 10, 2006 3:28 pm    Post subject: Official Icecast`s protocol Reply with quote

Hi,
I try to write application on the ARM microcontroler which has to receive mp3 streams (from Icecast server), decode (I have already implemented mp3 decoder) and of course play them:). To be able to do it I need to get official Icecast`s specification/description.
I only know that Icecast`s client-server communication is done by the HTTP protocol. But unfortunately I do not know what exactly data (apart from audio, of course;)), headers etc. are sent.
Could you explain me how making connection and exchanging data between client and server (in both ways) are done? How do Icecast`s frames and headers look (and how big there are), as well as what data follows? I have to include all of above information in my MSc thesis, so I will be gratefull for your help. Does something like official "Icecast stream protocol" exist? If yes, how can I get it?

Regards and thanks for Your cooperation,
Greg
Back to top
MikeS
Code Warrior
Code Warrior


Joined: 29 Jun 2005
Posts: 73
Location: Barcelona, Spain

PostPosted: Sun Dec 10, 2006 10:15 pm    Post subject: Reply with quote

For a listening client, icecast uses pure HTTP.

So, you don't need an icecast-specific protocol document. You just need to implement HTTP, then feed the body of the response to your mp3 decoder.

Mike
Back to top
View user's profile Send private message Send e-mail
Anonymous
Guest





PostPosted: Fri Dec 29, 2006 7:16 am    Post subject: Reply with quote

hmm.. i also would like to know if able what exactly happens between the client and the server during a streaming session.

is it that when a client(i.e. xmms) requests for a stream, the server will response by sending the information about the song played and all the playlists to the client and then the client will have to go and search for the song in the server directory?

or is it that when the server is playing a song and a client connected to it, the client will just receive the stream? what i mean is basically how does the server reacts when a client is requesting a streaming session with it?

if i am not wrong, the client will send a ClientPktHeader to the server requesting for the session and what is the server's response to this requests? what does it send back to the client?

and how did the client manages to get the song played at the server? because if i am not mistaken, the client will only get the url of the server. So, can somebody tell me how exactly is the stream is sent to the client.

TIA and sorry for asking a lot of questions which might seems confusing and silly sometimes.

the reason that i need to know is i am working on a project that requires me to know how these things happen.
Back to top
MikeS
Code Warrior
Code Warrior


Joined: 29 Jun 2005
Posts: 73
Location: Barcelona, Spain

PostPosted: Wed Jan 03, 2007 10:13 am    Post subject: Reply with quote

It's really very simple:

The client sends an HTTP request for the stream.

The server responds, over the same socket, with the actual stream data.

That's all! There's nothing else at all.

Mike
Back to top
View user's profile Send private message Send e-mail
Anonymous
Guest





PostPosted: Thu Jan 04, 2007 12:58 am    Post subject: Reply with quote

Owh... Ok... thanks about the reply and the info...

Could anybody please help to verify this:

When a streaming session is ongoing, the client actually is getting the streamed audio from the server, right?

So, it means that the client will only received the streamed audio. There is nothing like the client need to find the audio in the server after getting the http file?

And, during the streaming session, is it true that the client will actually downloaded a small part of the stream to be decoded first to get the real audio or the client is just processing the decoding at the server, i mean the client did not have to download anything and everything is done at the server?

TiA....
Back to top
Anonymous
Guest





PostPosted: Mon Mar 26, 2007 9:28 am    Post subject: Reply with quote

Hi, guys

I have a similar question... I'm trying to set up a relay script in PHP, something like a HTTP proxy. I thought it wouldn't be so hard, but it doesn't seem to work Sad

Here's the actual code:

Code:

<?php

$s = fopen('http://zrock.atlantis.bg:8000/zrock.ogg', 'rb');

foreach ($http_response_header as $h) header($h);

$time = time();

while ((time()-$time) < 30) {
   echo fread($s, 1024);
}

fclose($s);

?>


In case you're not familiar with PHP, here's what's happening:
I'm opening a stream to the Icecast server, which automatically fills the $http_response_header variable with all the responce headers. Then I send those headers to the client, exactly as I received them. After that, I start reading from the stream and sending the data in 1024B pieces to the client. Since I'm still testing, this is done for 30 seconds, and then the script finishes.

Unfortunately, this didn't work Sad
My Winamp starts to receive the data, but after a while it says "[ERROR SYNCING TO STREAM]" and just stops without playing anything.

Any suggestions would be appreciated! Confused
Back to top
MikeS
Code Warrior
Code Warrior


Joined: 29 Jun 2005
Posts: 73
Location: Barcelona, Spain

PostPosted: Mon Mar 26, 2007 1:56 pm    Post subject: Reply with quote

Probably a winamp bug.

If your php script has a ".php" extension, winamp won't use the right plugin, and it'll attempt to decode your ogg vorbis stream as mp3 - which obviously doesn't work.

winamp only works correctly if the URL ends with ".ogg", unfortunately.

Mike
Back to top
View user's profile Send private message Send e-mail
Anonymous
Guest





PostPosted: Tue Mar 27, 2007 7:08 am    Post subject: Reply with quote

Yep, you appear to be absolutely right... Smile I managed to get it working using mod_rewrite. Thought the content-type headers would be enough...

Thanks, Mike Wink
Back to top
Anonymous
Guest





PostPosted: Tue Jun 05, 2007 6:42 am    Post subject: Reply with quote

ok this is how you make Icecast work really well. Note this here, since oddcast is pretty good at doing all of your source client stuff, you do not need any pluggins or files in Icecast to anything such as Winamp.

Since Oddcast uses the audio from the sound cards wave output any media
device can hence be used with Icecast via Oddcast. So get all of them useless files and applications out of Icecast and then it will be great.
Make sure it works well on the Win 98 platform and you will have it working excellently on XP and Vista.

Is this too hard to understand?

Make sure that Icecast is getting its stream out on the Intenet one thing because I can tell you that if I can not get a stream out in 2.3.1 then its useless to have.

Streamline it by puling out all of the junk and stick with the basic stuff that makes it work and makes i work smoothly.

Dan
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> F.A.Q. 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