SHOUTcast是专为通过互联网传输流媒体而设计的软件。SHOUTcast系统使用经典的客户端 - 服务器配置。您可以在服务器上安装SHOUTcast,并使用它向连接到服务器的客户端广播音乐流。Shoutcast媒体服务器可以从大量磁盘空间中受益,因此请考虑使用我们的Block Storage服务进行此设置。
注意请务必查看广播工具下载页面以获取最新版本的SHOUTcast。
SHOUTcast DNAS软件
SHOUTcast DNAS(分布式网络音频服务器)软件是该软件的服务器版本,允许您向听众广播。要使用SHOUTcast,您需要在Linode上下载并安装SHOUTcast DNAS。
下载并安装SHOUTcast
该软件有多个版本,因此请确保下载正确的版本。Linux版本提供32位和64位版本。您需要下载与您在Linode上安装的操作系统相对应的版本。
- 创建用于运行SHOUTcast的用户,因此您不以root身份运行它。输入以下命令:
adduser shoutcast
- 输入以下命令切换到新用户的主目录:
cd /home/shoutcast
- 为SHOUTcast创建一个目录:
mkdir sc
- 现在我们可以下载DNAS包。在这个例子中,我们将下载32位版本:
wget http://download.nullsoft.com/shoutcast/tools/sc_serv2_linux_07_31_2011.tar.gz
- 通过输入以下命令将SHOUTcast文件解压缩到新目录:
tar -xzf sc_serv2_linux_07_31_2011.tar.gz -C sc
- 将所有权更改为
root
SHOUTcast用户:
chown -R shoutcast.shoutcast /home/shoutcast/sc
SHOUTcast DNAS软件现已安装在您的Linode上。
配置SHOUTcast
现在,您需要修改配置。这是指定密码和设置SHOUTcast端口所必需的。以下是配置SHOUTcast的方法:
- 打开SHOUTcast配置文件:
nano sc/sc_serv_basic.conf
- 这将打开配置文件进行编辑,如下所示。
/home/shoutcast/sc/sc_serv_basic.conf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
; NOTE: for any relative paths specified are relative to ; sc_serv and not to where the conf file is being stored ; here we will setup where the log and other related files ; will be stored. make sure that these folders exist else ; sc_serv will throw an error and will close itself down. ; we will make the logs save to the sc_serv2 directory logfile=logs/sc_serv.log w3clog=logs/sc_w3c.log banfile=control/sc_serv.ban ripfile=control/sc_serv.rip ; for testing we will make the server only work locally ; (i.e. localhost / 127.0.0.1) though if this is left out ; or set to publicserver=always then we attempt to make a ; connection to the YP for listing - do not forget to add ; in a 'streamauthhash' value for any public streams made ;publicserver=never ; if you're wanting to use a different port to use for any ; connections then you can use this option e.g. to use 80 ; otherwise port 8000 is used as the default to listen on. ;portbase=80 ; password used by sc_trans or the Winamp dsp plug-in ; NOTE: remember to change this to something else password=testing ; password used for accessing the administation pages ; NOTE: remember to change this to something else adminpassword=changeme ; now we will specify the details of the stream we're going ; to serve which can be done as follows streamid=1 streampath=/test.aac ; or ; it can be done like this which is how it needs to be done ; if you are going to provide multiple streams from sc_serv ;streamid_1=1 ;streampath_1=/test.aac ;streamid_2=2 ;streampath_2=/test2.aac
- 将
password
和adminpassword
变量设置为您想要的任何值。 - 该
portbase
变量应设置为使用您不使用的端口。SHOUTcast的默认端口是8000。
注意如果将portbase
变量设置为8000以外的任何值,请务必通过删除变量前面的分号来取消注释。 - 按Control-X,然后按Y,将更改保存到SHOUTcast配置文件。
现在已经设置并保存了配置,我们可以启动服务器。
启动SHOUTcast
现在,您可以启动SHOUTcast服务器。就是这样:
- 你想在屏幕会话中运行你的shoutcast 。让我们输入以下命令跳转到屏幕会话:
screen
- 输入以下命令启动SHOUTcast服务器:
./sc_serv sc_serv_simple.conf
- 发出start命令后,您应该看到以以下结尾的启动输出:
2011-11-02 14:50:03 I msg:[MICROSERVER] Listening for connection on port 8000 2011-11-02 14:50:03 I msg:[MICROSERVER] Listening for connection on port 8001
- 此时您可以从屏幕会话中分离。为此,请按住Control键并按A,放开,然后按D.
- 您应该在屏幕会话之外的命令提示符处返回。如果您需要稍后重新连接,只需键入:
screen -raAd
您的SHOUTcast服务器现在正在运行!您现在可以连接到它并开始广播。
SHOUTcast Transcoder
SHOUTcast Transcoder允许您安排DJ播放时间,在特定时段播放自动播放列表,为中继广播安排时隙等。
注意要以MP3格式对流进行编码,您必须 从WinAmp购买许可证密钥,费用为5美元。
下载并安装SHOUTcast Transcoder
我们将使用相同的shoutcast用户来设置Transcoder软件。以下是如何下载和安装代码转换器:
- 输入以下命令更改目录:
cd /home/shoutcast
- 通过输入以下命令为代码转换器创建新目录:
mkdir sct
- 输入以下命令下载SHOUTcast转码器归档:
wget http://download.nullsoft.com/shoutcast/tools/sc_trans_linux_10_07_2011.tar.gz
- 输入以下命令提取SHOUTcast转码器文件:
tar -xzf sc_trans_linux_10_07_2011.tar.gz -C sct
- 将所有权更改
root
为SHOUTcast用户:
chown -R shoutcast.shoutcast /home/shoutcast/sct - 输入以下命令更改目录:
cd sct
- 输入以下命令更改权限:
chmod a+x sc_trans
SHOUTcast转码器现已安装在您的Linode上。
配置SHOUTcast代码转换器
此示例将引导您完成基本配置。
- 输入以下命令打开配置文件:
nano /home/shoutcast/sct/sc_trans_basic.conf
- 您可以修改比特率以更改音乐的音质并限制消耗的带宽量。如果您购买MP3许可,您可以修改编码器部分以添加MP3编码和解锁数据:
/home/shoutcast/sct/sc_trans_basic.conf 1 2 3 4 5 6 7 8 9 10 11 12
; for testing we will only setup a single encoder though it ; is easy to add in additional encoder configurations and ; we are using an aac plus encoder as the default due to ; the licensing requirements for mp3 encoding as detailed ; in sc_trans.txt - section 2.5). encoder_1=aacp encoder_2=mp3 bitrate_1=56000 bitrate_2=56000 unlockkeyname=YourUnlockName unlockkeycode=YourUnlockCode
- 接下来,将sc_trans修改为sc_serv连接详细信息:
/home/shoutcast/sct/sc_trans_basic.conf 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
; this is where we define the details required for sc_trans ; to connect to the sc_serv instance being used where the ; details must match those specified in sc_serv_basic.conf outprotocol_1=3 serverip_1=127.0.0.1 ; default is 8000, if not change to sc_serv's 'portbase' serverport_1=8000 ; this is the same as 'password' in sc_serv_basic.conf password_1=testing ; this is the same as 'streamid' in sc_serv_basic.conf for ; the stream we are acting as the source for streamid_1=1 ; this is a name for the source we're creating and is used ; with the AJAX control api or can be left blank to get a ; generic name created in the form of 'endpointX' where 'X' ; is the index of the created source from sc_trans lists. endpointname_1=/Bob
- 此步骤是可选的,但您也可以更新流信息:
/home/shoutcast/sct/sc_trans_basic.conf1 2 3 4 5 6
; here you would provide any information to fill in details ; provided to clients about the stream. it us up to you what ; is entered though do not do anything which will annoy, etc streamtitle=My Test Server streamurl=http://www.shoutcast.com genre=Misc
- 为自动流设置播放列表文件:
/home/shoutcast/sct/sc_trans_basic.conf1 2 3
; here we specify a playlist to use as the master list from ; which to play files from. playlistfile=playlists/main.lst
- 现在设置代码转换器管理面板访问的端口,用户名和密码:
/home/shoutcast/sct/sc_trans_basic.conf1 2 3 4 5 6
; these options will allow you access the admin interfaces ; of sc_trans though also allows the 'testui' example to be ; accessed. remember to change the password, etc as needed adminport=7999 adminuser=admin adminpassword=goaway
- 按Control-X,然后按Y,将更改保存到SHOUTcast配置文件。
- 如果您使用的是自动播放列表,请将音乐文件上传到
/home/shoutcast/sct/music
目录。 - 如果您使用的是自动播放列表,则还需要创建播放列表文件。这是一个例子:
/home/shoutcast/sct/playlists/playlist.lst 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# This example playlist is used as the main playlist sc_trans will use to pick # out the files it will use to create its output for the source we generate. # # Also remember to use the correct path format for the OS you are using and to # ensure that the files you want to play are present in the location you choose # e.g. ../music/shoutcast.mp3 # # In this example we will just assume that all of the files associated to the # playlist are in one folder and all have an mp3 extension though there is no # reason why you cannot explicitly specify files to use or to reference a tool. # See sc_trans.txt - section 7.1 for more information on how playlists work. # Remember to change this to reference the files you want to use when trying # the sc_trans_playlist.conf example which is best tried with full length files
启动SHOUTcast Transcoder
一旦配置了代码转换器并准备就绪,就需要启动它。要将代码转换器作为守护程序运行,只需运行此命令,替换sc_trans_basic.conf
您正在使用的任何配置文件:
./sc_trans daemon ./sc_trans_basic.conf
如果没有出现错误,您应该看到类似于下面一行的输出,其中XXXX是PID:
sc_trans going daemon with PID [XXXX]
要关闭代码转换器,您只需要发出一个kill命令:
SHOUTcast源DSP
SHOUTcast的Source DSP插件是为与WinAmp 5.5及更高版本一起使用而开发的。此插件使您能够使用WinAmp作为sc_serv(DNAS)或sc_trans(Transcoder)的源。它还允许您从声卡及其输入或麦克风输入中捕获音频输入。在使用DSP WinAmp插件之前,您需要自己安装DNAS,或者将Transcoder输入到DNAS安装中。DSP插件的下载位于广播工具页面的底部附近。
安装和配置说明位于WinAmp wiki中。
更多信息
有关此主题的其他信息,您可能需要参考以下资源。虽然提供这些是希望它们有用,但请注意,我们无法保证外部托管材料的准确性或及时性。