直播那么火,我也来试试

基于SRS & OBS

SRS 部署

version: '2.1'
services:
  srs:
    image: spanda/srs
    container_name: srs
    volumes:
    - ./log:/opt/objs/tmp
    - ./demo.conf:/opt/objs/conf/http.hls.conf
    network_mode: host
    restart: always
---
demo.conf
listen              1935;
daemon              off;
srs_log_tank        file;
srs_log_file        /opt/objs/tmp/srs.log;
pid /opt/objs/tmp/srs.pid;
max_connections     1000;
http_stream {
    enabled         on;
    listen          28080;
    dir             /opt/objs/nginx/html;
}
stats {
    network         0;
    disk            sda sdb xvda xvdb;
}
vhost __defaultVhost__ {
    hls {
        enabled         on;
        hls_path        /opt/objs/nginx/html;
        hls_fragment    10;
        hls_window      60;
    }
}

相关源码可以参见 dockerfiles/srs

当然也可以基于 nginx啦 dockerfiles/nginx-rtmp

HLS

当然也可以选择其他模式.视频播放主要基于 @DIYgod 大佬的 DPlayer

暂时预览 小熊猫 Tv 验证 hello world.

这里就不详细介绍了.

用 caddy 实现 proxy 转发的.

OBS 设置

设置里选择流类型为自定义, URL: rtmp://10.10.10.1:1935/live/ 流名称 work

END

又水了一篇… 滑稽