How to Set Up A Streaming Media Server

Source: Internet
Author: User
Tags format definition microsoft website

I. Preface

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,

Streaming media, which is closely related to it, has become a hot topic for many people to talk about, because streaming media is the technical driving force behind 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 inherently technical insufficiency, so that they have encountered many obstacles when building such a site, so they have to 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 volume of multimedia information, it usually takes several minutes or hours to download a multimedia file, this results in a video that does not know the content. The download may take longer than the whole video. These downloaded files must be created before being downloaded and placed on the network server. The direct consequence is that the network bandwidth is constantly increasing and people are waiting for less and less download, however, you still cannot watch the live video on the Internet.

During stream transmission, audio, video, animation, and other multimedia information are continuously and in real time transmitted by the Streaming Media Server to the user's computer. It first creates a buffer zone on the user's computer, you do not have to wait until the entire file is downloaded. Instead, you only need to wait several seconds or dozens of seconds to watch the video. When multimedia information is played on the client, the remaining part of the file will be downloaded from the server in the background. If the network connection speed is less than the speed required by the playing multimedia information, the playing program will use the data in a small buffer area previously established to avoid playing interruption and maintain the playing quality.

In addition to sending completed files, streaming transmission can also collect on-site audio and video in real time by collecting servers, push them to the Streaming Media Server, and provide them to users in real time. Therefore, in addition to the multimedia on-demand services such as downloading, streaming media can be used in live broadcast, television broadcasting, emergency reporting, 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 perfect place for system integrators to compete. In the general market, there are three main competing companies: Microsoft, RealNetworks, and Apple. The corresponding products are Windows Media, Real Media, and QuickTime. Recently, Nullsoft, a famous Winamp developer, has added video support to its MP3 server, and wants to share it with the streaming media market.

Because Apple's servers and Editing Software generally use Mac as the operating platform, Nullsoft's streaming media servers are immature transactions, so here I will introduce Microsoft and RealNetworks products.

Streaming media transmission protocol

When you watch online movies or TVs, you usually notice that the connections to these files are not starting with HTTP or FTP, but starting with RTSP or MMS. Why? In fact, like HTTP and FTP, these are both network-based data transmission protocols, but they are dedicated to stream media transmission. Next, let's take a look at the main streaming media protocols currently used:

1. RTSP (Real Time Streaming Protocol), a real-time Streaming Media protocol proposed by RealNetworks and Netscape, is now used in RealNetworks Real Media Products;

2. PNM (progressive networks audio), which is also a real-time transmission protocol. It generally uses UDP protocol and occupies port 7070, however, when your server is in the firewall and port 7070 is blocked, and your server sets the smartingnetwork to true, the HTTP protocol is used and the default port 80 is used;

3. MMS (Microsoft Media Server Protocol) is Microsoft's Streaming Media Server protocol. 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 most cases, QuickTime uses the HTTP protocol, but in fact it is also based on the standard streaming media transmission protocol, which is the standard RTSP protocol, and real uses its own RTSP developed.

In streaming media transmission, the standard protocols are RTP (Real Time Transport Protocol) and RTCP (Real-time transport control protocol) RTSP (Real Time Streaming Protocol) and RSVP (Resource Reserve Protocol) are both researched and developed based on these protocols, we will not discuss it further here.

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 real-time network transmission. What compression algorithm is used for streaming media files?

If you are using a Windows operating system, you can see that when you watch online streaming programs, their suffixes are RM, ASF, and WMV. These are the formats of streaming media. The streaming media file format is specially encoded. It not only adopts a high compression ratio, but also adds a lot of control information, making it suitable for downloading and playing on the network, rather than waiting for the download of a complete file to play.

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 is slightly different from ASF files. wmv generally uses window media video/audio format, the ASF video section generally uses Microsoft mpg4 V (3/2/1 ?), The audio part is Windows Media Audio v2/1. However, many production software have not separated them, so you can directly change the suffix to convert them into the other format.

The created streaming media files must be published on the network to be used by others. Therefore, the compressed streaming media files must be arranged in a specific way, and the format of the streaming media files must be 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, only because it can achieve the approximate quality of video and audio effect under the large compression ratio, this is why many friends think the MPEG-4 format is definitely clearer than RM. But in fact this is not the case, MPEG-4 is just a video encoding technology, its clarity also varies greatly according to the bit rate selected during compression (the MPEG-4 format file we see is usually generated for kbps compression, of course, high quality), and, MPEG-4 also has a variety of compression standards, such as Microsoft's ASF video part is based on the MPEG-4 of discrete cosine transform (DCT), and DivX free MPEG-4 version (beginning to crack the Microsoft format ). Microsoft uses Windows Media Audio v2/1 and DivX uses MP3 or higher quality ac3. In contrast, the real or apple format uses self-developed encoding, in the same bit rate, especially low bit rate, not necessarily worse than the MPEG-4, the RM format with a high bit rate is still clear and human-friendly, so we will say that the concept of RM format definition difference should be changed later :), at least the conditions should be added. In addition, the real video 9 in the latest Helix producer adopts the VP5 compression format for encoding, which is much better than DivX!

