静看光阴荏苒
不管不顾不问不说也不念

OpenStreamingPlatform:一个开源的视频直播平台

OpenStreamingPlatform是一个开源的视频直播平台,可以用来搭建自己的直播网站。

功能方面还是挺全的,视频上传/直播/录制/聊天/用户控制/后台面板等等都有,唯一的不足就是我觉得UI好丑。。

手动部署方法可以看官方的文档:

https://gitlab.com/Deamos/flask-nginx-rtmp-manager

下面使用docker来部署这个项目。

安装docker:

apt -y update
apt -y install curl
curl -sSL https://get.docker.com/ | sh
systemctl start docker
systemctl enable docker

安装docker-compose:

curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

创建两个目录:

mkdir -p /opt/traefik
mkdir -p /opt/stream

创建acme.json:

touch /opt/traefik/acme.json && chmod 600 /opt/traefik/acme.json

新建traefik的traefik.toml

nano /opt/traefik/traefik.toml

写入如下配置:

defaultEntryPoints = ["https","http"]

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect]
    entryPoint = "https"
  [entryPoints.https]
  address = ":443"
  [entryPoints.https.tls]

[acme]
email = "example@qq.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"

注:替换邮箱example@qq.com为你自己的。

新建traefik的docker-compose:

nano /opt/traefik/docker-compose.yml

写入如下配置:

version: '3.5'

services:
    reverse-proxy:
      container_name: traefik
      image: traefik:v1.7
      command: --api --docker
      ports:
        - "80:80"
        - "443:443"
        - "8080:8080"
      networks:
        - traefik
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
        - /opt/traefik/traefik.toml:/traefik.toml
        - /opt/traefik/acme.json:/acme.json

networks:
    traefik:
      name: imlala

新建openstreamingplatform的docker-compose:

nano /opt/stream/docker-compose.yml

写入如下配置:

version: '3.5'

services: 
    openstram:
        container_name: openstream
        image: deamos/openstreamingplatform:latest
        ports:
            - 1935:1935
        environment: 
            - REDIS_HOST=redis-osp
            - FLASK_SECRET=""
            - FLASK_SALT=""
            - OSP_REQUIREVERIFICATION=False
            - OSP_ALLOWREGISTRATION=False
        labels: 
            - "traefik.frontend.rule=Host:stream.233.fi"
        volumes: 
            - ./data:/var/www
            - ./db:/opt/osp/db 
    redis-osp:
        container_name: redis
        image: redis

networks:
    default:
        external:
            name: imlala

注:

1.FLASK_SECRET/FLASK_SALT自己随便填写一点随机字符。

2.OSP_REQUIREVERIFICATION是关闭注册,如果需要注册功能去掉这行env。

3.OSP_ALLOWREGISTRATION是关闭注册用户邮箱验证,如果打开的话需要配置SMTP服务,为方便建议关掉。

4.stream.233.fi的域名替换为你自己的。

最后进到这两个项目目录up起来即可:

docker-compose up -d

关于直播设置,首先要创建频道和直播key。

登录进去右上角点你的账户头像-My Channels-Create Channel

创建完成之后点下拉菜单-齿轮按钮,往下翻会有一个Stream Key。

OBS流设置如下图,rtsp/rtmp都可以:

测试:

赞(2)
未经允许不得转载:荒岛 » OpenStreamingPlatform:一个开源的视频直播平台
分享到: 更多 (0)

评论 17

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    大佬,发现有人抄你教程,连图片水印都没去……
    ensu.cc/archives/901
    他博客内好多文章都是你写过的

    locd4年前 (2020-02-13) Google Chrome 79.0.3945.130 Google Chrome 79.0.3945.130 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 那咋办嘛

      LALA4年前 (2020-02-13) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 大佬 我帮你提醒原作者了 今天我看已经更改并注明出处了 并且邮件回复还道歉了 :oops:

        feidao1584年前 (2020-03-11) Google Chrome 80.0.3987.132 Google Chrome 80.0.3987.132 Windows 10 x64 Edition Windows 10 x64 Edition回复
        • 好的谢谢。

          LALA4年前 (2020-03-14) Google Chrome 80.0.3987.87 Google Chrome 80.0.3987.87 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    按照教程配置完之后,打开网页提示: :razz: 404 page not found

    yaya4年前 (2020-02-14) Google Chrome 80.0.3987.100 Google Chrome 80.0.3987.100 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 原来是我机器性能太差了。。。。。。这个很吃机器配置。。最少要2C2G,惹不起 :cry:

      yaya4年前 (2020-02-17) Google Chrome 80.0.3987.106 Google Chrome 80.0.3987.106 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • 这个还好1G内存可以跑起来的。

        LALA4年前 (2020-02-17) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
  3. #3

    按照配置完成后, 打开网站提示拒绝连接什么情况…
    用的Ubuntu 18.10, 防火墙已关.

    Never.4年前 (2020-02-21) Google Chrome 79.0.3945.130 Google Chrome 79.0.3945.130 Windows 10 x64 Edition Windows 10 x64 Edition回复
  4. #4

    看了下lala最近喜欢docker啊,写了好几篇都是关于docker的文章

    Cyril Wong4年前 (2020-02-28) Google Chrome 80.0.3987.122 Google Chrome 80.0.3987.122 Windows 10 x64 Edition Windows 10 x64 Edition回复
    • 随大流,以后docker是趋势。。

      LALA4年前 (2020-02-29) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
  5. #5

    啦啦一个新的机子2G内存的,按照你的教程装,在traefik那个地方证书老是出错
    Cannot issue for \”reverse-proxy.traefik\”: Domain name does not end with a valid public suffix (TLD), url:

    飞扬的旋律4年前 (2020-04-26) Chromium 80.0.3987.163 Chromium 80.0.3987.163 Ubuntu x64 Ubuntu x64回复
    • 我把机子从ubuntu换成debian成功了…

      飞扬的旋律4年前 (2020-04-26) Chromium 80.0.3987.163 Chromium 80.0.3987.163 Ubuntu x64 Ubuntu x64回复
      • 可能遇到玄学问题了,哈哈。

        LALA4年前 (2020-04-27) Google Chrome 80.0.3987.163 Google Chrome 80.0.3987.163 Windows 10 x64 Edition Windows 10 x64 Edition回复
  6. #6

    求更新教程,纯小白..想自己搭一个

    Ne5个月前 (10-19) Google Chrome 117.0.0.0 Google Chrome 117.0.0.0 Mac OS X  10.15.7 Mac OS X 10.15.7回复

分享创造快乐

广告合作资源投稿