커피닉스, 시스템 엔지니어의 쉼터
  솔라리스에서 ICECAST mp3 스트림 방송 (글 보리수) 작성일 : 2005/03/21 21:59
 
  • 글쓴이 : 좋은진호 ( http://coffeenix.net/ )
  • 조회수 : 8781
     
    출  처 : SOLARIS HOME ( http://solaris.mesani.net/viewtopic.php?t=191 )
    제  목 : 솔라리스에서 ICECAST mp3 스트림 방송
    작성일 : 2003.6.20(금)
    글 : 보리수

    -----------------------------------------------------------------------
    편집글: 보리수(borisu at mesani.net)

    1. 소개
    icecast 는 GPL 을 따르며 TCP/IP 기반에서 MP3 방송을 가능케 하는 스트리밍 서버프로그램이며 linux 뿐만 아니라 윈도우 운영체제에서도 사용이 가능하다. 클라이언트는 winamp, xmms, mpg123등을 통하여 고음질의 음악 방송을 청취할 수 있다. 아래 사이트에 가면 mp3 스트림 음악 방송을 쉽게 들을 수 있다.
    http://classic.winamp.com/
    icecast2는 개발버전이고 icecast1은 개발이 종료되어 더이상 지원하지 않는다. 여기에서는 icecast1을 기준으로 설명한다.
    icecast2는 ogg 포멧을 기본으로 지원하며 자세한 사항은 http://www.icecast.org 을 방문해 보자.

    2. 설치에 필요한 소프트웨어

    - icecast1: 현재 최종 버전은 icecast-1.3.12
    http://www.icecast.org/files/icecast-1.3.12.tar.gz
    - ices: 현재 최종 버전은 ices-0.2.3
    http://www.icecast.org/files/ices-0.2.3.tar.gz

    - 컴파일 환경
    1) gcc: 개발자 테스트환경이 gcc 2.9.x이므로 이를 설치한다. 패키지는 http://www.sunfreeware.com에서 받아 설치한다.
    2) make: gmake를 사용하는 경우에는 binutils와 gnu make를 설치한다.
    http://www.sunfreeware.com에서 받아 설치한다. /usr/ccs/bin/make를 사용해도 된다.
    3) 컴파일시 PATH를 정의하자.
    # PATH=$PATH:/usr/local/bin:/usr/ccs/bin
    # export PATH

    3. 컴파일과 설치
    1) icecast
    # cd /usr/local/src
    # gzip -cd icecast-1.3.12.tar.gz | tar xvf -
    # cd icecast-1.3.12
    # more INSTALL
    # ./configure
    # make
    # make install

    2) ices
    # cd /usr/local/src
    # gzip -cd ices-0.2.3.tar.gz | tar xvf -
    # cd ices-0.2.3
    # more INSTALL
    그대로 컴파일하면 error가 난다. socket.h 파일을 다음과 같이 수정한다.
    # vi libshout/sock.h
    ------------------------------------------------------------------
    ... (앞부분 define 정의부분에 다음 한 줄을 삽입)
    #define inet_aton(a,b) inet_pton(AF_INET, (a), (b))
    ------------------------------------------------------------------

    # ./configure
    # make
    # make install

    3. 설정하기

    설정파일의 다음 두 가지이다.

    - /usr/local/icecast/conf/icecast.conf
    # cd /usr/local/icecast/conf
    # cp icecast.conf.dist icecast.conf
    # vi icecast.conf

    - /usr/local/icecast/etc/ices.conf
    # cd /usr/local/icecast/etc
    # cp ices.conf.dist ices.conf
    # vi ices.conf

    - root로 동작하면 보안상 좋지 않으므로 특정 사용자에게 소유권을 이양한다.
    # useradd -d /export/home/ice -m -c "icecast" -s /bin/ksh icecast
    (이하 명령어들은 모두 icecast유저로 실행)

    설정할 내용은 다음을 참고한다.
    http://www.oclug.org/icecast.html

    - mp3 파일 playlist작성하기 (/storage/mp3에 파일들이 있다고 가정)
    $ find /sotrage/mp3 -name '*.mp3' > /usr/local/icecast/etc/shout.playlist

    4. 시동

    1) icecast 실행
    $ cd /usr/local/icecast/bin
    $ ./icecast -p linuxcast & (linuxcast는 icecast.conf에서 지정해준 패스워드)

    2) ices 실행
    $ cd /usr/local/icecast/bin
    $ ./ices -r -C ../etc/ices.conf -F ../etc/shout.playlist -P linuxcast &


    5. 방송 듣기

    클라이언트에서 winamp, mpg123등으로 방송되는지를 확인한다.

    1) Xmms, Winamp, Realplayer
    open location을 이용해(Control + l) 직접 URL을 입력한다.
    URL은 다음과 같다.
    http://your-icecast-host:8000/shout.playlist

    2) mpg123
    $ mpg123 http://your-icecast-host:8000/shout.playlist

    6. 참고 문서
    1) YoLinux: Linux Audio Streaming
    http://www.yolinux.com/TUTORIALS/LinuxTutorialAudioStreaming.html
    2) Streaming MP3's over your home/office network
    http://www.oclug.org/icecast.html
    3) Streaming MP3's (RedHat Documentation)
    http://www.europe.redhat.com/documentation/HOWTO/MP3-HOWTO-11.php3
    4) live 방송국
    http://www.live365.com/index.live
    http://classic.winamp.com/


    커피닉스, 시스템 엔지니어의 쉼터 / URL : http://coffeenix.net/board_view.php?bd_code=792