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 https://github.com/ethand91/mediasoup3-record-demo 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: https://github.com/cloudwebrtc/flutter-mediasoup-client 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.

Thanks.

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

https://pub.dev/packages/mediasoup_client_flutter

[Logger::WebTransport] DEBUG: constructor() [url:wss://192.168.29.67:4443/?roomId=wizqlbcv&peerId=BBCQOEHb, options:null]
[Peer] DEBUG: constructor()
[Logger::WebTransport] ERROR: WebSocket “error” event
[Logger::WebTransport] WARN: WebSocket “close” event [wasClean:false, code:1006, reason:""]
[Peer] DEBUG: emit “close”

Hello Guys,
When I run flutter mediasoup app on web on local server I am facing this issus.
If I check with mediasoup demo url it works fine.
can any one help me please?