mod_mp3 - FAQ for the Apache mod_mp3 streaming module
mod_mp3 - FAQ for the Apache mod_mp3 streaming module
This turns apache into your basic RIAA hating, but every college student loving mp3 streaming server. It can do a number of things. It can play from a list of files, either straight through or randomly. It can be used as a handler if you just have mp3s or ogg files on your server and you want to stream them with the corret headers. It can also be used to cache mp3's into memory and have the server operate entirely from memory. Enjoy, groove, mp3s not included.
You are pretty much free to use it as you please. Check out the License file with the distribution for more details. (Its very BSD like)
Send email to email@example.com
You are better off going to http://media.tangent.org/submit.pl. Just submit a bug. This works best right now.
Read the INSTALL file that comes along with the module.
Listen 8000 <VirtualHost www.example.com:8000> ServerName www.exampe.com MP3Engine On MP3CastName "Brian's Tunes" MP3Genre "Much, nutty" MP3 /export/mp3 MP3 /tmp/madonna.mp3 MP3 /tmp/cows.mp3 MP3Random On #Increase this if your connections are timing out Timeout 1200 ErrorLog /usr/local/apache/logs/music_error_log </VirtualHost>
Make sure you also enable Listen for port 80 if you are also running a regular webserver. Also, keep in mind that while I set mine up with VirtualHosts, you could just as easily use Directory, or Location directives. You could run as many streams out of a single host as you want.
Look at the example, you probably don't have your virtualhost defined correctly.
Whatever I can get my hands on. Right now that means just Icecast and Shoutcast. Shout is full supported and ice is coming along nicely. We can also do the headers for Ogg files.
Yes. The idea is to let other people write the interface for mod_mp3. To enable this a couple of hooks have been added. You can find a list of the contents to a server by doing a http://example.com:8000/?op=rss. If you want, you can this grab songs based on the ID of the song (which is the filename MD5'ed). An examle is: http://avenger.tangent.org:8080/?op=play&song=475c47c405940fde1737e8bc85f65760&song=7777e58678fcc5fcc96d449b4951ebd1
This was just a start, there is a mailing list for the interface, as I get an idea about what people want, more will be added
Several people have written in and said that it will. If I get a binary I will put it up for people to download and use. Which has been happening. Keep in mind though that until someone sends me a copy of OSX (I own a Mac) I won't be actively testing it.
In theory it supports the shout protocol, but in reality it seems to ignore file names found in the stream.
A cute idea. Look through the mail archives for the mailing lists for more info. This is not completly supported yet.
According to people on the mailing list, it will work just fine. Trick is you need a player that can do SSL. You can either do this by tunneling or I am told by using IE with some native player.
You are not going to like the answer to this. Basically at some point you have either installed multiple copies of Apache or somehow munged your current copy. Do this: ``apxs -g -n example; cd example; make''. Did that work? If it didn't your copy of Apache is munged.
Check that you are not accidently loading any files that may not be mp3's. That is the normal culprit. You can make sure you are only loading mp3 files by using the MP3Allow directive (MP3Allow *.mp3).
You have some crazy sized music collection I take it? And you are just point Apache at the directory and waiting for it to start right? Well, it will, but it is going to take a while. I would suggest using a playlist instead. You can generate one with ``find /export/mp3 | grep -i ''\.mp3`` > /tmp/playlist''
You can find out information on RSS at <A HREF=``''>. There is a perl class on CPAN called XML::RSS that will parse RSS. For PHP look at this http://nwow.org/rssparse-0.4.tar.gz
[16/Jul/2001:22:36:19 -0400] fc62362bf4cd1a8602bbf170409b8d04 7652fcbd1077f4ffa58ba36d10c8d9d4
No, not at all. You can put directives in the root of your httpd.conf or even put them in a directory (you could also technically put them in a .htaccess file, but that would be pretty horrible for performance).
A dispatch is an internal handler. It is what gets the data to Apache to send. The default handler is a simple load the data into memory and use it sort of thing. There is also currently a MySQL dispatch, Postgres dispatch, and a playlist dispatch. If you are going to do large scale broadcasting the MySQL dispatch is probably what you want. Also, if you want to reload without restarting Apache, then any dispatch other then the internal dispatch is what you want. If you lack a database, the playlist dispatch is probably the way to grow. It lack token support like the MySQL and Postgres dispatch though.
First, you need to have MySQL installed. Second you need to tell configure to use mysql (./configure --with-mysql). Third you need to create a database to hold the table. There is a sample schema in the support directory. mod_mp3 will load the files for you if you want, it does this with the MP3 directive (also with playlists), or you can choose to load them by hand. As long as you use similair names for the columns you will be ok. You will need to call MP3DispatchAgent and MP3MySQLConnectInfo to feed the right information to Apache so that it can connect to you DB.
First, you need to have Postgres installed. Second you need to tell configure to use mysql (./configure --with-postgres). Third you need to create a database to hold the table. There is a sample schema in the support directory. mod_mp3 will load the files for you if you want, it does this with the MP3 directive (also with playlists), or you can choose to load them by hand. As long as you use similair names for the columns you will be ok. You will need to call MP3DispatchAgent and MP3PostgresConnectInfo to feed the right information to Apache so that it can connect to you DB. You should realize that this is quite alpha at this point and misses many of the features of the MySQL dispatch. Patches to fix this of course are encouraged.
This has to be one of the easiest methods to use mod_mp3. Use the playlist directive to specify a playlist to use and you are in business. Updating it will update the available files (and may cause clients to reconnect at the next song). No token support is currently provided by this dispatch.
This is a symptom of having PHP with MySQL support and ModMP3 with MySQL support built-in. The fix for this is to recompile PHP. The PHP configure script warns you about this. The exact message is:
+--------------------------------------------------------------------+ | *** WARNING *** | | | | You chose to compile PHP with the built-in MySQL support. If you | | are compiling a server module, and intend to use other server | | modules that also use MySQL (e.g, mod_auth_mysql, PHP 3.0, | | mod_perl) you must NOT rely on PHP's built-in MySQL support, and | | instead build it with your local MySQL support files, by adding | | --with-mysql=/path/to/mysql to your configure line. |
If you installed PHP as an RPM, please let us know what you did to fix this problem.
Yep! Just do a AddHandler mp3-file *.mp3 or AddHandler ogg-handler *.ogg to your httpd.conf and you are good to go.
Tokens are like cookies that are specified in the URL. For example:
The above would play any file that is associated with the ``rock'' token. For more information on this you should send email to the developers list.
You probably have called MP3 or MP3Playlist before you specified the MySQL information. Don't do that, it will not work :) See the sample MySQL file in the support directory.
Since you have bandwidth issues, it is time to turn on compression. Actually, it is time to use LAME to compress your mp3 files even more than they are now, before transit across your broadband network.
Look at it this way: You have 100 kilo bits per second of upload capability. You have to consider the protocol overhead or minus 10% or 15%. You have a 128 Kbit quality MP3 you want to stream. The calculation looks something like this:
((100,000 - 10%) / 128000) = 0.703125
This means you get 0.7 of your connection dedicated for music (aka 70% music, 30% pops & static).
To fix this you have to lower the bitrate of your mp3 stream, and try the calculation above again until you get a whole number. This means you need to use the mod_mp3 MP3Encoder directive to lower your mp3 bitrate while they are on their way out the door:
MP3Encoder ``/usr/local/bin/lame -q 2 -b 48 --silent % -''
This solution imposes a penalty on your system resources as long as your streaming music with LAME. This is not something you want to use on a multi-user setup like Ampache, or Mummi. As long as your doing this for your own personal, and don't have to share the system, it shouldn't be a problem. =)
There is no reason why this should not compile under windows. Currently no one has ever provided the instructions on how to do this though. In fact any system that can compile Apache and has SYSV shared memory should be able to compile this software.
Vidyut Luther has made a directory server which works with Icecast servers and mod_mp3. You can find out more information on it here : <A HREF=``http://yp.modmp3.net/''>yp.modmp3.net</A>
World domination? Complete online server that would make any radio station drool. Support for more than just mp3. You name it, I am open to ideas. The big thing for me is that I want to give people a voice. Just like apache opened up the web for anyone to publish thoughts and ideas that they have, I want this module to extend that same philosphy to the online airwaves. The FCC is never going to make community radio a reality, hopefully this will give people an alternative. Ok, now that that soap box bit is over, the idea is to create a server which can be controlled by other applications. Let people write good interfaces and not worry about the actual protocols and methods of delivery.
Listen 8001 <VirtualHost avenger.tangent.org:8001> ServerName avenger.tangent.org MP3Engine On MP3CastName "Brian's Tunes" MP3Genre "Much, nutty" MP3 /export/ogg MP3MimeType audio/x-ogg ErrorLog /usr/local/apache/logs/music_error_log Timeout 1200 </VirtualHost>
# The mod_mp3 virtual host. # Do not just make-up any name here for the ServerName directive. # Use real, valid, host names from the DNS. # Increase the timeout if you have large length mpeg files. # Timeout of zero means no timeout. <VirtualHost 123.456.789.101> ServerName music.example.com ServerAdmin firstname.lastname@example.org ErrorLog /var/log/httpd-error.log SetEnvIfNoCase User-Agent mozilla is_a_browser
# Toggle the MP3 module On/Off. MP3Engine On
# Control the number of connections to mod_mp3. # Upload speed divided by bitrate is the rule of thumb. # example with DSL 768/768 line, and mp3 w/128 bitrate: # floor((768000 - 10%) / 128000) = 5 # Remember that about 5% to 15% of your bandwidth is consumed by overhead. # and since 90% of a stream is not so good, we round-down, and get five. # Your mileage may vary. MP3LimitPlayConnections 2
# Name this radio station. MP3CastName "mod_mp3 radio"
# Give your Station a format type (aka Classical, Electronic, rock'n'roll, etc.). MP3Genre "various"
# Multiple MP3 directives are allowed. # Rule of thumb dictates you not use the MP3 direcctive when using a MP3Playlist. MP3 "/data/mp3z"
# This can increase the performance on large collections, but not dramatically. # It is a good idea to avoid using this with the MP3 directive, # unless you know what your doing. #MP3Playlist /data/playlist.m3u
# Toggle the stream mode On/Off # This doens't work at the moment. # When enabled, you should comment-out any MP3, or MP3Playlist directives. #MP3Stream On
# Randomize (aka shuffle) the mod_mp3 internal playlist for playback. #MP3Random On
<VirtualHost 184.108.40.206> ServerName mp3s.yourdomain.com ServerAdmin email@example.com CustomLog /www/modmp3/logs/access_log combined
#Turn the ModMp3 engine ON. MP3Engine On #The name of your broadcast. MP3CastName "Linuxpowered Radio" #What dispatch agent you want to use MP3DispatchAgent mysql #If the Agent is Mysql, specify the hostname,username,password #for the database to connect to. MP3MySQLConnectInfo "localhost" "USERNAME" "PASSWORD" #Now specify the database and tablename where the songs are stored. MP3MySQLInfo "DATABASENAME" "TABLENAME" # Specify the table for tokens MP3MySQLTokenTable "tokens" #Specify where the MP3's are. This must come after the MySQL directives MP3 "/www/modmp3/songs" MP3Genre "various" MP3Random On MP3Log /www/modmp3/logs/mp3_log MP3Allow *.mp3 </VirtualHost>