Streaming MP3s at lower bitrate - problems.

Ask Questions or make comments about Mp3 Toolbox
Post Reply
rumcho
Posts: 2
Joined: Sun Sep 22, 2002 12:12 am

Streaming MP3s at lower bitrate - problems.

Post by rumcho »

Hello, everyone!
I put the MP3 Toolbox PHP code on my Apache server and everything worked perfectly. I changed the $stream_bitrate variable to 56 to feed lower bitrate than the MP3 actually has (physical filebitrate is usually 128kbps, but I have MP3s that vary). Basically I want to be able to feed on demand audio at 50 to 64 kbps range. However, I have a problem - I cannot make the server feed MP3s at a different bitrate than the MP3s' physical bitrate. I changed the $stream_bitrate variable to 56, I also tried 32 and 64 but it was still doing it its own way.
My major reason for lowering the bitrate is of course my bandwidth. I would like to be able to play all my MP3s from work but the Mp3s high bitrate is too high so I need to "lower-feed" them.
Can you guys give me an advice? Any help would be great!
Thanks,
Roumen.

P.S. Jay and Tom: guys I've been building PHP apps for 1 year now but when I saw your scripts I was knocked out. The scripts are a real kick-ass and it will take me a while to understand all the stuff that they do. Thanks, though. They work great.

User avatar
Jay
Will work for food (Administrator)
Posts: 2942
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

well thanks for the praise, Mp3 Toolbox is quite a large project, and it's complexity grows each day, beta 5 introduces the ability to make the server private, which is great for situations like yours.


Anyhow it sounds like you misunderstood the purpose of $stream_bitrate. It really just serves as a filter for the Radio Stream part of Mp3 Toolbox. So that if you only want to stream at a certain bitrate like 56kbps only files already encoded at 56kbps will be broadcast across the radio style portion of Mp3 Toolbox. It will not limit what it displays in the index or what it makes available to listen. However this sounds like a possible useful feature for a future version of the script. Mp3 Toolbox will not re-encode the mp3 at a lower bitrate for broadcast. While this is a possibility there are problems doing this. One is that it is CPU intensive to decode and then re-encode an mp3 no matter what language you do it in. And have tons of people listening to your re-encoded stream will certainly bring a system to it's knees. However just for fun I am looking into seeing about decoding mp3's in PHP because it would be interesting to see if it is possible, and to add it to the capabilities of sourcing shoutcast servers and such.

If you want you could batch re-encode your mp3's to a lower bitrate and point mp3 toolbox at those mp3's instead of your original mp3's.
- Jay

rumcho
Posts: 2
Joined: Sun Sep 22, 2002 12:12 am

Post by rumcho »

Jay,
I think I will look into MP3 bitrate conversion with PHP. It should be pretty easy to find something about it. In the worst case I'll just find one of those command-line bitrate converters and shove it in PHP code. I'm sure it'll get slick. If I find something interesting and implement it successfully, I'll definitely let you know guys.
I can't believe there's no media server for unix out there that doesn't do that. Are you sure?
Of course, there's a special charm to doing all that with PHP code and I understand your point about the system overhead that can run the system down. But... I have 10 Gigs of MP3s - what's gonna happen to my HDD space if I encode all that to lower bitrate, which I might decide to change in the future, and also, how much time will it take to convert - forever, baby! I really don't think the system will be overloaded if 4-5 people request Mp3's simultaneously (my Cable modem bandwidth won't allow more users :=( anyway). Also, I run Linux (RedHat) and Linux kicks ass in reliability.
Thanks for your answer anyway.
We'll keep in touch.
Take care
Roumen.

User avatar
Jay
Will work for food (Administrator)
Posts: 2942
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

well I certainly am not saying it's impossible, the guys at www.djiab.org did it with Perl and some moduales and LAME. I am just trying to figure out an elegant way to add it to mp3 toolbox without external needs.

But certainly if you come across anything I will be real interested in knowing about it. ;)
- Jay

Post Reply