从obs流到Nginx

时间:2019-01-16 20:10:16

标签: nginx video.js rtmp obs

我正在尝试从obs流式传输到nginx服务器。我正在使用videojs作为播放器。在OBS设置中,我使用的是自定义流服务器,URL为rtmp:// localhost / live。这是nginx的配置文件:

rtmp {
        server {
                listen 1935;
                chunk_size 4096;

                application live {
                        live on;
                        record off;                     
                }
        }
}

这是html部分:

<video id="player" class="video-js vjs-default-skin" height="360" width="640" controls autoplay preload="none">
    <source src="rtmp://localhost/live" type="rtmp/mp4" />
</video>

1 个答案:

答案 0 :(得分:0)

https://github.com/DigiSkyOps/knife 这是一个obs流服务器

nginx / config

    rtmp {
  server {
    listen 1935;
    chunk_size 4000;
    application live {
      live on;
    }
    application hls {
        live on;
        hls on;
        hls_path /data/hls;
        hls_fragment 5s;
        hls_playlist_length 10s;
        hls_continuous on;
        hls_cleanup on;
        hls_nested on;
      }
    }
  }