## [PHP/MP3 streaming] APACHE/PHP4 base very simple mp3 streaming server ## ## [author] ## - Chilbong Kim < san2(at)linuxchannel.net > ## - http://linuxchannel.net/ ## ## ## [What is PHP/MP3 streaming?] ## - ¾ÆÆÄÄ¡/PHP4 ±â¹Ý °£´ÜÇÑ MP3/Ogg ½ºÆ®¸®¹Ö ¼­¹ö ## - ±â´É : ## 1) HTTP ÇÁ·ÎÅäÄÝÀ» Áö¿øÇÏ´Â mp3 player·Î ½Ç½Ã°£ À½¾Ç Àü¼Û ## 2) ÇÑ±Û ÆÄÀÏ, ¶ç¾î¾²±â ÆÄÀÏ À̸§ Áö¿ø ## 3) MP3/Ogg ÆÄÀÏ Áö¿ø ## 4) CD cover À̹ÌÁö view ## 5) Text ÆÄÀÏ view ## 6) »ç¿ëÀÚ Ãß°¡°î ¹× °ü¸®(°ñ¶ó¼­ µè±â) ## 7) À¥ ÀÎÅÍÆäÀ̽º »ç¿ëÀÚ ¼³Á¤(ÅÛÇ÷¿ ¹æ½Ä) ## 8) ½Ç½Ã°£ bitrate Á¶Àý(mp3 mono 64Kbps ¸¸ Áö¿ø) ¹× ## Àü¼Û(lame ¼³Ä¡ ¿ä±¸µÊ) ## 9) download Áö¿ø ## 10) ±âŸ ## ## * ±ÇÀå ¿ëµµ : »ç³» ÀÎÆ®¶ó³Ý, À½¹Ý ÀúÀÛ±ÇÀÌ ÀÚÀ¯·Î¿î ȨÆäÀÌÁö ## * Á¦ÀÛ ¹è°æ : ¾È°¥ÃÄÁà¿À~~~ (¸¹À»°É ¿ä±¸ÇϽô ±¸·Á..^.9) ## * ¿©ÀÚÄ£±¸ ¸¸µé¾î ÁÖ¼¼¿ä...T.T(ÀÌ·²¶§ PR ÇØ¾ßÁãÀÌ...ũũ) ## ## ## [changes] ## ## - 2003.10.26(Ver 1.1.3p5) ## fixed, open a window ## ## - 2003.08.12(Ver 1.1.3p4) ## added, header_filecache() ## fixed, view a image window ## ## - 2003.07.18(Ver 1.1.3p3) ## fixed, memory_limit by fopen(), set to 50M, it's maximum file size ## ## - 2003.07.13(Ver 1.1.3p2) ## patched, playlist fine name(title) ## patched, open window size(view orignal image) ## array speed tunning ## ## - 2003.06.26(Ver 1.1.3p1) ## patched, download file name ## ## - 2003.06.20(Ver 1.1.3) ## seperate(play.php, stream.php) ## add user interface option(WMP playing) ## patched, playlist to EXTM3U ## support download ## add Icy-xxx header(a stream can't write to disk directly) ## ## - 2003.06.18(Ver 1.1.2p1) ## renew array2str(), str2array() ## patch maxinum number of myplaylist(maxinum about 50 lists) ## add url link(at contents of view text) ## ## - 2003.06.10(Ver 1.1.2) ## some seek playing(if use not lame) ## ## - 2003.06.09(Ver 1.1.1p1) ## patched, parse() function in class.tmpl.php ## ## - 2003.06.09(Ver 1.1.1) ## patched, play time(if use the lame) in play.php ## ## - 2003.05.28(Ver 1.1.0p1) ## patched, array2str(), str2array() ## add a file 'play.smi'(it's empty file) ## renamed 'OGG(Oh-Gee-Gee)' -> 'Ogg' ## (It's Ogg, not OGG!) ## (see http://www.vorbis.com/ot/20030318.html) ## ('OGG' : Oh-Gee-Gee, is not right) ## ('Ogg' : it's pronounced like Dog without the letter D) ## ## - 2003.05.27(Ver 1.1.0) ## add Ogg vorbis file informations(renew class.ogg.php) ## (source : http://getid3.sourceforge.net/) ## ## - 2003.05.23(Ver 1.0.4p1) ## add count_of_cookie() function ## ## - 2003.05.23(Ver 1.0.4) ## fixed cookie limit, maxinum 20 cookies per domain base ## (see : http://wp.netscape.com/newsref/std/cookie_spec.html) ## ## - 2003.05.22(Ver 1.0.3p1) ## fixed get_cookie_userlist() function ## ## - 2003.05.22(Ver 1.0.3) ## patched, setcookie(_userconf, _userlist) ## patched, user_agent() function ## support some Window-Media-Player/7.1 over(it's poor) ## ## - 2003.05.21(Ver 1.0.2) ## add theme(default,blue,black) ## add templates(dragonball) ## ## - 2003.05.20(Ver 1.0.0) ## add user configuration interface ## ## - 2003.05.19(Ver 0.9.9) ## add my playlist ## add user configuration ## ## - 2003.05.10(Ver 0.9.5) ## add/delete user user playlists ## ## - 2003.05.01(Ver 0.9.0) ## add user interface ## add base play lists, ## add mp3, Ogg infomation ## ## - 2003.04.29(Ver 0.6.7) ## patched, '+' string for user agent guly parsing ## ## - 2003.01.05(Ver 0.6.6) ## small bug fixed ## ## - 2002.08.20(Ver 0.6.5) ## support Ogg vorbis file ## support RMA(ReadMedia-Player) ## support Zinf(FreeAmp) ## support XMPlay(win) ## ## - 2002.05.15(Ver 0.5) ## support access logging ## security ## support direct access(such as xmms, winamp ...), then random playing ## ## - 2002.05.14(Ver 0.3) ## support PHP/4.0.x ## ## - 2002.05.13(Ver 0.2) ## ## ## [download & online source view] ## - http://ftp.linuxchannel.net/devel/php_stream/ ## ## ## [demo view] ## - http://linuxchannel.net/mp3stream/ ## ## ## [requirements] ## 0. GNU/Linux OS ## 1. apache 1.3.x (or 2.0.x) ## 2. PHP/4.x.x ## 3. some mp3 or Ogg files ## 4. mp3 player(such as winamp, xmms, ...) ## 5. There is no need to use together. ## (such as icecast, apache-mp3, mod_mp3 streaming server) ## ## ## [install lame] <-- this options ## 0. download : http://lame.sourceforge.net/ ## (http://lame.sourceforge.net/download/download.html) ## 1. tar zxvf lame-xxx.tar.gz ## 2. cd lame-xxx ## 3. ./configure (default PREFIX=/usr/local) ## 4. make ## 5. make install (install to '/usr/local/bin/lame') ## ## ## [references] ## 0. if mime type isn't registered by IANA(->ICANN), ## adding a "x-" before the subtype ## 1. /usr/local/apache/conf/mime.types.default ## 2. http://sander.vanzoest.com/talks/apachecon/2001/notes/notes_apachecon.txt ## 3. http://www.mp3dev.org/ support mp3 bitrate(use lame) ## 4. RFC 1806, The Content-Disposition Header ## 5. RFC 3003, The audio/mpeg Media Type ## 6. Ogg vorbis : http://www.xiph.org/ and http://www.vorbis.com/faq.psp ## 7. cookie limit : http://wp.netscape.com/newsref/std/cookie_spec.html ## 8. http://www.xiph.org/ogg/vorbis/doc/framing.html ## 9. http://getid3.sourceforge.net/ ## 10. http://msdn.microsoft.com/library/default.asp ## ## ## [test and more support] ## 1. Linux/2.4 (redhat 7.x) ## 2. Apache/1.3.x ## 3. PHP/4.3.x, 4.2.x PHP/4.1.x, PHP/4.0.x ## 4. useragent : ## - MSIE5/6 ## - netscape/4,6,7 (linux,win) ## - mozilla/0.9.x/1.x.x(linux) ## - xmms/1.x.x(linux) : ok ## - winamp(win) : ok ## - winmap3(win) : ok ## - Zinf(FreeAMP) : ok ## - XMPlay(win) : ok ## - RMA, RealMedia-Player(win) : ok ## - Window-Media-Player(win) : some (7.1 over) ## - NSPlayer(win) : fail ## 5. test only *.mp3(korean file name success) ## 6. support lame(only *.mp3 bitrate) ## 7. support access log write(options) ## 8. support direct access(such as xmms, winamp ...) ## 9. support Ogg vorbis file ## 10. support view images(CD covers.jpg ...) ## 11. support view text file ## ## ## [Known bug] ## 1. number of cookies limit(set to maxinum 50 playlist) ## 2. directly access(fail access to Ogg file) ## ## ## [TODO] - I just think. ## 1. user auth(option) ## 2. check and more useragent support ## 3. etc, .... T.T ## ## enjoy !!! ## #####################################################