Home | 簡體中文 | 繁體中文 | 雜文 | 知乎專欄 | Github | OSChina 博客 | 雲社區 | 雲棲社區 | Facebook | Linkedin | 視頻教程 | 打賞(Donations) | About
知乎專欄多維度架構 微信號 netkiller-ebook | QQ群:128659835 請註明“讀者”

第 194 章 Stream

目錄

194.1. broadcast streaming
194.1.1. gnump3d - A streaming server for MP3 and OGG files
194.1.2. icecast2 - Ogg Vorbis and MP3 streaming media server
194.1.2.1.
194.1.2.2. installation from source
194.1.3. shoutcast
194.1.4. PeerCast
194.2. WebRTC

194.1. broadcast streaming

194.1.1. gnump3d - A streaming server for MP3 and OGG files

過程 194.1. 

  1. installation

    $ sudo apt-get install gnump3d				
    				
  2. configure

    $ sudo vim /etc/gnump3d/gnump3d.conf
    
     root = /var/music
    				
  3. copy some mp3 file to directory /var/music

  4. testing

    http://127.0.0.1:8888/

194.1.2. icecast2 - Ogg Vorbis and MP3 streaming media server

http://www.icecast.org/

194.1.2.1. 

過程 194.2. 

  1. installation

    $ sudo apt-get install icecast2
    					
  2. configure

    /etc/default/icecast2

    $ sudo vim /etc/default/icecast2
     #ENABLE=false
     ENABLE=true					
    					

    /etc/icecast2/icecast.xml

    					
          <authentication>
              <!-- Sources log in with username 'source' -->
              <source-password>your-password</source-password>
              <!-- Relays log in username 'relay' -->
              <relay-password>your-password</relay-password>
     
              <!-- Admin logs in with the username given below -->
              <admin-user>admin</admin-user>
              <admin-password>your-password</admin-password>
          </authentication>
    					
    					
  3. starting

    $ sudo /etc/init.d/icecast2 start
    					
  4. testing

    http://localhost:8000/

194.1.2.2. installation from source

過程 194.3. 配置步驟

  1. 安裝lib庫

    netkiller@Linux-server:~/icecast-2.3.1$ sudo apt-get install libxslt1.1
    netkiller@Linux-server:~/icecast-2.3.1$ sudo apt-get install libxslt1-dev
    netkiller@Linux-server:~/icecast-2.3.1$ sudo apt-get install libshout3
    netkiller@Linux-server:~/icecast-2.3.1$ sudo apt-get install libshout3-dev
    				
  2. $ sudo ./configure --prefix=/usr/local/icecast

    make;make install

    netkiller@Linux-server:~/icecast-2.3.1$ ./configure --prefix=/usr/local/icecast
    netkiller@Linux-server:~/icecast-2.3.1$ make
    netkiller@Linux-server:~/icecast-2.3.1$ sudo make install
    netkiller@Linux-server:~/icecast-2.3.1$ cd /usr/local/icecast/
    netkiller@Linux-server:/usr/local/icecast$ ls
    bin  etc  share
    				

    創建icecast2用戶

    修改所有者

    netkiller@Linux-server:/usr/local/icecast$ cd ..
    netkiller@Linux-server:/usr/local$ adduser icecast2
    netkiller@Linux-server:/usr/local$ sudo chown icecast2.icecast2 -R icecast/
    				
  3. 運行icecast

    netkiller@Linux-server:/usr/local$ su icecast2
    netkiller@Linux-server:/usr/local$ /usr/local/icecast/bin/icecast -b -c /usr/local/icecast/etc/icecast.xml
    				
  4. 配置icecast

    管理員/密碼

    admin-user: 管理員用戶名

    admin-password: 管理員密碼

    icecast2@Linux-server:/usr/local/icecast$ vi etc/icecast.xml
    
    
        <authentication>
            <!-- Sources log in with username 'source' -->
            <source-password>hackme</source-password>
            <!-- Relays log in username 'relay' -->
            <relay-password>hackme</relay-password>
    
            <!-- Admin logs in with the username given below -->
            <admin-user>admin</admin-user>
            <admin-password>chen</admin-password>
        </authentication>
    
    
    				
  5. 測試 http://netkiller.8800.org:8000/

194.1.3. shoutcast

shoutcast...

194.1.4. PeerCast

homepage: http://www.peercast.org/