media-server

    • Support origin server which streams can be pushed to and played from
    • Support to proxy push/pull requests
    • Support rtmp//hls play
    • Support rtmp push
    • Streams are uniquely determined by
    • Configurable push/pull retry policy
    • Support that eliminates rtmp handshake process
    • Support visual interface(via http) to check the status of the current server/streams
    • Support live streaming
    • Configurable frame queue buffer length(typically several seconds)
    • Support streams for several seconds when no players are watching
    • Support dumping stream status into log for monitoring purpose
    • Support different
    • Support https
    • All features brought by brpc

    Supported operating system: Linux, MacOSX.

    • Install which is the main dependency of media-server
    • Compile media-server with cmake:
    • Run media-server as origin server with minimum configuration(the default port is 8079):

    Then you can push/play stream from it.

    Please run

    to get all configurations in detail.

    • -proxy_lbWhen -proxy_to is a naming service(such as http://…), you need to specify load balancing algorithm. The options are rr, random, la, c_murmurhash and c_md5. Read client load balancing for details.

    • -portSpecifies the service port of media-server. Brpc is characterized by supporting all protocols on the same port, so this port can also be used for accessing the built-in service via http. Only ports in the range of 8000-9000 can be accessed by browsers, which means if the service port is external, be sure to configure -internal_port to prevent built-in service from leaking detailed service information.

    • -retry_interval_msWhen media-server runs in edge mode, push and pull requests to upstreams will be retried when error happens until clients no longer need. This option specifies the minimum interval for continuous retry, which is 1 second by default.

    • -share_publish_connectionWhen set to true, multiple streams connected to the same server will reuse the same rtmp connection in publish.

    • -timeout_msTimeout period for creating a stream when media-server runs in edge mode. The default value is 1000ms.

    • -server_idle_timeoutConnections without data transmission for so many seconds will be closed. The default value is -1(turned off).

    • -cdn_merge_toWhen this option is set, media-server starts two ports, one for external service request and the other for the aggregating request. Usually the aggregating server will be found using consistent hashing, which is used widely in cache service. This option is often used in cdn nodes.

    • -flagfilemedia-server uses gflags options, which is specified by default in the command line and can also in file format during online deployment by using -flagfile.