Dave St John
2004-Aug-06 14:57 UTC
[icecast-dev] icecast2 ogg vorbis client request headers
> You must have some other, unrelated, problem, presumably elsewhere in your > code.this is what i have, and does work with mp3, but ogg does not want to work. im testing with winamp, you think that may be the issue? <p><p>fwrite($fp,"GET /mymp3 HTTP/1.1\nUser-Agent:$HTTP_USER_AGENT\n\n"); for ($i=0; $i<120; $i++) { if (feof($sp)) break; $str.=fread($sp,4096); usleep(200000); if (strpos($str,"\r\n\r\n")) break; } flush(); echo substr($str,strpos($str,"\r\n\r\n")+4); flush(); while(!$shutdown_flag) { $buf=fread($sp,4096); if (feof($sp)) $shutdown_flag=1; echo $buf; flush(); usleep(75000); } <p>Dave St John Mediacast1 Administration Need Support ? http://mediacast1.com/helpdesk ----- Original Message ----- From: "Michael Smith" <msmith@xiph.org> To: <icecast-dev@xiph.org> Sent: Thursday, April 01, 2004 5:47 PM Subject: Re: [icecast-dev] icecast2 ogg vorbis client request headers <p>> On Friday 02 April 2004 09:28, Dave St John wrote:> > Can anyone shed some light as to what icecast2 accepts as a clientrequest> > methods for ogg vorbis, apparently there is a difference bettween theway> > icecast2 handles mp3 and ogg vorbis. > > > > php example for mp3 that works > > fwrite($fp,"GET /mymp3 HTTP/1.1\nUser-Agent:$HTTP_USER_AGENT\n\n"); > > > > php example for ogg that doesnt work > > fwrite($fp,"GET /mymnt.ogg HTTP/1.1\nUser-Agent:$HTTP_USER_AGENT\n\n"); > > > > These should both work. To be strictly correct, you must use \r\neverywhere> you have \n, but icecast isn't picky about that. You also must send some > required HTTP/1.1 headers, or send in HTTP/1.0 instead. Again, icecastisn't> picky. You should have a space between "User-Agent:" and the actual value. > I'm not sure whether icecast is picky about that, but the behaviour wouldbe> server-wide, not format-specific. > > You must have some other, unrelated, problem, presumably elsewhere in your > code. > > Mike > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > icecast project homepage: http://www.icecast.org/ > To unsubscribe from this list, send a message to'icecast-dev-request@xiph.org'> containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered. ><p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Michael Smith
2004-Aug-06 14:57 UTC
[icecast-dev] icecast2 ogg vorbis client request headers
On Friday 02 April 2004 11:04, Dave St John wrote:> > You must have some other, unrelated, problem, presumably elsewhere in > > your code. > > this is what i have, and does work with mp3, but ogg does not want to work. > im testing with winamp, you think that may be the issue? >I have no idea what your code is actually trying to do. I suspect that using an actual HTTP implementation would be helpful, regardless. I suspect your code is buggy (but I don't know PHP, so I can't tell for sure). Testing with winamp isn't a particularly good idea (because when things DO go wrong, it's pretty hard to tell why), but is unlikely to be the actual cause of your problem(s). Mike --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Dave St John
2004-Aug-06 14:57 UTC
[icecast-dev] icecast2 ogg vorbis client request headers
Well the code itself is what i took from tom peppers sc proxy script and incorperated our own auth system for icecast2 i know i got it close with ogg and it seems to be when i tweak the $str.=fread($sp,4096); bit amount, i get different results, 4096 works fine for mp3 on icecast2 and shoutcast, but im assuimg maybe there is more or less to read from the ogg headers?? if so what would be the correct amount? Dave St John Mediacast1 Administration Need Support ? http://mediacast1.com/helpdesk ----- Original Message ----- From: "Michael Smith" <msmith@xiph.org> To: <icecast-dev@xiph.org> Sent: Thursday, April 01, 2004 7:12 PM Subject: Re: [icecast-dev] icecast2 ogg vorbis client request headers <p>> On Friday 02 April 2004 11:04, Dave St John wrote:> > > You must have some other, unrelated, problem, presumably elsewhere in > > > your code. > > > > this is what i have, and does work with mp3, but ogg does not want towork.> > im testing with winamp, you think that may be the issue? > > > > > > > > fwrite($fp,"GET /mymp3 HTTP/1.1\nUser-Agent:$HTTP_USER_AGENT\n\n"); > > for ($i=0; $i<120; $i++) { > > if (feof($sp)) break; > > $str.=fread($sp,4096); > > usleep(200000); > > if (strpos($str,"\r\n\r\n")) break; > > } > > > > flush(); > > echo substr($str,strpos($str,"\r\n\r\n")+4); > > flush(); > > I'm guessing here... so this could be completely wrong - but is this callto> 'echo' just above intended to send the HTTP headers? What about the restof> the data (i.e. the actual http body) that was read in your last fread()call?> Dropping this will just cause some normal data packets to be dropped inthe> mp3 case, but with ogg it'll drop the (critically important) headerpackets.> > So it's clearly wrong in both cases, but the consequences are worse forogg.> > Mike > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > icecast project homepage: http://www.icecast.org/ > To unsubscribe from this list, send a message to'icecast-dev-request@xiph.org'> containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered. ><p>--- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Michael Smith
2004-Aug-06 14:57 UTC
[icecast-dev] icecast2 ogg vorbis client request headers
On Friday 02 April 2004 11:04, Dave St John wrote:> > You must have some other, unrelated, problem, presumably elsewhere in > > your code. > > this is what i have, and does work with mp3, but ogg does not want to work. > im testing with winamp, you think that may be the issue? > > > > fwrite($fp,"GET /mymp3 HTTP/1.1\nUser-Agent:$HTTP_USER_AGENT\n\n"); > for ($i=0; $i<120; $i++) { > if (feof($sp)) break; > $str.=fread($sp,4096); > usleep(200000); > if (strpos($str,"\r\n\r\n")) break; > } > > flush(); > echo substr($str,strpos($str,"\r\n\r\n")+4); > flush();I'm guessing here... so this could be completely wrong - but is this call to 'echo' just above intended to send the HTTP headers? What about the rest of the data (i.e. the actual http body) that was read in your last fread() call? Dropping this will just cause some normal data packets to be dropped in the mp3 case, but with ogg it'll drop the (critically important) header packets. So it's clearly wrong in both cases, but the consequences are worse for ogg. Mike --- >8 ---- List archives: http://www.xiph.org/archives/ icecast project homepage: http://www.icecast.org/ To unsubscribe from this list, send a message to 'icecast-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.