However, the Streaming Media Server began to close to the MPEG-4 format is an indisputable fact, real's latest Helix began to support MP4 format file service, and RealOne Player is only the installation of a plug-in to achieve the MPEG-4 format of playback.

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. In the VOD connection, you can select a content item to initialize the client connection, A client receives a media stream from the server (this connection is unique and cannot be occupied by other users) and can start, stop, back, fast forward, or pause a media stream, the client has control over the stream, just like watching a video disk. In this way, because each client connects to the server, the server needs to establish a connection for each user, which requires a large amount of server resources and network bandwidth.

Broadcast refers to the passive receiving of streams by users. In the broadcast process, the client receives a stream but does not control the flow. the user cannot pause, fast forward, or backward the stream. The data sending methods used by the broadcast include unicast and broadcast. When unicast transmission is used, the server needs to copy multiple copies of the data packet and send them to the users who need it in multiple point-to-point ways. Broadcast Transmission is used, A separate copy of the data packet will be sent to all users on the network. Regardless of whether the user needs it or not, the above two transmission modes will waste network bandwidth and server resources, therefore, multicast technology is introduced.

Multicast absorbs the strengths of the two sending methods, overcomes the weaknesses of the two sending methods, and sends a separate copy of the data packet to the customers who need it, multicast does not copy multiple copies of data packets to the network, nor send data packets to customers who do not need them. This ensures that multimedia applications on the network occupy the minimum bandwidth of the network. However, multicast not only requires server support, but also supports multicast routers and the entire network structure.

Unicast and Multicast)

We have learned some concepts about unicast and multicast, which is one of the focuses of streaming media. In my understanding, on-demand broadcast and broadcast are a group of concepts, and they interact with the client media. unicast and multicast are another group of concepts, they are the transmission methods of streaming media data on the server and on the network.

For unicast transmission, a separate data channel must be established between the client and the Media Server. Each packet sent from one server can only be transmitted to one client, each user must send a separate query to the Media Server, and the server must send the requested data packet copy to each user. This huge redundancy will cause heavy load on servers and network bandwidth, and the response may take a long time, or even cause service failure. Unicast can be used for VOD and broadcast.

When multicast is sent, the server sends a set of streaming media data requested by the customer to a vro supporting Multicast technology. Then, the vro copies the data packets to multiple channels according to the route table at a time, then send it to the user. At this time, the Media Server only needs to send an information package. All clients sending requests share the same information package and the information can be sent to clients with any address. clients without requests will not receive the information package, 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. However, multicast also has its own characteristics. First, you must start a vro that supports multicast technology. In addition, generally, it can only be used for broadcast, because on-demand broadcast may cause user control problems.

Well, if you say so much, you may be tired of me, so let's start our journey of setting up a Streaming Media Server.

Iii. Prepare the streaming media server hardware

