Traduisez - Übersetzen - Traduzca - Traduza - Tradurre - Translate

VanLUG Email Archive

Re: Streaming mp3s from stdin and stdout via a cgi..

Ben Holt
Tue, 06 Oct 1998 11:10:50 -0700

>> I'm wondering, if I can get a mp3 encoder to encode something, the output
>> being stdout over a CGI, would the mpg123 http support decode that stream?
>>
>> I'm thinking of like 22khz mono audio.
>>
>> Let me know if you know of any docs that could help. Thanks
>
>I don't know if you can stream mp3's. You can definitely create
>a multi-part HTML document on the fly with the mp3 file in the document,
>but the client will have to save the whole file to disk before playing.
>
>I believe you need to use real audio encoding or something
>similar to actually stream. Corrections welcome; I would be
>interested in learning how to stream mp3's if possible, or
>how to convert them to RA files, for a project of my own.
>

Xing (http://www.xingtech.com) makes a server that is able to stream MP3z
over the net. I have no experience with this product, but have been able
to stream MP3z on our LAN without a special server. Stereo 16bit 44.1MHz
MP3z (128kb/second) stream very nicely with almost no change in quality
from the original uncompressed file. For whatever reason video
600kb/second MP3z don't stream as well and end up dropping frames. I
usually d/l these to the local machine before watching them.

If you are going to use RealAudio you can get the encoder for free from
their site (http://www.realaudio.com) and stream it via http from a regular
web server (as long as the MIME types have been set up properly), but this
isn't as good as having access to a proper RealAudio server as the incoming
stream won't cache properly on the end user's machine and will likely cause
breaks in the audio. RealAudio doesn't suggest using an http stream for
clips longer than 30 seconds or so. Of course they also have a vested
interest in you not using an http stream as they make their money selling
their servers which are *not* cheap if you are looking to stream anything
above the 5 streams you can do with the free version of the server.
Personally I'd try an http stream first and see how it works at the bit
rate of your intended audience.

As far as creating the pages on the fly with CGI this shouldn't cause any
problems.

<ShamelessPlug>
If you are interested, I have access to a realaudio server which I can
sell you space on.
</ShamelessPlug>

- Ben