Giter Club home page Giter Club logo

srs-webrtc-jitsi's Introduction

为了实现这个功能,我们需要做以下几个步骤:

  1. 安装和配置SRS。我们可以从SRS的GitHub仓库中下载源码,并按照文档进行编译和安装。我们需要启用WebRTC模块,并配置好相关的参数,比如端口、证书、信令地址等。

  2. 推送RTMP流到SRS。我们可以使用任何能够产生RTMP流的工具或设备,比如OBS、FFmpeg、摄像头等,把RTMP流推送到SRS的指定地址。例如,我们可以使用FFmpeg命令: bash ffmpeg -re -i input.mp4 -c copy -f flv rtmp://localhost/live/stream

  3. 在浏览器中播放WebRTC流。我们可以使用SRS提供的WebRTC播放器,输入SRS的信令地址和流名称,就可以在浏览器中观看WebRTC流。例如,我们可以访问:

https://localhost:1985/webrtc/index.html?autostart=true&server=ws://localhost:1985/rtmp/ws&stream=live/stream
  1. 接入到Jitsi-meet中。我们可以利用Jitsi-meet的API,把WebRTC播放器嵌入到Jitsi-meet的会议界面中,作为一个共享屏幕的源。我们需要修改Jitsi-meet的源码,添加一个按钮或菜单,让用户可以输入SRS的信令地址和流名称,并创建一个iframe元素,加载WebRTC播放器。例如,我们可以在Jitsi-meet的代码中添加以下代码:
// 创建一个iframe元素
var iframe = document.createElement("iframe");
// 设置iframe的属性
iframe.setAttribute("src", "https://localhost:1985/webrtc/index.html?autostart=true&server=ws://localhost:1985/rtmp/ws&stream=live/stream");
iframe.setAttribute("width", "640");
iframe.setAttribute("height", "360");
iframe.setAttribute("allow", "camera; microphone");
// 把iframe添加到会议界面中
document.getElementById("largeVideoContainer").appendChild(iframe);

这样,我们就可以在Jitsi-meet中看到RTMP流的画面,并与其他参会者进行视频会议。


然而这种方案并不好用,加载慢,容易断线,容易卡住,容易暂停等不方便使用的问题.
另外一种办法:  rtmp-webrtc-chrome-libjs-jitsi
这种办法是通过Server端 headless的方式实现. 可以做到很高的清晰度,也很低的时延,同时不容易出现意外情况.
缺点: cpu的占用太高, 原理跟jibri一致.

srs-webrtc-jitsi's People

Contributors

zsinba avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.