How to send webcam video to rtmp

I am using https://demo.avideo.com/ for live streaming purpose.

I am trying to live stream my web cam This site show option to live stream web cam but experimental.

When I see source code after I press web cam 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

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.

But how to send the web cam video to rtmp server. 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

Thank you

1 answer