Using MediaSoup server from Python?

Hello there!
I have an idea in my mind and I want to build it using Python for signaling and many other stuff. According to FAQ.1, I need to make my own communication channel with MediaSoup’s standalone server. Can you please give me some hints where do I get started?

I have worked with JS but for client-side front-end and not server-side. I use Python in the back-end.

I currently have two ideas to accomplish my goal:

  • Use PyO3 to wrap the Rust bindings and use them in Python.
  • Use NodeJS to write a simple API server using it and communicate with this server with Python through TCP or UDS.

Please let me know if my ideas are good enough or if you have better ones.

The first approach is more interesting of course, if it works technically, i.e. if there are no problems with those bindings. The second one adds yet another IPC level, which is not that good.

I reply to your question a bit later, but if you or someone else try to achieve the same goal as you, here is a solution who work perfectly and add a bring of security and scalability for your app.
1/Use mediasoup-client in your front end
2/Create the signaling server with python and do whatever stuff you want to do here
3/Create a Rust or NodeJS server who handle the sfu library
4/Once you created the NodeJS or Rust server, add a messager broker like Redis or RabbitMQ or whatever to communicate between you Python signaling server and your sfu server
5/The data you received from signaling server help you create your producer and consumer, then once it’s done, send the response to your Python signaling server
6/Once you received the event from your sfu server in your Python server, send it back to your front end
7/Just build your producer and consumer in front end like that and enjoy you stream

Hope it can help you or someone else.