Stream to OpenVidu & Kurento from prog by RTP, WebRTC

Good afternoon, guys!

We have some problems and didn’t know that to do. Learned all information from site but no result.
By the way, we develop a program (C/C++) that can get linux video device and stream it on Kurento through OpenVidu in some session. What subscribers can view in the web by browser. We done this task but with errors. When we push or pull stream from/to ov kurento, the picture shows with artefacts (grey, green or others). First of all, we use rtp to deliver video (artefacts). Then we rebuild all and use native webrtc to communicate with OV, same result. If we use only browsers, all is ok. no problem.

Next step was to use alternative soft, janus as webrtc gateway. We stream to janus and from it by webrtc stream to kurento. And same way back. But same result. But! When we use only janus, stream from our soft to janus, and get it back to linux as loopback all is ok! But we want to use your software. Please, help us with it. We can give you all additional information.
We read all info from your sites of OV & Kurento…

We use:
ov - 2.15
kurento - 6.14
ubuntu 18.04.4
All installed native without docker.

It will be great if you can help us. Maybe some info or advices how to debug it and understand where problem.

Hello,

You cannot feed directly a RTP stream into OpenVidu, it needs to be published on a RTSP server and be loaded in OpenVidu as an IP camera.

Either you code this RTSP server in your C++ app or you use an existing RTSP server (ex: https://github.com/aler9/rtsp-simple-server/) with some help from ffmpeg to take input from the RTP stream and output to the RTSP server.

You can probably achieve your goal using just Kurento, if you don’t need the OpenVidu high-level capabilities.

Cheers,
Mihail

Mihail, thank you for your answer, but it is not our solution. I’ll try to describe with more details.

We need to stream any physical device from linux os, as you know /dev/video0 etc. in OpenVidu room. In this case we need OV because we want what users from browsers can view this stream. For ex. On OV the room (session) with name demo_room_1 was created. All users from browsers connected to it and stream their cameras. And our program connected to this session too. And stream /dev/video0 to this session.

But we done this part as I wrote previously. When we didn’t use ov, and use only kurento, we have some problems with artefacts( I don’t know why. Because when we stream live with same code from program to janus and pull stream back all is correct! Maybe you can advice to us, something what we don’t know from manuals.

rtsp is not establish. Ov methods work fine, but it has large lattency( It’s about 1-3 sec. When we stream by webrtc from our program to kurento through ov, latency was about 200 ms. it is good, but a lot of artefacts. And after some time frame was grey( Or picture was choopy like in that ticket (https://stackoverflow.com/questions/63110986/ffmpeg-to-kurento-rtp-stream-choppy-video-issue)

Hope you will help us! Thank you once again!
If you need more information, I can check it.

So you’ve managed to send video through WebRTC from your C++ app using the OpenVidu REST API and RPC for signaling? That sounds pretty cool!

Artifacts are a sign of packet loss (usually happens over UDP). Did you use any library that I can look over or is it proprietary code?

On the other side I also had some lag with my RTSP approach but I can live with it. But if it’s not suitable for you then I need more details how the RTP stream is delivered.

Good afternoon, mihailj!
Sorry for this delay, communicate with our developer. Yes, you are right. We made c++ app which uses ov api to connect to sessions and stream video. Of course, we tried udp & tcp delivering. But no successfull. It is all our code, no libraries. We try to use google’s libwebrtc, but have problems.
Ok, as I wrote previously, first case was stream from app directly to kurento by RTP, without OV. And it was finished, but with lags.
Next big step was to webrtc part and stream native. But have problems too.
And last one was to use simply janus as gateway as webrtc.
I repeat this part: we can successfully stream to janus and receive stream from it to our app without problems and artefacts.
When we use kurento, main problem as I know is streaming from browser and receiving it by our app. When we stream from app to kurento and pull it back, as loopback, all is ok. But whe we pull stream what browser stream, picture broken, with green artefacts or many others problems.
Maybe we need to use some special methods when we pull stream from browsers?
This case can simply check: stream from any browser (chrome || firefox) using your examples (https://docs.openvidu.io/en/2.15.0/demos/openvidu-getaroom/) and receive one stream from this session by RTP or WebRTC to player or app. We have troubles in this step((
By the way:
we use ov 2.15 & kurento 6.14.0
but version 2.8 & 6.9 was more stable… And since this version we couldn’t receive correctly stream.
Need help

If I’m not wrong, you managed to send RTP video stream from a linux box to OpenVidu (implementing RPC protocol) but you have artifacts in web browser, right?

Media quality problems can be caused by:

  • Browsers don’t implement the codec/parameters you are sending the stream. So transcoding is needed to make it compatible.
  • RTP flow has a lot of packet loss. You should improve your network connection.

If you use IPCamera support in OpenVidu, you can force “transcoding” with the property adaptativeBitrate.

If you managed to work with Janus, why are you still trying with OpenVidu?

Good afternoon, Micael!
And thank you for your answer. Yes, you are right. But mainly problems shows when we use this case: stream from browser to OV session and pull it by our linux software. This part have a lot of artifacts. When we stream from our software to OV session by RTP (our webrtc) we reallized and this part too, in browser (which as subbsriber) we see picture with artifacts but it is not so juch as in previous case.
Ok, we think about your advises.
What about ov ip camera, i said previously, what it have a big latency((
And main answer for the last question: our main project build on OV & Kurento and we don’t plan to change it. It is great with browsers, but as we see have a lot of problems when we want to use RTP stream to Kurento(OV)… And in this case janus work better. But we can’t migrate to it. Hope we fix it!
Thank you once again and please, don’t close the ticket!

Try using adaptativeBitrate to force transcoding. Let’s see if that improves quality.

Regards

1 Like