Article title: Stable. use linux to build your own mp3 broadcast station. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Icecast is an Internet broadcast system based on Mpeg III technology. Compared with commercial software such as shoutcast, icecast has the following features:
Icecast is a pure OpenSource software;
You do not need to run your own directory server;
Occupy less system resources;
We can run our own streaming server -- icecast on the server and use ices to provide the container. the client can use the most commonly used winamp.
Test environment: Server Platform: RedHat 7.0
Streaming Server: icecast
Usage: ices
Mp3 encoding tool: lame
Steps: 1. obtain related software
Stream server icecast: http://www.icecast.org/releases/icecast-1.3.10-1.i386.rpm
Note: A. generally, liveice, shout, and other software can be used to provide a stream (that is, serving as a stream) for the stream server. However, I found that ices is stable during use, although it is still a beta version.
B. generally, each mp3 file cannot have the same attributes. at this time, some strange phenomena may occur during the broadcast process, such as intermittent and noisy sounds, therefore, we must use the mp3 encoding tool lame to encode it again to generate mp3 files with consistent attributes.
2. install icecase
Run the following command to install icecast:
Rpm? Ivh icecast-1.3.10-1.i386.rpm
3. install ices
Run the following command to install ices:
# Tar xvzf ices-0.0.1.beta5.tar.gz
The ices-0.0.1.beta5 directory is generated under the current directory, and the cd command is used to enter the Directory
# Cd ices-0.0.1.beta5
Then execute:
#./Configure
# Make
# Make install
The compiled files are installed in the/usr/local/icecast directory by default.
4. install lame
Run the following command to install the lame mp3 encoding tool. This tool is used to re-encode mp3 files to generate mp3 files with consistent attributes.
The main configuration file of icecast is/etc/icecast. conf, which has many configuration options, but most of them only need to adopt the default configuration. some options are described as follows:
Port: defines the Port bound to the icecast service. only one Port can be set. Port 8000 is usually used.
Encoder_password: password used to connect to the kernel. ices must provide this password when providing a stream for icecast. for security reasons, you can set a complicated password.
Admin_password: you can use telnet to log on to icecast for remote management. this password is the one you must enter when logging on to icecast.
Oper_password: password used by telnet to log on to icecast to execute the restricted command.
Max_clients: maximum number of customers allowed to connect to the streaming server within the same time.
Max_sources: maximum number of workers that can be broadcast at the same time. the stream source and stream server can be located on different machines and multiple workers can be transmitted to the same stream server for broadcast.
Max_admins: number of connections that can be remotely managed by logging on to icecast at the same time.
Logfile: set the location of the log file.
Hostname: set the IP address bound to icecast. it is bound to all IP addresses by default.
Server_name: specify the host name or IP address of the icecast server.
Client_timeout: Set the timeout time when the server disconnects the connected customer when no timeout occurs.
Stats_log: Set the log file that records icecast statistics.
Stats_time: Set the update period of the stats_log file.
Max_clients_per_source: sets the maximum number of customers that can be connected to the same region at the same time.
Reverse_lookups: Sets whether to reverse DNS resolution can be performed on connections. if the value is 0, reverse DNS resolution is disabled. if the value is 1, reverse dns resolution is enabled.
Location: set the geographic Location of the icecast server. setting or not is not important.
Rp_email: Set the email address of the icecast server administrator.
Throttle: the bandwidth threshold that can be used by the icecast server. If this threshold is reached, new customer connections will be rejected, in megabytes/s.
Logfiledebuglevel: defines the log details.
Server_url: defines the RUL of The icecast server
The following are my configuration files for your reference only:
As you can see, you only need to include the complete path and file name of the mp3 file.
9. publish stream
Ices can use xml-based configuration files or command with options. here we use the latter. common command options include:
-B: specify how ices will run in the future.
-B: specifies the baud rate.
-D: Stream description
-N: Set the name of the broadcast station.
-G: the type of broadcast music.
-H: streaming server IP address
-P: Listener port of the stream server
-P: The password used to connect to the streaming server.
-R: set random playback of songs
-S: specifies the type of the playlist, usually using builtin
-U: specifies the URL of the streaming server.
-F: specifies the playlist file.
My example:
/Usr/local/icecast/bin/ices? B? B 56? D MUSIC
? N "TOM Radio "? G music? H localhost
? P 8000? P secrue? R? S builtin? U
Http://www.yxtc.edu.cn: F/etc/icecast/list
10. receive broadcast
Users can receive broadcasts in a way similar to the following:
Create a file with the extension m3u. for example, if my file is tom. m3u, the file contains the following content:
Http://www.yxtc.edu.cn: 8000/
Then, create a hyperlink to the file on the homepage. once you click the connection, mp3 players such as winamp and realplay will be started to receive broadcasts.
We recommend that you use winamp to receive broadcasts.
Well, it's done. sit down and make a cup of coffee and enjoy your mp3 broadcast.
11. Additional instructions:
I wrote a perl script that automatically searches all mp3 files in the system, then, mp3 files with non-56 K baud rate and 24 kHz sampling frequency are converted into mp3 files with a 56 k baud rate and a 24 kHz sampling frequency using lame. after the conversion, a playback list is automatically generated.
Usage:
./List_gen list_file
You must use the touch command to create the list file.
This script requires your system to install the lame tool.
The script source code is as follows. you can also download it from here:
#! /Usr/bin/perl
'Rm-f/tmp/temptid ';
If (! $ ARGV [0]) {
Print "Usage:./list_gen list_file_name ";
Print "You mu
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.