I want to write a very basic stream-saver to re-stream the data later. I thought I just save the RAW TCP stream data and send it later.
Now, I just tired to wait for data if I connect to a server streamen music, but I dont recive any data. Is there something I must send to identifiy me or something else?
Well, is it TCP anyway or UDP?
I send a normal http-get request:
newline = 0D 0A
“GET / HTTP/1.0” newline “Host: 22.214.171.124” newline “User-Agent: WinampMPEG/2.9” newline “Accept: /” newline “Icy-MetaData:1” newline “Connect”
Yeah, I know I’m not Winamp 😛
Anyway, I get no response from the server.
I just noticed that I listen at port 8000. (from the streaming URL)
Maybe thats just for connecting and I have to listen on another port?
Could anyone help me?
I set the buffer to low when using my packetsniffer :roll:.
…”Icy-MetaData:1″ newline “Connection: close” newline newline
now it works!
Thanks anyway to everyone
oh, its again me.
I just looked at the data that I get. The first packet is a stream-description. then i get lots of 4824-byte packets (over 250kbps) and just aftera few moment I get the normal streamdata (16kbps, just like the stream I used for testing)
Can anyone tell me whats that > 260000 byte (changes) of data I get at the beginning?
I assume you’re connecting to a SHOUTcast server, in which case the stream data starts right after the http headers. If you’re getting a radio-like stream as opposed to a static file then be careful because the stream data may start halfway through an MPEG frame.
BTW, the next release of FMOD will support SHOUTcast, Icecast and HTTP streaming so pretty soon you won’t have to worry about any of this stuff. 😀
I don’t want to play the music! I’m just working on a very basic stream-recorder. And after recording the data I stream it and connect to my loopback adress with my favorite player.
Thats the idea.
Well, I just send my http request, save the first packet and every following packet. Later I re-send it, works quiet well. I guess the big packets at the beginning are a buffer from shoutcast.
I never really liked shoutcast, oddcast and ogg rulz! 😛
Hmmm, with an Icecast server it doesn’t work :S
If I connect to myself, must I set the same ogg-file for the mountpoint or is the ip:port enought?
Anyway, I tried both, I send the first or first 2 packets of the original stream and then send the data I am receving atm. Still winamp closes the connecting.
Hmm, I dont like this ‘finding the needle in the heap of hay’ – coding…
Thanks, but I don’t really see what this helps me with receiving the streams and ‘simulating’ a stream-server.
Well, now i figured out that ogg-streams has several packets at the beginning of the stream für meta-data and other informations. ATM I’m not at my coding-pc, but I’ll edit this post and post how to save and re-broadcast streams.
Please login first to submit.