简体   繁体   English

如何将网络摄像头视频发送到 rtmp

[英]How to send webcam video to rtmp

I am using https://demo.avideo.com/ for live streaming purpose.我正在使用https://demo.avideo.com/进行直播。

I am trying to live stream my web cam This site show option to live stream web cam but experimental.我正在尝试生活 stream 我的 web cam 这个网站显示选项生活 stream Z2567A5403705EB7AC2E.

When I see source code after I press web cam stream.当我按下 web 凸轮 stream 后看到源代码时。

swfobject.embedSWF("<?php echo $global['webSiteRootURL']; ?>plugin/Live/view/webcam.swf", "webcam", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

Similar to this Streaming Webcam RTMP support类似于此Streaming Webcam RTMP 支持

Now I am trying to implement with现在我正在尝试用

getUserMedia获取用户媒体

if (navigator.mediaDevices.getUserMedia) {
  navigator.mediaDevices.getUserMedia({ video: true })
    .then(function (stream) {
      video.srcObject = stream;
    })
    .catch(function (err0r) {
      console.log("Something went wrong!");
    });
}

Web cam is asking for permission to access. Web cam 正在请求访问权限。

But how to send the web cam video to rtmp server.但是如何将 web cam 视频发送到 rtmp 服务器。 Is there any way?有什么办法吗? Or Are there any other option to implement this.或者是否有任何其他选项可以实现这一点。

Note: I used https://obsproject.com/ for send to rtmp server It's working fine with web cams, screen sharing, videos and all注意:我使用https://obsproject.com/发送到 rtmp 服务器它与 web 摄像头、屏幕共享、视频和所有工作正常

Thank you谢谢

WebCam -> RTMP is not possible in the browser directly. WebCam -> RTMP不能直接在浏览器中使用。 You will need to send video to a backend, and then bridge to RTMP.您需要将视频发送到后端,然后桥接到 RTMP。

I shared an existing solution here https://stackoverflow.com/a/61008559/5472819我在这里分享了一个现有的解决方案https://stackoverflow.com/a/61008559/5472819

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM