1

I am currently working on nodejs and socket app that is currently doing 1:1 video conference that is using webrtc. Videos are two separate element in the html and i would like to merge them together so that i can broadcast to rtmp url for public view (2:many). Is this possible

For webrtc, i followed this tutorial https://www.youtube.com/watch?v=DvlyzDZDEq4, and for broadcasting i am using ffmpeg which current does 1 video stream.

Please confirm if this is doable

Update

I was able to merge the video using https://www.npmjs.com/package/video-stream-merger

And now the final issue

i am receiving merger.result which is merged stream and I tried to create a mediaRecorder object. Callback method for MediaRecorder ondataavailable is called only once but not every 250ms which i need to broadcast to youtube. How can i do this?

var merger = new VideoStreamMerger(v_opts);
...
...
merger.start()
myMediaRecorder = new MediaRecorder(merger.result);
myMediaRecorder.start(250);
myMediaRecorder.ondataavailable = function (e) {
    console.log("DataAvailable")
    //socket.emit("binarystream", e.data);
    state = "start";
    //chunks.push(e.data);
}
Asif Alamgir
  • 1,454
  • 1
  • 16
  • 41
  • Hello, maybe you should look at in [Software Engineering](https://softwareengineering.stackexchange.com) and [Software Recommandations](https://softwarerecs.stackexchange.com/). – Amessihel Oct 12 '20 at 16:52
  • @asif-alamgir, Have you found a solution for your problem? I have similar issue as well and it would be great if you share with us. – Just Shadow Jul 13 '21 at 14:32
  • No unfortunately, had to use a third party service @JustShadow – Asif Alamgir Jul 13 '21 at 21:26

1 Answers1

0

So you're looking for many peers. This is possible - please see the below links for reference.

Mavi Domates
  • 4,262
  • 2
  • 26
  • 45