View previous topic :: View next topic |
Author |
Message |
mohadib
Joined: 18 Mar 2010 Posts: 8
|
Posted: Fri Mar 19, 2010 8:56 pm Post subject: writing a source client |
|
|
I was wondering if writing a source client, without libshout, is as simple as creating a http request , and then sending the mp3/ogg data? I'm on windows and cant get the libshout-java bindings to work.
Thanks,
jason |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Mar 19, 2010 9:14 pm Post subject: |
|
|
Basically it is. The method is not standard http for a source client, it's just SOURCE /stream .. authorization header and anything else followed by the stream. The main thing libshout does is provide a wrapper between shout/icecast connections, metadata updates and it can throttle the stream being sent so that it's sent in real time. Nothing is stopping you from doing that yourself and the protocol is not that difficult.
karl. |
|
Back to top |
|
|
mohadib
Joined: 18 Mar 2010 Posts: 8
|
Posted: Sat Mar 20, 2010 11:15 pm Post subject: |
|
|
thanks, do you know of any documentation on the protocol?Also, will I need to throttle the stream? If I dont, will icecast reject any data, or play the song out of time?
Thanks Again,
Jason |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Mar 21, 2010 4:03 am Post subject: |
|
|
Think http style, but icecast only really needs is the SOURCE request and the content-type, other header can be passed though. Icecast will not throttle the connection for you, after all you may be sending data it does not know how to parse.
karl. |
|
Back to top |
|
|
mohadib
Joined: 18 Mar 2010 Posts: 8
|
Posted: Sun Mar 21, 2010 4:50 am Post subject: |
|
|
ok thanks, i got my app working mostly now. Im curious, If i have a variable bit rate mp3, how will i know how much data to send for a given span of time? Thank You! |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Mar 21, 2010 4:56 am Post subject: |
|
|
generally you find out what the samplerate is and then based on the samples seen so far, match against the current clock time. Obviously that will be codec dependent.
karl. |
|
Back to top |
|
|
mohadib
Joined: 18 Mar 2010 Posts: 8
|
Posted: Mon Mar 22, 2010 3:52 am Post subject: |
|
|
Ok, thank you. So I got the stream timing down pretty good now. Im curious about the number i see in the log:
[2010-03-21 21:49:47] DBUG stats/modify_node_event update node total_bytes_read (1165374000)
[2010-03-21 21:49:47] DBUG stats/modify_node_event update node total_bytes_sent (1165392499)
It seems more data has been read from the server than my stream client has sent. Can you shed any light on those numbers and what to make of them?
Thanks,
Jason |
|
Back to top |
|
|
karlH Code Warrior
Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Mar 22, 2010 4:53 am Post subject: |
|
|
That is probably because your listener has asked for metadata updates to be inserted. Or maybe you have requested the status page a number of times.
karl. |
|
Back to top |
|
|
|