Using mediasoup server from flutter dart client with no mediasoup-client

I want to use mediasoup server from flutter app for two use cases.

  1. Send stream to server to record on the server side (preferring ffmpeg).
  2. One on one or small groups up to 4 live video chats.

I would like to start with the simple option which is single stream sent to server, and for that I want to use as reference.

My problem is that mediasoup is not using standard offer and answer flow as I know and used to when implementing webRTC clients and in all mediasoup examples they use mediasoup-client that in fact using rtpCapabilities instead of the commonly used SDP format.

I did find this good intention repo: But so far it looks like intention only.

So my question is, what’s the flow I should use in order to privide the client side application with SDP, or how can I get SDP format from mediasoup transport and router rtpCapabilities. Also, if I build the SDP myself, what should be the flow?

client-> connect ->server
server-> create-transport ->client
client-> connect-transport ->server
server-> create-producer(router rtpParameters translated to sdp offer) ->client
client-> produce(sdp answerr translated to producer rtpParameters) ->server

Does it make sense?

Any different approach also will be appreciated.


You should check the documentation, specially this section:

Said that, there are also tons of examples using ffmpeg and gstreamer (see the “Examples” section in the mediasoup website) for you to learn.

I started to implement it myself:

I find that the dart webRtc stream is not giving me all the info I need regarding encoding and tracks separation.

Help will be appreciated.

A Flutter Mediasoup library has been created its similar to the js mediasoup library you can find it in this link