조회 수 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 05Feb
    by 행복아이
    2016/02/05 by 행복아이
    Views 8191 

    유튜브 영상 삽입방법

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

    윈도우7 wimboot 테스트

  3. No Image 27Oct
    by 행복아이
    2015/10/27 by 행복아이
    Views 6808 

    모나서버

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

    videojs

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

    flowplayer 6.0.3 html5

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

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

    유튜브 라이브 테스트

  8. No Image 16Dec
    by 행복아이
    2019/12/16 by 행복아이
    Views 1023 

    ee

  9. No Image 18Jun
    by 행복아이
    2019/06/18 by 행복아이
    Views 728 

    test

  10. No Image 04Sep
    by 행복아이
    2014/09/04 by 행복아이
    Views 678 

    flowplayer+ums RTMP 서브폴더

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

    videoJS HLS

  12. No Image 04Sep
    by 행복아이
    2014/09/04 by 행복아이
    Views 472 

    JWPlayer6 RTMP FLASH HTML5

  13. No Image 26Aug
    by 행복아이
    2014/08/26 by 행복아이
    Views 462 

    mp4 1080 flowplayer

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

    videojs HLS 2

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

    flow rtmp ums 0.3.0 서버

  16. No Image 04Sep
    by 행복아이
    2014/09/04 by 행복아이
    Views 359 

    jw HTML5 flash 테스트

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

    HTML5 Flash RTMP에 대한 생각

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

    flow http HTML5

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

    HLS테스트

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

    스마트폰 녹화 mp4테스트

Board Pagination Prev 1 2 Next
/ 2