As more and more friends begin to choose ADSL, cable modem, or fttb + lan as the primary way to access the Internet, the broadband era is approaching, this makes our dream of "Broadband KTV, audio and video chat rooms, online cinemas, and distance education" a reality, and the closely related "streaming media" will also become
This is a hot topic that many people talk about, because "streaming media" is the technical motivation to implement these broadband applications.
The advent of the Broadband Age also makes netizens no longer satisfied with the fact that they are serving only one service audience. They need to communicate on a larger scale to reflect the value of individual users. Therefore, many friends started to use their computers to build online broadcast and on-demand broadcast sites. They are full of enthusiasm, but it is undeniable that Chinese netizens are born
Technical limitations have caused them to encounter many obstacles when building such a site, so that they can give up. How to turn this enthusiasm into motivation under the guidance of technology is exactly what we need to do at home computers. So, today, here, I will show you how to create your own streaming media server.
However, before starting the official establishment of the Streaming Media Server, let's take a look at the basic knowledge of the Streaming Media Server.
Ii. Basic streaming media knowledge
What is streaming media?
Currently, there are two solutions for transmitting audio/video and other multimedia information over the network, namely HTTP or FTP download and stream transmission.
Standard HTTP and FTP protocols are used for HTTP or FTP download. However, due to the huge multimedia information
A multimedia file usually takes several minutes or hours.
First, it may take longer than the entire video to complete the download. These downloaded
Files must be created before being downloaded and placed on the network server. The direct consequence is:
As the network bandwidth continues to increase, there is less and less waiting time for people to download, but they still cannot watch the live video directly.
.
During stream transmission, audio, video, animation, and other multimedia information are connected to the user's computer by the Streaming Media Server.
Continuous and real-time transmission. It first creates a buffer on the user's computer and downloads a buffer before playing the video.
As a buffer, you do not have to wait until the entire file is downloaded, but only a few seconds or dozens of seconds
You can watch the video with startup latency. When multimedia information is played on the client, the remaining part of the file is
The background downloads data from the server. If the network connection speed is less than the speed required for playing multimedia information,
The playing program will use the data in a small buffer area previously established to avoid playing interruption, so that the playing
Quality can be maintained.
In addition to sending completed files, streaming transmission also supports real-time collection by the collection server.
It collects on-site audio and video, pushes it to the Streaming Media Server, and provides it to users in real time. Therefore, in addition
In addition to multimedia on-demand services such as downloading, apsaravideo for VOD can be used for live broadcast, television broadcast,
Emergency reports and other fields that require high real-time transmission.
Streaming Media vendors
The market for streaming media is huge, and many excellent vendors in the world join the ranks. At this stage, it is also a system set.
A treasure for business competition. In the general market, there are three competing companies: Microsoft,
RealNetworks and Apple, and corresponding products are Windows Media, Real Media, and QuickTime.
Recently, the famous Winamp Nullsoft company has added video support to its MP3 server.
Yes, I want to share a piece of cake in the streaming media market.
Because Apple's servers and Editing Software generally use Mac as the operating platform, Nullsoft's Streaming Media Server
The server is a new and immature transaction, so I will introduce Microsoft and
RealNetworks products.
Streaming media transmission protocol
When you watch online movies or TVs, you usually notice that these files are not connected.
Starting with HTTP or FTP, but something starting with RTSP or MMS. Why? Actually,
Like HTTP and FTP, these are data transmission protocols over the network, but they are dedicated for transmission.
Streaming media protocols. Next, let's take a look at the main streaming media protocols currently used:
1. RTSP (Real Time Streaming Protocol), Real-Time Streaming Protocol, which is composed
Proposed by RealNetworks and Netscape, it is now used in Real Media Products of RealNetworks;
2. PNM (progressive networks audio), which is also a real-time transmission protocol,
Generally, it uses UDP protocol and occupies port 7070. However, when your server is in the firewall and port 7070 is
When your server sets the smartingnetwork to true, the HTTP protocol is used and the default
Port 80;
3. MMS (Microsoft Media Server Protocol), which is Microsoft's Media Server Association
MMS is the default method for connecting to the Windows Media Unicast service.
This article introduces three main protocols. You may also ask, what protocol does apple use for QuickTime? In
In most cases, QuickTime uses the HTTP protocol, but in fact it is also based on the standard streaming media transmission protocol,
This is the standard RTSP protocol, and real's RTSP is developed by itself.
In streaming media transmission, the standard protocol is RTP (real time transport protocol,
Real-time transmission protocol), RTCP (Real-time transport control protocol, real-time transmission control
Protocol), RTSP (Real Time Streaming Protocol, Real-Time Streaming Protocol) and RSVP
Resource Reserve Protocol.
Research and development on the basis of, limited by space, here we will not discuss in depth.
Streaming media files and publishing formats
With the real-time transmission protocol, we should also be able to think that only small files are suitable for the Network
When streaming media files are transmitted, what compression algorithms are used for streaming media files?
However, if you are using a Windows operating system, you can see that when we watch online streaming programs, their
The suffixes are RM, ASF, and WMV. These are the formats of streaming media. Streaming Media File Format
Special encoding not only uses a high compression ratio, but also adds a lot of control information to make it suitable for the Network
Play while downloading, instead of waiting for the download of the entire file.
.
Common streaming media formats include the following:
Media File Format extension (video/audio) media type and name
ASF Advanced Streaming Format. (Microsoft ).
Rm real video/audio file (progressive networks ).
RA real audio file (progressive networks ).
RP real pix file (progressive networks ).
RT real text file (progressive networks ).
SWF Shock Wave flash (Macromedia ).
MoV QuickTime (Apple format)
Viv vivo movie file (vivo software ).
There is also a WMV Format, short for Windows Media video, which has a slight difference with ASF files.
Difference: WMV is generally in Window Media video/audio format, and ASF video is generally used
Microsoft mpg4 V (3/2/1 ?), The audio part is Windows Media Audio v2/1, but now
Many production software do not separate them, so you can directly change the suffix to convert them to the other format.
The created streaming media files must be published to the network to be used by others.
And the format of the streaming media file is changed to the streaming media publishing format.
Common publishing formats include the following:
Expanded media types and names in streaming media publishing format
ASF Advanced Streaming Format.
SMIL synchronised Multimedia Integration Language.
Ram file.
Rpm embedded RAM file.
Asx asf Stream Redirector/ASF stream Steering Gear File
XML eXtensible Markup Language
MPEG-4 and streaming media
Speaking of streaming media can not but mention MPEG-4. MPEG-4 is one of the focuses of the current discussion, just because it can
Enough to achieve the approximate quality of video and audio effect under the large compression ratio, this is also a lot of friends think MPEG-4
The format must be clearer than RM. But in fact this is not the case, MPEG-4 is just a video encoding technology,
Its clarity also varies significantly according to the bit rate selected during compression (we see the MPEG-4 Lattice
Files are usually generated for kbps compression, of course, high quality), And, MPEG-4 also has a variety of compression standards,
For example, Microsoft's ASF video is based on the discrete cosine transform (DCT) MPEG-4 ),
There is also a free MPEG-4 version of DivX (beginning to crack Microsoft's format ). For the audio part,
Microsoft uses Windows Media Audio v2/1 and DivX uses MP3 or higher quality
AC3. In contrast, the real or apple formats use self-developed codes at the same bit rate,
Especially in the low bit rate, not necessarily worse than the MPEG-4, take the RM format of the high bit rate is still clear, so
In the future, we will say that the concept of poor definition of RM format should be changed :), at least the conditions should be added. And, most
Real Video 9 in the new helix producer adopts the VP5 compression format for encoding, which is better than DivX
Show more!
However, the Streaming Media Server began to move closer to the MPEG-4 format is an indisputable fact, real's latest Helix
We started to support MP4 file services, while RealOne Player only needs to install a plug-in to implement
Playback in MPEG-4 format.
On-demand broadcast
Before setting up a Streaming Media Server, we must understand the knowledge of on-demand streaming and broadcasting.
Vod is an active connection between the client and the server.
Project to initialize the client connection. A client receives a media stream from the server (this connection is unique
And can start, stop, back, fast forward, or pause the media.
The client has control over the stream, just like watching a video disk. In this way, each client has its own
To connect to the server, the server needs to establish a connection for each user, which requires both server resources and network bandwidth.
Relatively large.
Broadcast refers to the passive receiving of streams by users. In the broadcast process, the client receives a stream but cannot control the flow,
The user cannot pause, fast forward, or backward the stream. The data sending methods used by broadcast include unicast and broadcast. Ticket
When sending multicast packets, the server needs to copy multiple copies of the data packets and send them to
The users who want it, and send it in broadcast mode, a separate copy of the data packet will be sent to
All users, regardless of whether or not they need them, will waste a lot of network bandwidth and servers.
Resources, so the multicast technology is generated.
Multicast absorbs the strengths of the two sending methods and overcomes the weaknesses of the two sending methods.
Point, send a separate copy of the data packet to those customers, multicast does not copy multiple data packets
The data packet is copied and transmitted to the network, and will not be sent to those customers who do not need it. This ensures that many
The minimum bandwidth that a media application occupies. However, multicast not only requires server support, but also multicast routing.
And the entire network structure.
Unicast and Multicast)
We have learned some concepts about unicast and multicast, which are also discussed in streaming media.
Focus. In my understanding, Vod and broadcast are a group of concepts that allow them to interact with client media;
Unicast and multicast are another concept. They are the transmission methods of streaming media data on the server and network.
For unicast transmission, a separate data channel needs to be established between the client and the Media Server, from
Each data packet sent from the server can only be sent to one client. Each user must
The server must send a copy of the requested data packet to each user. This is huge
Redundancy can cause heavy load on the server and network bandwidth. It takes a long time for the response, and even cannot
Service status. Unicast can be used for VOD and broadcast.
When multicast is sent, the server sends the streaming media data requested by a group of customers to a route supporting Multicast technology.
Then, the router copies the data packet to multiple channels according to the route table at a time, and then sends the data packet to the user.
At this time, the Media Server only needs to send an information package, and all the clients sending the request share the same message.
Messages can be sent to clients with any address. clients without requests will not receive information packets,
The total amount of information packets transmitted over the network is not as large as that transmitted over the broadcast, which greatly improves the utilization of servers and network lines.
Rate. However, multicast has its own characteristics. First, you must start a vro that supports multicast technology.
Yes, it can only be used for broadcast, because it may cause user control problems.
Well, if you say so much, you may be tired of me, so let's start to set up streaming media services.
Go to IOT platform.
Iii. Prepare the streaming media server hardware
Streaming Media Servers, like Web servers, must be accessed by many people at the same time.
For servers, due to the need for stronger processing capabilities for multimedia files, their hardware devices should go beyond
. Therefore, it is best for streaming media servers to meet the following hardware conditions.
A powerful "core ". If the CPU usage of a computer is too low and the processing capability is too slow, the computer will be accessed by multiple users.
We will not be able to perform any other operations (I believe that you will often consider those online video-on-demand websites as the body ).
We can see that we have built the same servers as them, but they are smaller in size ).
Large Memory and hard disk capacity. The production and transmission of streaming media is a black hole of system resources, and the system has a large memory capacity.
The premise of stable operation; streaming media files are large in size, and a large number of media files require more storage space.
It is recommended that the memory should be at least 256 MB and the hard disk should be at least 80 GB.
Sound cards that occupy less system resources. A sound card helps reduce the CPU usage and improve the recording quality.
It has a great impact (for online live broadcasting). We recommend using the creative Sb live! OR Sb audigy, audigy 2
Series, because the author's own machine is not a server (only used for making articles, there is no money to upgrade), so only take
Common integration is used for demonstration.
Good video capturing device. Our live video program comes from this device. We recommend that you use leadtek (Li
Winfast tv2000 XP deluxe edition, which can receive signals and compress hardware
Public (because I have no conditions, the acquisition device uses screen capture, but the Acquisition Device method is used
Is the same, so please do not blame ).
As high as possible bandwidth. Of course, the faster the Internet is, the better, but we can connect to the Streaming Media Server
Make a limit on the number to avoid being a machine.
Of course, the above is a hardware device necessary to build a streaming media service website.
Like the author, I just want to learn how to set up a Streaming Media Server.
Bold test.
Iv. Setting up streaming media servers
After preparing the hardware, we will start to teach you how to set up your own Streaming Media Server step by step. I divide it
For Microsoft's Windows Media and RealNetworks's real media, both include
The establishment of the live streaming and on-demand video server will introduce Apple's QuickTime and Nullsoft at the end.
Streaming Media Server.
Microsoft's Windows Media on-demand service must be based on the server operating system.
So I chose Windows. NET Enterprise Server 3647 as the Streaming Media Server.
System platform. To compare the advantages of RealNetworks and the latest Microsoft Streaming Media Server
Poor, I used their latest streaming media system. The following is the specific software used by the author:
Operating System: Windows. NET Enterprise Server 3647, Windows XP Service Pack 1
Streaming media software: Windows Media Services 9.0 (Windows. NET Server ),
Windows Media Encoder 9 Series release candidate (due to this
The software runs abnormally under. NET Server, so it is installed in XP and only
Install the software in XP)
Windows Media Encoder 7.1
Windows Media Player 9.0 build z903
Helix Universal Server 9.01 for Win2k (9.0.2.794)
Helix producer plus 9.0.1
RealOne Player 2.0 build 6.0.11.853
Next, let's get started! Don't go away !!!
Winmedia online broadcast service
Simply use Windows Media Encoder to implement the online broadcast service.
Help Windows Media Services, using the Streaming Media File Created by Windows Media Encoder, I
Their network broadcast station functions will be more powerful. Next, we will use Windows Media Encoder to create
Establish a broadcasting station and incorporate it into Windows Media Services to achieve more powerful functions.
1. Install Windows Media Services.
First install Windows 2000 Server or windows. NET Server, and then open "start-
Control Panel-Administrative Tools-manage your servers "or" START-control panel-add or delete programs-
Add/delete Windows Components (the second type is recommended), and check "Web Application Server ",
That is, on the IIS server of 2000 Server, click "Next" to add;
After IIS is added, start the Add/delete Windows component program again and check Windows Media.
Service item, click details, and select "Windows Media Services for Web"
Administrator to start the Web management function of Windows Media Services (2000 may not have
You only need to install Windows Media Services );
2. Install Windows Media Encoder.
Download Windows Media Encoder 7.1 from Microsoft website (because Windows Media Encoder 9.0
Cannot work in. NET Server). So far, the server and code of Windows Media Service
Are already available;
3. Start Windows Media Encoder from "START-Program-Windows Media" and
Select the appropriate option based on your needs in the current wizard interface. We recommend that you use the new session wizard
Play, capture, or convert files, and click OK;
4. Because broadcast is performed, select "on the secondary device or computer screen" in the next pop-up screen.
Screen broadcast live events ". This option enables Windows Media Encoder to broadcast directly or
It is added to the Windows Media Service;
5. Select a video or audio capture device from the next screen. I don't have a video card, so I can only
Select "screen capture". If you have a video card, select your video card;
6. The broadcast signal must be transmitted through a valid port, so it must be set.
The default port of Windows Media Encoder is 8080, but this port is often occupied by other software,
Therefore, it is recommended that you click "Search for available ports" to replace it with other random ports or directly enter unused ports.
Port used. I have selected port 3170;
7.
Then we start to select the streaming media quality for broadcasting. There is a formula you can refer to: Streaming Media Configuration
File bandwidth × maximum number of connected users = Your upstream bandwidth (not download, upload ). If you have 2 Mbps
Select a configuration file of Kbps to allow 20 viewers to view your broadcast at the same time.
It can be seen that the streaming media service has a huge demand for bandwidth;
8. In this window, you can choose to archive the broadcast streaming media for later viewing or entering
On-line VOD, if it is only used as a live broadcast service and the hard disk space is not large, you can choose not;
9. After "Next", you can choose whether to add the built-in welcome, rest, and goodbye files from Microsoft,
I don't need these things. Who gives free ads to Microsoft;
10. Then, we can add copyright information to our broadcast program,
Will appear in Windows Media Player;
11. After the last confirmation window pops up, our final broadcast interface will appear.
Capture the device, as long as you click "start", our broadcast station will run, as long as you enter
"MMS: // server: port value" will pop up the Media Player video. For example, the broadcast station I set up
The address is "MMS: // 192.168.0.1: 3170". You can also use the connection tag on this interface.
View;
12.
If you have no video capture settings like me or want to play a recorded video to the user, click
"Session-properties" (this panel can be used to adjust all the data that has been set), click the "change" button,
In the pop-up window, select the drop-down box on the right of the video and click "find file" to find the pre-recorded video
Frequency File (supports ASF, WMV, Avi, mpg, and other formats)
);
13. Go back to the broadcast page and click Start. Your file will be viewed by siblings on the network,
To add more files or devices, click "new" next to "change" in the preceding window.
Add;
14. You may think that we have achieved success. In fact, this is far from the most basic.
Live broadcast, we also need to add it to the broadcast service of Windows Media Services to achieve more
Powerful functions. Point your mouse to "start-control panel-management tools-Windows Media
Services, open the Windows Media Manager (2000 server should be a web interface ). Select
On the server on the left, click "add release point (wizard)" in the Operation menu. After the welcome page,
The release point naming window appears. Enter the name you want to use.
"Softicp. com_broadcast ";
15.
In the next window, you will be asked to select the type of the content to be released.
Select "encoder (live stream)". If you want to add other prepared files to the live stream, please
Select "playlist". To create a VOD Server, select "files in the directory ". Because
I have prepared a ready-made file, so I chose "playlist ";
16.
After selecting the type of the published content, we need to select the release solution. We are conducting the network broadcast service,
Of course, select broadcast publishing point ". In the following window, select the content delivery method.
Now, the basic concepts of unicast and multicast described earlier have played a role. Our network is generally not
Supports multicast, so you must select "unicast ";
17.
If you have created a playlist file (wsx or HTM file), select
"Existing playlist". If not, add a new playlist as I did ". Add
In the Add window, you can add files, live streams of encoder, streaming media of remote publishing points, dynamic ASP and CGI
Media sources and other media types. You can also add ad information and adjust the playing sequence of the media;
18. After editing the playlist, click "Next" to save the playlist as a file.
In the next window, you can choose whether to "loop playback" or "unordered playback" streaming media. A few more
In the confirmation box, you have created a Windows Media Streaming Media Broadcast Server.
Remove the check mark before "start other wizard after this wizard is complete!
19. After the server is started, you can enter "MMS: // server" in Windows Media Player.
IP/publish point name "to watch the network broadcast. In the Windows Media Services Manager, we
Monitors streaming media playback at any time, adds/deletes and adjusts the playlist, inserts ads, and publishes announcements.
(You can directly generate an HTM page), adjust the attributes of the broadcast station, and perform other operations at any time through the following
Enable and stop the broadcasting station and test whether the current streaming media is normal;
This figure shows the publishing point announcement page created using the Announcement Wizard. Is it very convenient?
20. You can also enter the manager URL in the browser or directly start the management tool.
"Windows Media Services (Web)" to manage the web of the entire Streaming Media Server and
In addition to a few features, the management interface is almost the same as local management.
Remote Management can also manage multiple servers in a server group.
So far, our Windows Media Network Broadcast Server has been fully built, and you have
Does it feel uncomfortable to have a powerful network broadcast station? Because there are many excellent
The film wants to share it with friends and give them the freedom to watch their favorite programs.
Restrictions on playing schedules? So, come with me, and create another Windows Media
VOD Server.