nginx, rtmp 스 트림 미디어 서버 구축

2293 단어
  • PCRE 를 다운로드 하고 설치 합 니 다.
  •          : ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
    
  • 압축 풀기 tar - xzvf pcre - 8.40. tar. gz
  •      cd pcre-8.40
         make, make install (if not the root user, please use the sudo)
    
  • OpenSSL 설치
  •      sudo apt-get install libssl-dev
    
  • nginx 와 nginx rtmp 모듈 다운로드
  • 1:    tar -zxvf nginx-1.10.0.tar.gz
           http://nginx.org/download/nginx-1.10.0.tar.gz
           git clone https://github.com/arut/nginx-rtmp-module
    2:   nginx     
           cd  nginx-1.10.0
           ./configure --add-module=/.../nginx-rtmp-module
           make
           make install
    
  • nginx 시작
  •       nginx        /usr/local/nginx
          sbin    nginx       ,    sudo ./nginx
            80     :
    
          sudo fuser -k 80/tcp
          And then try restarting nginx again:
          service nginx start
    
  • 조회
  •      /usr/local/nginx/sbin$ ps -ef | grep nginx
            root      1394  1474  0 18:11 ?        00:00:00 nginx: master process ./nginx
            nobody    1395  1394  0 18:11 ?        00:00:00 nginx: worker process
             1570  1027  0 18:22 pts/32   00:00:00 grep --color=auto nginx
    
  • 브 라 우 저 에 입력http://localhost/ nginx 의 첫 페이지 를 볼 수 있 습 니 다.http://172.17.6.96)
  • Welcome to nginx!
    If you see this page, the nginx web server is successfully installed and
    working. Further configuration is required.
    For online documentation and support please refer to
    nginx.org.
    Commercial support is available at
    nginx.com.
    Thank you for using nginx.
    
  • rtmp 지원 sudo vi conf / nginx. conf
  • 추가
    rtmp {
         server {
             listen 1935;
             application live {
                 live on;
                 record off;
             }
         }
     }
    

    9, 다시 시작 nginx
         cd /usr/local/nginx
         sudo ./sbin/nginx -t
         sudo ./sbin/nginx -s reload
    
  • 테스트 소스 를 추가 하여 서버 로 전송
  •  ffmpeg -re -i "http://pull3.a8.com/live/1494925686330748.flv" -c copy -f flv rtmp://172.17.6.96:1935/live/gongjia
    
  • vlc 를 사용 하여 랜 기계 에서 rtmp 테스트 흐름 을 엽 니 다
  • rtmp://172.17.6.96:1935/live/gongjia
    

    좋은 웹페이지 즐겨찾기