Streaming Media Servers, like Web servers, must be accessed by many people at the same time. Compared with Web servers, because multimedia files require stronger processing capabilities, its hardware equipment should go beyond the servers generally used for web. 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 not be able to perform any other operations when being accessed by multiple users (I believe you may have some experience with those on-demand online video-on-demand websites, we are building the same server as they are, but the size is smaller ).
Large Memory and hard disk capacity. The production and transmission of streaming media is the black hole of system resources, and large memory capacity is the prerequisite for stable system operation. streaming media files are large in size and require more storage space for a large number of media files. 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 has a great impact on the quality of recordings (for online live broadcast). We recommend that you use the SB live of creative! OR Sb audigy, audigy 2 series, because the author's own machine is not a server (only used to do the article, there is no money to upgrade AH), so only the general integration for demonstration.
Good video capturing device. Our live video program comes from this device. We recommend that you use the winfast tv2000 XP deluxe edition of leadtek, both the ability to receive signals and the ability to compress hardware are outstanding (because I have no conditions, the acquisition device uses screen capture, but the method of using the collection device 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 limit the number of connections on the Streaming Media Server to avoid being a machine.

Of course, the above is a hardware device necessary to build a streaming media service website. If it is just like the author, I just want to learn how to set up a Streaming Media Server, big data can be boldly tested on the basis of existing machines.

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 divided it into Microsoft's Windows Media and RealNetworks's real media, both of which included the establishment of live broadcast and On-Demand Server, at last, I would like to introduce Apple's QuickTime and Nullsoft streaming media servers.

Because Microsoft's Windows Media on-demand service must be built on the server operating system, I chose Windows. NET Enterprise Server 3647 as the system platform established by the Streaming Media Server. To compare the advantages and disadvantages of RealNetworks and Microsoft's latest streaming media servers, I have adopted their latest streaming media systems. The following are 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 (because the software is in.. NET Server is not running normally, so it is installed in XP and only this software is installed 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, and 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. However, with the help of Windows Media Services, the streaming media files produced by Windows Media Encoder will provide more powerful functions for our online broadcast sites. Next, we will use Windows Media Encoder to create a separate broadcast station and incorporate it into Windows Media Services for more powerful functions.

1. Install Windows Media Services.

First install Windows 2000 Server or windows. NET Server, choose Start> Control Panel> Administrative Tools> Manage Your servers, or choose Start> Control Panel> add or delete Programs> Add/delete Windows Components. (the second method is recommended), check "Web Application Server", that is, the IIS server in 2000 Server, and click "Next" to add the server;

After IIS is added, start the Add/delete Windows component program again, check the windows media service items, and click details, select "Windows Media Services administrator for Web" to enable Web management for Windows Media Services. (These options may not exist in 2000. 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 under. NET Server) for installation. Now, the server and Encoder of Windows Media Service are ready;

3. start Windows Media Encoder from "start-Program-Windows Media" and select the appropriate option based on your needs in the displayed wizard interface, we recommend that you select "broadcast, capture, or convert files in the new session wizard" and click OK;

4. because broadcast is performed, select "broadcast live events on the accessory device or computer screen" in the next pop-up screen ", this option enables Windows Media Encoder to broadcast directly or add it to the Windows Media Service;

5. Select a video or audio capture device from the next screen. If you do not have a video card, 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. 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 upstream bandwidth and select a configuration file of kbps, 20 viewers can view your broadcast at the same time. This shows that streaming media has a huge demand for bandwidth;

8. In this window, you can choose to archive the broadcast streaming media for later watching or on-demand video. 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 items. Who will advertise Microsoft for free;

10. Then, we can add copyright information to our broadcast program, which will appear in Windows Media Player during playback;

11. after the last confirmation window is displayed, our final broadcast interface appears. If a video capturing device exists, click Start to start the broadcast station, if you enter "MMS: // server: port value" in client ie, the Media Player video is displayed. For example, if the address of the broadcast station I created is "MMS: // 192.168.0.1: 3170", you can view the information directly in the connection tag on this interface;

12. if you do not have video capture settings like me, or you want to play a recorded video to a user, click "session-properties" (this panel can be used to adjust all set data), click the "change" button, and select the drop-down box on the right of the video in the pop-up window, click "find file" to find the pre-recorded video file (supported formats include ASF, WMV, Avi, and MPG );

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;

14. you may think that we have achieved success. In fact, it is far from enough. This is just 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" and open Windows Media Manager (2000 server should be a web interface ). Select the server on the left and click "add release point (wizard)" in the Action menu. After the welcome page, the publishing point naming window appears. Enter your desired name, I entered "softicp. com_broadcast ";

15. in the next window, you will be asked to select the content type you want to publish. If you only want to live streaming media, select "encoder (live stream )", if you want to add other prepared files to the live stream, select "playlist". If you want to create a VOD Server, select "files in the directory ". Because I have prepared a ready-made file, 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, and of course we need to select the broadcast release point ". In the following window, We will select the content transfer method. Now, we can see that the basic concepts of unicast and multicast described earlier have played a role, generally, our network does not support multicast, so we need to select "unicast ";

17. if you have created a playlist file (wsx or HTM file), select "existing playlist" in the next window, "Create a playlist and add it ". In the Add window, you can add files, live streams of encoder, streaming media of remote publishing points, dynamic sources of ASP and CGI, and other media, 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. After several confirmation boxes, you have completed the establishment of the Windows Media Streaming Media Broadcast Server. For the sake of convenience, we will remove the check in front of "start other wizard after completing this wizard!

19. After the server is started, you can enter "MMS: // server IP Address/release point name" in Windows Media Player to watch the network broadcast. In the Windows Media Services Manager, we can monitor the playing status of streaming media at any time, add/delete and adjust the playback list, insert ads, and publish announcements (HTM pages can be generated directly), adjust the attributes of the broadcast station, and can start and stop the broadcast station at any time through the button below, 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 your browser or directly start "Windows Media Services (Web)" in the management tool to manage the web and remote management of the Streaming Media Server, the management interface is similar to local management except for a few functions.

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 already have a powerful network broadcast station, do you think it is not fun? Because there are still many excellent films that you want to share with your friends and want them to watch their favorite programs freely, not limited by your broadcast schedule? Then, come with me and we will build another Windows Media on-demand video server.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.