.:My Black Corner:.

Wednesday, January 23, 2008

Membangun MP3 Streaming Server - Ubuntu Gutsy Gibbon

Setelah sekian lama berkutat dengan pembuatan server video streaming dengan menggunakan DSS (Darwin Streaming Server), timbul keisengan saya membuat sesuatu yang baru. Ya...! MP3 streaming dengan menggunakan aplikasi shoutcast. Pertama-tama kita membutuhkan dua aplikasi untuk menjalankan streaming ini, diantaranya:
  1. Shoutcast , aplikasi untuk streaming.
  2. Trans Posix, aplikasi untuk playlist.
Download dari URL diatas dengan menggunakan downloader kesayangan Anda. Saya lebih senang menggunakan wget :).
# wget http://www.geocities.com/dadhee/shoutcast-1-9-5-linux-glibc6.tar.gz
# wget http://www.geocities.com/dadhee/sc_trans_posix_040.tgz

Setelah selesai kita download, ekstrak kedua file tadi ke direktori /usr/local.
# tar xfvz shoutcast-1-9-5-linux-glibc6.tar.gz -C /usr/local
# tar xfvz sc_trans_posix_040.tgz -C /usr/local

Konfigurasi untuk keperluan administrasi.
Konfigurasi ini dipakai apabila kita akan membuka URL http://[ip_server_streaming_Anda]:8000/admin.cgi. Edit file sc_serv.conf pada direktori /usr/local/shoutcast/, ganti baris
Password=[masukan passwd Anda]
# nano /usr/local/shoutcast/sc_serv.conf

Konfigurasi untuk keperluan daftar lagu/playlist.
Edit file sc_trans.conf pada direktori /usr/local/sc_trans/
Ubah beberapa baris berikut:
PlaylistFile=myMusix.lst
ServerIP=[ip_server_streaming_Anda]
ServerPort=8000
Password=[masukan passwd Anda]
StreamTitle=Server streaming-ku
StreamURL=http://[ip_server_streaming_Anda]
Genre=Aliran musix garis keras

Membuat daftar lagu/playlist.
# find [direktori tempat lagu berada] -type f -name "*.mp3" > /usr/local/sc_trans/myMusix.lst
misal, saya menyimpan lagu pada direktori /media/hdd5/dadhee/music, maka perintahnya:
# find /media/hdd5/dadhee/music -type f -name "*.mp3" > /usr/local/sc_trans/myMusix.lst

Menjalankan server streaming.
Untuk menjalankan server streaming, kita perlu memanggil file sc_serv pada direktori /usr/local/shoutcast/. Contoh:

root@pegel-linux:/usr/local/shoutcast# ./sc_serv

*******************************************************************************
** SHOUTcast Distributed Network Audio Server
** Copyright (C) 1998-2004 Nullsoft, Inc. All Rights Reserved.
** Use "sc_serv filename.ini" to specify an ini file.
*******************************************************************************

Event log:
<01/23/08@14:54:19> [SHOUTcast] DNAS/Linux v1.9.5 (Dec 27 2004) starting up...
<01/23/08@14:54:19> [main] pid: 9931
<01/23/08@14:54:19> [main] loaded config from sc_serv.conf
<01/23/08@14:54:19> [main] initializing (usermax:32 portbase:8000)...
<01/23/08@14:54:19> [main] No ban file found (sc_serv.ban)
<01/23/08@14:54:19> [main] No rip file found (sc_serv.rip)
<01/23/08@14:54:19> [main] opening source socket
<01/23/08@14:54:19> [main] source thread starting
<01/23/08@14:54:19> [main] opening client socket
<01/23/08@14:54:19> [main] Client Stream thread [0] starting
<01/23/08@14:54:19> [main] client main thread starting
<01/23/08@14:54:19> [source] listening for connection on port 8001
<01/23/08@14:54:45> [source] connected from [ip_address_server_streaming_Anda]
<01/23/08@14:54:45> [source] icy-name:myMusic ; icy-genre:Aliran musix garis keras
<01/23/08@14:54:45>[source]icy-pub:1; icy-br:80; icy-url:
http://
[ip_address_server_streaming_Anda]
<01/23/08@14:54:45> [source] icy-irc:shoutcast ; icy-icq: ; icy-aim:AIMHandle

<01/23/08@14:55:07> [yp_add] yp.shoutcast.com gave error ()
<01/23/08@14:55:14> [dest: 192.168.0.180] starting stream (UID: 0)[L: 1]
{A: WinampMPEG/5.34}(P: 0)


Lalu jalankan juga file sc_trans_linux pada direktori /usr/local/sc_trans/. Contoh:

root@pegel-linux:/usr/local/sc_trans# ./sc_trans_linux
*******************************************************************************
** TRANScast Distributed Network Audio Content Provider
** Copyright (C) 2000 Nullsoft, Inc. All Rights Reserved.
** Use "sc_trans filename.conf" to specify a config file.
*******************************************************************************
<01/23/08@14:54:45> [TRANSCast] DNAS/posix v0.400-LAME (Mar 4 2003) starting up...
<01/23/08@14:54:45> [MAIN] PID: 9935
<01/23/08@14:54:45> [MAIN] Loaded config from sc_trans.conf
<01/23/08@14:54:45> [MAIN] Loading playlist (music.lst)
<01/23/08@14:54:45> [MAIN] Found (7) entries in playlist
<01/23/08@14:54:45> [MAIN] Playlist decoder thread starting
<01/23/08@14:54:45> [MAIN] Streaming thread starting
<01/23/08@14:54:45> [DECODE] Opened Ku Menanti Seorang Kekasih.mp3
<01/23/08@14:54:45> [CONFIG] WARNING: No InputSamplerate defined, assuming 44100!
<01/23/08@14:54:45> [CONFIG] WARNING: No InputChannels defined, assuming 2!
<01/23/08@14:54:45> Warning: input file samplerate is -134427917 Hz, must be 44100!
<01/23/08@14:54:45> Warning: input file samplerate is -134427917 Hz, must be 44100!
<01/23/08@14:54:45> Warning: input file samplerate is -134427917 Hz, must be 44100!
<01/23/08@14:54:45> Warning: input file samplerate is -134427917 Hz, must be 44100!
<01/23/08@14:54:45> Warning: input file samplerate is -134427917 Hz, must be 44100!
<01/23/08@14:54:45> [DECODE] Opened Buku Ini Aku Pinjam.mp3
<01/23/08@14:54:45> [STREAM] Creating stream socket
<01/23/08@14:54:45> [STREAM] Connected to host server
<01/23/08@14:54:45> [STREAM] Host server gave success (OK2)
<01/23/08@14:54:45> [STREAM] Stream to [ip_address_server_streaming_Anda] established
<01/23/08@14:54:45> [STREAM] Sending stream information
<01/23/08@14:54:47> [MAIN] Title Updated

Menjalankan streaming dari sisi client.
Buka aplikasi pemutar media yang mengenal format file .lst. Contoh disini dengan aplikasi WinAmp.




posted by .:CyberColombuzz:. at 3:19 PM

1 Comments:

Mantap gan... izin publish ya di blog ane....

Friday, May 27, 2011 11:49:00 AM  

Post a Comment

Links to this post:

Create a Link

<< Home