Page 1 of 1

Http streaming to file

Posted: Fri Jun 18, 2010 10:42 am
by jtreg
Has anyone figured out how to save a http stream to file (mp3 or ogg) _ I really want to do this on the server side... I already can save http streams using my recording software but I want to do this without having to use my (client) machine.

Re: Http streaming to file

Posted: Fri Jun 18, 2010 2:10 pm
by requinix
copy should work fine as long as the stream ends (as opposed to something like streamed radio).

Re: Http streaming to file

Posted: Fri Jun 18, 2010 4:49 pm
by jtreg
yes, it was streaming radio I was thinking of...

Re: Http streaming to file

Posted: Fri Jun 18, 2010 5:03 pm
by requinix
Then try fopen+fread (which lets you limit how much data to read)+fclose.

Re: Http streaming to file

Posted: Sat Jun 19, 2010 5:22 am
by jtreg
If I know how long to record for then I can use an fclose I suppose at the desired time. I suppose I have a while loop counting down then do the fclose, is there a better way?