Build nginx + rtmp media server notes

Work to build a streaming media server, front-end and pushed it to receive video streams in real time to achieve the purpose of preservation.

Internet has more detailed specific steps that can refer to the following documentation
reference documentation https://www.cnblogs.com/monjeo/p/8492357.html

Note: nginx version of the web site for the best of themselves to download the latest version of OpenSSL else behind and will not make mistakes on

Install some software in advance
yum install gcc gcc-c ++ automake pcre pcre-devel zlip zlib-devel openssl openssl-devel

If ./configure step if prompted ./configure: error:. SSL modules require the OpenSSL library
will ./configure --prefix = / usr / local / src / nginx --add-module = .. / nginx-rtmp-module http_ssl_module---with
--with-http_ssl_module this period of change-openssl = --with /OpenResty/package/openssl-1.1.0e (later changed to address themselves after unpack downloaded openssl address)

Reference Document https://www.cnblogs.com/Guhongying/p/11636369.html

 

Automatically save video stream as a video file
https://blog.csdn.net/u011242657/article/details/79954269

The key nginx configuration
rtmp {
  Server {
    the listen 1935; # listening port
    chunk_size 4000;
    the Application cctvf {#rtmp plug flow request path (remember the wrong path will not push upstream)
    Live ON; # open real-time
    hls on; # turn HLS
    hls_path / usr / local / src / nginx / html / cctvf; #rtmp plug-flow path of the request, file storage path
    hls_fragment 5s; video content file containing each TS # 5 seconds

    Recorder RECl {
      Record All;
      record_unique ON;
      record_path / usr / local / the src / Nginx / HTML / Record;
      record_suffix - M-%%% Y-D-% H_% of M_% S.mp4;

    }


  }

}
May be used for testing streaming service connection rtmp: //172.31.194.26: 1935 / cctvf

Guess you like

Origin www.cnblogs.com/fafa12138/p/12103984.html