I need to broadcast room videos/audios to some external broadcasting provider like youtube with rtmp/rtsp. Is this possible with mediasoup? I found a schema when the router has rts out, but now I don’t understand how to do it. Which part of the docs do I need to investigate if this is possible?
mediasoup API does not come with such a solution per se.
mediasoup routes RTP streams to endpoints and it is the job of these rendering the content of the different audio/video streams, ie ,in the screen and loudspeakers.
If you want to broadcast a whole room (as in mediasoup-demo) to an external service, you will have to do something like the following:
- Run a server side browser that connects to the room.
- Indicating it to use a virtual X display (instead of a physical display)
- Indicating it to use a virtual sound card (instead of a physical speaker)
At this point the room would have this remote attendee which is rendering the room on a virtual X display and the mixed audio on the virtual sound card.
- Start a FFMpeg, GStreamer or similar program that takes the audio and video from the virtual devices used by the browser to output the audio/video and send them to the given service.