조회 수 1975 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

RTMP 1936 HLS 8080

NginX RTMP 에서 아래와 같이 설정하여야한다.

 

nginx.conf

 

 

#user  nobody;
worker_processes  1;

error_log  logs/rtmp_error.log debug;
pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    allow all;
    deny all;

    access_log         logs/rtmp_access.log;
    include           mime.types;
    default_type      application/octet-stream;
    sendfile            on;
    keepalive_timeout      65;
        
    server {
        listen        8080;
        server_name    one2.kr;

    location /rtmp {
    alias F:/mp4;
    #autoindex on;
        }


        # rtmp stat
        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
        
        location /stat.xsl {
            # you can move stat.xsl to a different location
            root html;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

 

    # Client (VLC etc.) can access HLS here.
             location /hls {
                # Serve HLS fragments
                types {
                application/vnd.apple.mpegurl m3u8;
                video/mp2t ts;
                }
            root F:/tmp;
               add_header Cache-Control no-cache;
             }

 

    }

 

}

 

 

 

rtmp {
    server {
        listen 1936;
        chunk_size 8192;

        application live1 {
            live on;
        exec F:\ffmpeg_x64\bin\ffmpeg -i rtmp://one2.kr:1936/hls/nav -strict -2 -b:a 32k  -c:v libx264 -b:v 128K -f flv rtmp://one2.kr:1936/hls/nav;

        }

        application vod {
        play F:/mp4;
        }

# You should send x.264/aac RTMP Stream via ffmpeg to this application
        application hls {
            allow play all;
            live on;
                 hls on;
                   hls_path F:/tmp/hls;
             }

 

    }

 

}

 

윈도우용  FFMpeg가 필요하고 경로 맞게 빨간색 형식으로 지정해준다.

 

F:\tmp폴더를 만들어둔다.

 

rtmp소스를 m3u8 hLS를 위해 트랜스코딩을 해준다.

============================================================================

OBS 설정

사용자지정 주소로 하고

obs1.png

 

와 같이 해준다.

 

 

아래 jwplayer에서는 PC서는 rtmp로 재생. 모바일에서는 Flash재생이안되므로 HTML5재생을 위하여  http로 hls 로재생을 하게된다.

 

소스는 아래와 같이 해준다. 위 nginx rtmp스트리밍주소대로 

<script src="/jwplayer/jwplayer.js"></script>

<div id="mediaplayer2"> </div>
<script>
jwplayer('mediaplayer2').setup({
width: "100%",
androidhls:true,
aspectratio: "16:9",
primary: "flash",
sources:[
{ file: "rtmp://one2.kr:1936/hls/nav" },
{ file: "http://one2.kr:8080/hls/nav.m3u8"}
]
 });
 

 

정리를 하자면 이와같다.

 

1. FFMpeg 구비 하여 Nginx로 포팅 (FFMpeg 트랜스위한 임시폴더 생성마련.)

2. NginX RTMP로 웹및 rtmp서버구동

3. OBS에서 NginX서버로 방송송출

4. 유저는 웹, 모바일로 시청

 

rtmp는 5초정도 딜레이. hls는 트랜스코딩때문인지 20~30초 정도 딜레이

 

?

  1. No Image 16Dec
    by 행복아이
    2019/12/16 by 행복아이
    Views 1008 

    ee

  2. No Image 18Jun
    by 행복아이
    2019/06/18 by 행복아이
    Views 712 

    test

  3. No Image 05Feb
    by 행복아이
    2016/02/05 by 행복아이
    Views 8177 

    유튜브 영상 삽입방법

  4. No Image 27Oct
    by 행복아이
    2015/10/27 by 행복아이
    Views 6793 

    모나서버

  5. No Image 12Oct
    by 행복아이
    2015/10/12 by 행복아이
    Views 6215 

    flowplayer 6.0.3 html5

  6. No Image 12Oct
    by 행복아이
    2015/10/12 by 행복아이
    Views 6529 

    videojs

  7. No Image 27Aug
    by 행복아이
    2015/08/27 by 행복아이
    Views 8157 

    윈도우7 wimboot 테스트

  8. No Image 31Jul
    by 행복아이
    2015/07/31 by 행복아이
    Views 433 

    videojs HLS 2

  9. No Image 31Jul
    by 행복아이
    2015/07/31 by 행복아이
    Views 653 

    videoJS HLS

  10. No Image 31Jul
    by 행복아이
    2015/07/31 by 행복아이
    Views 263 

    RTMP HLS2 1935 실시간

  11. OBS RTMP 웹 HLS모바일 생방송 테스트

  12. No Image 15Jan
    by 행복아이
    2015/01/15 by 행복아이
    Views 269 

    스마트폰 녹화 mp4테스트

  13. No Image 15Jan
    by 행복아이
    2015/01/15 by 행복아이
    Views 280 

    HLS테스트

  14. No Image 15Oct
    by 행복아이
    2014/10/15 by 행복아이
    Views 1800 

    유튜브 라이브 테스트

  15. No Image 14Oct
    by 행복아이
    2014/10/14 by 행복아이
    Views 248 

    dddd

  16. No Image 12Sep
    by 행복아이
    2014/09/12 by 행복아이
    Views 310 

    HTML5 Flash RTMP에 대한 생각

  17. No Image 11Sep
    by 행복아이
    2014/09/11 by 행복아이
    Views 261 

    video-js 3

  18. No Image 11Sep
    by 행복아이
    2014/09/11 by 행복아이
    Views 263 

    Media Element.js

  19. No Image 06Sep
    by 행복아이
    2014/09/06 by 행복아이
    Views 389 

    flow rtmp ums 0.3.0 서버

  20. No Image 05Sep
    by 행복아이
    2014/09/05 by 행복아이
    Views 286 

    flow http HTML5

Board Pagination Prev 1 2 Next
/ 2