mediasoup webRTC Remote video stream showing blank on ubuntu server - node.js

I have developed a Video chat application using angular , node.js , webRTC , mediasoup with pipe transport .
The remote video streams are working fine on localhost but they are not working after deployment to Ubuntu server .enter image description here
Can anyone help in that ?
Why remote video stream is not working after deployment to server ?

Ensure you open rtcMinPort & rtcMaxPort both for TCP/UDP connection. Make sure your firewall not blocking rtcPorts range : rtcMinPort:rtcMaxPort e.g if in my case rtcMinPort is 40000 & rtcMaxPort is 40100, i will make sure firewall is not blocking 40000:40100

Related

WebRTC change default (500kbps) bandwidth NodeJS - Kurento Media Server (KMS)

I am using Kurento Media Server for my WebRTC project, I've been following the tutorial one2one-call.
Everything is okay until I'm using the media constraints of 640x360, as the bandwidth required by this constraints fits within the default bandwidth of KMS i.e. (500kbps), but as I increase the video resolution it demands more bandwidth and the video starts to pixelate, on the other end.
What I have tried till now
using setMinVideoSendBandwidth, setMaxVideoSendBandwidth, setMinVideoRecvBandwidth, setMaxVideoRecvSendBandwidth on webRtcEndpoints
adding "b=AS: 5000" to the client side offer SDP before setting it as local description and sending to server (edited kurento-utils.js).
changing bitrate in MediaElement.conf.ini at server configurations
I'm using kurento-utils.js at client side for inititaing RTC object, creating and answering offer.
As I said above I tried to add b=AS: 5000, for that I edited the kurento-utils.js.
I'm not sure if this required but my KMS runs on AWS and the Application server is hosted locally and on remote VPS.
Thanks in Advance!

How to get WebRTC MediaStream to Node JS

I just want to know to get webrtc media stream to the node js server and serves it to the clients connected to that server.
I already created P2P WebRTC application with node js signalling server and it works fine. But now wants to route the media stream through the server. It should have low latency and delay to make it work at live server.
What you need is a SFU (Selective Forwarding Unit). Like these
mediasoup
janus-gateway
kurento
Here is a github project where it is implemented using mediasoup.

beginner webrtc/nodejs issue connecting remote clients

I'm trying to develop a web application in nodejs. I'm using an npm package called "simple-peer" but i don't think this issue is related to that. I was able to use this package and get it working when integrating it with a laravel application using an apache server as the back end. I could access the host machine through it's IP:PORT on the network and connect a separate client to the host successfully with a peer-to-peer connection. However, I'm now trying to develop this specifically in node without an apache back end. I have my express server up and running on port 3000, I can access the index page from a remote client on the same network through IP:3000. But when I try to connect through webrtc, I get a "Connection failed" error. If I connect two different browser instances on the same localhost device, the connection succeeds.
For reference: i'm just using the copy/pasted code from this usage demo. I have the "simplepeer.min.js" included and referenced in the correct directory.
So my main questions are: is there a setting or some webRTC protocol that could be blocking the remote clients from connecting? What would I need to change to meet this requirement? Why would it work in a laravel/webpack app with apache and not with express?
If your remote clients can not get icecandidates, you need TURN server.
When WebRTC Peer behind NAT, firewall or using Cellular Network(like smartphone), P2P Connection will fail.
At that time, for fallback, TURN server will work as a relay server.
I recommend coTURN.
Here is an simple implementation of simple-peer with nodejs backend for multi-user video/audio chat. You can find the client code in /public/js/main.js. Github Project and the Demo.
And just like #JinhoJang said. You do need a turn server to pass the information. Here is a list of public stun/turn servers.

RTSP Camera P2P Connection without Port Forwarding and Console Application

I am trying to connect Remote RTSP Stream from IP Camera, but unable to get it without port Forwarding or Client Application. Is there any procedure to connect RTSP stream from one network to other network without port forwarding?
I have already tried with application client from hikvision and checked Wireshark streams but unable to get it
cam = cv2.VideoCapture("rtsp")
Take a look at the Nabto P2P platform, it is designed exactly to solve this problem, free for personal use and test / R&D. The Nabto blog has specific examples for setting up RTSP P2P tunnelling on cameras, Raspberry Pi devices and ESP32 devices:
You can either install the Nabto P2P reverse proxy in front of your RTSP service on the camera as a standalone process - or you can integrate it into an existing application. Full source is available in github.
On the client side, you can use an existing Nabto enabled RTSP client - or build your own based on the client SDKs, available for most popular platforms. Existing client apps available in github and in App store / Google Play.

Building Node Js server to receive live Video streams from multiple clients{Raspberry Pi's} over the internet

As the title suggests I want to build a NodeJs server to receive live video stream from multiple clients at the same time OVER THE INTERNET.
My client would basically be a Rpi with a camera sending it's live video stream to my NodeJs server.
I would be having multiple clients {Rpis} doing the same.
My NodeJs Server has a Static Public IP.
My NodeJs server and Clients{Rpis} are not on the same Local Network....So how can I send Live Video Stream from Multiple RPis to the central NodeJs server over the internet ?
....Basically I want to Build a VideoStream API[Implemented on NodeJs server], which can be used by my Multiple clients to push frames on to my server.
I have no clue on how to achieve the above .. Plz Help.
...
I saw many solutions online. None seem to fulfill my purpose.
Most of the solution online said. To configure Rpi as a nodejs server and stream camera feed in local network but I want to achieve the same on the INTERNET. but this not what I want. Since I have multiple client i.e multiple Raspberry pi's which are not same Network as of the NodeJs server.
client{raspberry pi}
const request = require('request');
const readablestream = require('magical-not-provided-way-to-access-camera-stream')
const r = request.post("http://staticIp/");
r.pipe(readablestream);
server
requestlistener(req){req.pipe(writeablestream)}
client
raspberrys.foreach(pullStream)
server{raspberry pi}
requestlistener(req,res){res.pipe(camerastream)}

Resources