Introduction and construction of Crtmpserver streaming media server

Source: Internet
Author: User

Preface

Adobe's FMS (Flash Media Server) is very useful. But it is the money and limited functionality that are available for hierarchical authorization. Since we can't afford to use commercial things and hinder our technological progress, we can only resort to the open source community. And Crtmpserver is one of the alternatives to FMS.


1. Crtmpserver Introduction

Crtmpserver's function is always:

    • Supports the distribution of the receive and player requests for the rtmp stream that is pushed to it;

    • The construction of a tree-like network cluster for rtmp streaming media server;

    • Support Iphone,android.

The following is the homepage of the official website function and application introduction (http://www.rtmpd.com/)

Crtmpserver It is a high performance streaming server able to stream (live or recorded) in the following technologies:

    • To and from Flash (Rtmp,rtmpe, Rtmps, Rtmpt, Rtmpte)

    • To and from embedded Devices:iphone, Android

    • From surveillance cameras

    • Ip-tv using Mpeg-ts and RTSP/RTCP/RTP protocols

Also, Crtmpserver can be used as a high performance rendes-vous server. For example, it enables the do:

    • Audio/video Conferencing

    • Online Gaming

    • Online collaboration

    • Simple/complex Chat Applications

2. Crtmpserver Streaming media server (Linux platform)

Its compilation and build environment requires some Linux tools to be installed first

Installation of 2.1 CMake

Download the latest cmake (http://www.cmake.org/).

    1. #tar -zxvf cmake-2. 8. 7. Tar. Gz

    2. #cd cmake-2. 8. 7

    3. #. /Bootstrap

    4. #gmake

    5. #make Install

Installation of 2.2 OpenSSL

Download openssl-0.9.8 version (Crtmpserver only support this version, I use the openssl-0.9.8t. http://www.openssl.org/)

    1. #tar -zxvf OpenSSL-0. 9. 8t. Tar. Gz

    2. #cd OpenSSL-0. 9. 8t

    3. #. / Configure

    4. #make .

    5. #make Install

Compilation and installation of 2.3 crtmpserver

  1. #svn Co --Username anonymous--password "" HTTPS:/ /svn. RTMPD. COM/crtmpserver/branches/1. 0 Crtmpserver

  2. #cd Crtmpserver

  3. #sh . /cleanup. Sh

  4. #cd Builders/CMake

  5. #cmake .

  6. #make

  7. #. /crtmpserver/crtmpserver. /crtmpserver/crtmpserver. Lua

Note:

A. If make succeeds, the last line of command is "./Crtmpserver/Crtmpserver.Lua"starts the Crtmpserver service for the configuration script."

B. The directory for the last line of commands is under "Builders/cmake".


2.4 Receiving and distributing the test flow

After the last line of commands is executed, you can see the services started and the corresponding ports under the default script configuration. The "RTMP" protocol corresponds to the "1935" Port.

As shown below:

--- --------------- ----- ------------------------- -------------------------

|tcp|       0.0.0.0 |1935|            inboundrtmp | appselector|

--- --------------- ----- ------------------------- -------------------------

Push:

You can use Adobe's Fmle (Flash Media Live Encoder) to push rtmp streams to this server. There will be a corresponding log message when successful.

You can also use FFmpeg Push the rtmp stream to this server. There will be a corresponding log message when successful. Note, however, that FFmpeg pushes the rtmp stream to make sure that it uses "librtmp" to succeed. Using the FFmpeg to bring the rtmp push will cause a failure. The reason should be that FFmpeg's own rtmp program is incomplete, unable to parse the second handshake when the service sent packet information.

Watch:

After the push is successful, the client can see the program you pushed with the Flash Player or the player that can play the rtmp stream (such as http://flv-player.us/index_mdv.php).

You can also use the software like Rtmpdump to record rtmp streams as files.

3. Simple configuration changes

    Sometimes the server restricts certain ports, so you need to specify the ports yourself, such as "80" ports. This requirement can be modified by modifying its configuration script " crtmpserver / crtmpserver lua "

      "rtmp" service to add "80" port, you can give " crtmpserver / crtmpserver lua "

  1. Default=true,

  2. acceptors =

  3. {

  4. {

  5. IP="0.0.0.0",

  6. Port=.

  7. Protocol="inboundrtmp"

  8. },

  9. {

  10. IP="0.0.0.0",

  11. Port=1935,

  12. Protocol="inboundrtmp"

  13. },

  14. . . .

  15. }

  16. }

Restart the service to see the port in effect, you can receive the rtmp stream from "80".


Introduction and construction of Crtmpserver streaming media 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.