MediaSoup as a service

We are trying MediaSoup as a potential solution for our streaming communication capabilities. We have noticed it is a server that can be run in a host through node js, so basically it is a webserver running in a virtual machine

But the question is if there is any option to package it as an API that could be interfered from another Java service in a microservices architecture.

As far as I see the API clients for MediaSoup are written in node.js and phyton an they are though for client but not for servers.

Any reference on this? Should we port a clinet from python for instance to expose the API as a Java service in the server side?

Thanks a lot.

I stop reading here. May I know how you have concluded that mediasoup is a web server?

1 Like

Thanks, Iñaki. Well, what I mean is it is a Node.js module so it acn be run as a web application. So my qustion is if there is any option to integrate it in a higher level service by means of Java? That is, apart from the cline-side APIs, is there any API at server side? Do you have any reference on that?
Thanks a lot.

It can’t be run as an application, this is a library you build your own application with. Docs are extremely clear about this.

1 Like

Trust the mediasoup docs, please. If the docs do not talk about any built-in API server it means that there is no API server.

But you can create one as part of your application.

Ok, we will try to make a secure REST API back end with node.js to expose the MediaSoup capabilities to our other services.

You should take into account that mediasoup related classes (Worker, Router, Transport, Producer, etc) do not just expose public methods but also emit events. So if you just implement a classic HTTP API you can not notify your “Java API client” about those events generated by mediasoup objects.

You need something that can be used to send requests from your Java client and receive responses (HTTP is good for this) and also receive notifications from mediasoup side into your Java client.

Anyway, I strongly suggest you read the API documentation of mediasoup before doing certain assumptions and random questions.

1 Like

I think @Jpinazo want to run a service like opentok (vonage). Opentok providing JS APIs by which we can publish stream to particular room(session id) and subscribe any room (session id).

Yes, sure, something like that. We want to buid a sort of communication API to make possible and dynamically the call establishment and the audio and video streaming between a limited-resources device and native mobile apps through MediaSoup. It is on the way.


I am also working on same concept and doing some experiments with mediasoup v3.
Currently our all streaming application running on mediasoup v2 with scalability issue.

As per my understanding, Mediasoup v3 has pipeTransport method in which you can forward any producer track to any router.
Example if one client ‘A’ is connected with Router 1 (Producing and consuming tracks ) then any other client ‘B’ who is connected with Router 2 can only consuming Client’s A track if you forward tracks from router 1 to router 2. It can be achieved by pipeTransport method.