Resend h.264 stream without reencoding

933 views
Skip to first unread message

ism...@crosscommunity.com

unread,
Jan 19, 2016, 12:46:29 PM1/19/16
to kurento
I'm using Kurento to receive a couple RTSP streams from some cameras and send them to browsers. Right now Kurento reencodes the already-h.264 streams as h.264, wasting resources and noticeably degrading the video's quality. Is there a way to pass the h.264 stream from a PlayerEndpoint to a WebRtcEndpoint without reencoding?

Ivan Gracia

unread,
Jan 20, 2016, 9:43:45 AM1/20/16
to Kurento Public

There is a property in the player, useEncodedMedia() that you can use for that. The thing is that you need to have a lot of control in what h264 profile you are sending, as FF is quite picky and may choke if it’s not according to certain profiles. We use the Opnh264 encoder, as FF uses the Openh26 decoder, in order to prevent this.

Ivan Gracia

On Tue, Jan 19, 2016 at 6:46 PM, <ism...@crosscommunity.com> wrote:

I'm using Kurento to receive a couple RTSP streams from some cameras and send them to browsers. Right now Kurento reencodes the already-h.264 streams as h.264, wasting resources and noticeably degrading the video's quality. Is there a way to pass the h.264 stream from a PlayerEndpoint to a WebRtcEndpoint without reencoding?

--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

ism...@crosscommunity.com

unread,
Jan 20, 2016, 12:20:15 PM1/20/16
to kurento, ism...@crosscommunity.com
OK, Kurento is awesome. Only 5 frames latency camera-to-browser! That's in the realm of hardware video mixers.

I'm having no problems streaming directly from x264 over RTSP, it's handy to skip double-encoding. It probably wouldn't work too well over the internet, but on a LAN it's pretty impressive.

Ivan Gracia

unread,
Jan 20, 2016, 1:09:14 PM1/20/16
to Kurento Public, ism...@crosscommunity.com
Thanks! Glad to know that :-) 

Please do come back to this thread if you make the tests over the internet, to check what's the latency you got.

Cheers,

Ivan Gracia



--

Ivan Gracia

unread,
Jan 26, 2016, 9:53:07 AM1/26/16
to Kurento Public
Yes, it's similar behavior, so there should be no transcodifications between webrtc endpoints.

Ivan Gracia



On Wed, Jan 20, 2016 at 4:40 PM, <ism...@crosscommunity.com> wrote:
Thanks, I'll give that a shot. I've been using x264 with Kurento for a while since OpenH264 just couldn't keep up a decent stream in realtime, x264 plays just find on Win7 and Linux from FF43. YMMV, of course.

Is there a similar function for WebRtcEndpoints? Or does Kurento already just pass through those streams?

Olivier Gladin

unread,
Mar 14, 2017, 11:44:46 AM3/14/17
to kurento
Hi Ivan,

I also would like to prevent reencoding the H.264/RTSP stream coming from IP cameras but when I set the useEncodedMedia flag, I have the following error message:

2017-03-14 14:20:08,935067 13583 [0x00007f6855af2700]   error playerendpoint            kmsplayerendpoint.c:1224 bus_sync_signal_handler() <kmsplayerendpoint37>  Error: error message: 0x7f667c002e00, time 99:99:99.999999999, seq-num 40059, element 'udpsrc79', GstMessageError, gerror=(GError)NULL, debug=(string)"gstbasesrc.c\(2948\):\ gst_base_src_loop\ \(\):\ /GstPipeline:pipeline/GstURIDecodeBin:uridecodebin/GstRTSPSrc:source/GstUDPSrc:udpsrc79:\012streaming\ task\ paused\,\ reason\ not-linked\ \(-1\)";
2017-03-14 14:20:08,935352 13583 [0x00007f68b4a3b8c0]   error KurentoMediaPipelineImpl  MediaPipelineImpl.cpp:42 busMessage()  Error on bus: error message: 0x7f667c002b00, time 99:99:99.999999999, seq-num 40060, element 'kmsplayerendpoint37', GstMessageError, gerror=(GError)NULL, debug=(string)"gstbasesrc.c\(2948\):\ gst_base_src_loop\ \(\):\ /GstPipeline:pipeline/GstURIDecodeBin:uridecodebin/GstRTSPSrc:source/GstUDPSrc:udpsrc79:\012streaming\ task\ paused\,\ reason\ not-linked\ \(-1\)";
2017-03-14 14:20:08,935685 13583 [0x00007f68b4a3b8c0]   error KurentoMediaElementImpl   MediaElementImpl.cpp:261 _media_element_impl_bus_message()  MediaElement error: error message: 0x7f667c002b00, time 99:99:99.999999999, seq-num 40060, element 'kmsplayerendpoint37', GstMessageError, gerror=(GError)NULL, debug=(string)"gstbasesrc.c\(2948\):\ gst_base_src_loop\ \(\):\ /GstPipeline:pipeline/GstURIDecodeBin:uridecodebin/GstRTSPSrc:source/GstUDPSrc:udpsrc79:\012streaming\ task\ paused\,\ reason\ not-linked\ \(-1\)";

I can reproduce the issue using this example (https://github.com/lulop-k/kurento-rtsp2webrtc), Kurento 6.6.1, with two differents cameras (Panasonic AW-HE 40 and Dlink dcs-5222l) with FireFox and Chrome. We managed to used the Panasonic camera with Janus and Chrome/FF (also rtsp -> webRtc) but because we need transcoding in some scenarios, we would prefer to continue with Kurento!

Best regards,


Olivier

Micael Gallego

unread,
Mar 16, 2017, 6:28:01 PM3/16/17
to kur...@googlegroups.com
I'm sorry but you hit a bug in KMS.

We will work on it in the following weeks...

Best regards

Micael Gallego
Kurento / OpenVidu Project Lead

To unsubscribe from this group and stop receiving emails from it, send an email to kurento+unsubscribe@googlegroups.com.
To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/8c69d769-8d96-455e-8423-43fbe5689ad8%40googlegroups.com.

Olivier

unread,
Mar 20, 2017, 11:01:29 AM3/20/17
to kurento
Hi Micael,

Thank you for your feedback.

Best regards,

Olivier
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.

Ildefonso Junquero

unread,
Jul 4, 2017, 4:49:04 AM7/4/17
to kurento
Hello

We're facing the same problem here.

We need this bug to be resolved due to CPU consumption for the transcoding. Let me explain our environment for you to understand the reasons, and maybe suggest an alternative:

We have around 600 live traffic cameras. All of them are able to use H.264 codec, and we want to show them in HTML5.

When connecting only one camera with resolution 704x576 @25FPS, CPU usage for Kurento Media Server in 1 CPU is around 15% with an Intel Xeon E5-2680 v3 @2.5GHz. The Kurento Media Server is installed in a Virtual Machine running in an ESXi server.

Well, in fact, what we really measure is that 4 cameras (using same resolution and parameters) in a VM with 4 virtual CPU is using 15% of total CPU, so the estimation is that 1 camera is using 15% of one virtual CPU.

If we do the same test with resolution 720p 25FPS, the CPU usage is around 30% for each camera, and I think that for one camera @ 1080p 25FPS, around 70% is a good estimation.

We may have multiple users, each of them looking at several (12 is a good average) cameras simultaneously, so we may  have 250 (or even more) cameras displayed at the same time. For 720p we would need around 90 virtual CPU, and for 1080p, we may need around 200 virtual CPU.

The main issue here is the CPU needed for the transcoding process... if we could use H.264 directly coming from the camera, I think CPU usage would be much lower, and we could support all the cameras with a small server.

Do you see our measurements reasonable? Do they fit in your expectations?
Do you have any suggested architecture or configuration changes?
Do you have an estimation about how long will this bug take to be fixed?

Thanks in advance.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.

Micael Gallego

unread,
Jul 4, 2017, 4:59:47 AM7/4/17
to kur...@googlegroups.com
Hi all, 

I'm very sorry but we are an small team working in Kurento and we prioritise most common scenarios of using Kurento and KMS. For now, as VP8 is our priority, we are not focusing in H264. I invite to you to work with us in improving KMS and investigating the bug by yourself.

Remember that if your business is really affected by KMS bugs or limitations, we offer professional services around open source Kurento Media Server. Professional services allows that KMS will remain free and open source software instead of abandonware... 

Best regards

Micael Gallego
Kurento / OpenVidu Project Lead

To unsubscribe from this group and stop receiving emails from it, send an email to kurento+unsubscribe@googlegroups.com.

To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.

Кирилл Казаков

unread,
Jul 18, 2017, 12:40:51 PM7/18/17
to kurento
Hello!
I have same problem. 
I tried to contact you through your official feedback for getting paid support. But I got no answer, how can I get paid support?

вторник, 4 июля 2017 г., 11:59:47 UTC+3 пользователь OpenVidu написал:

Micael Gallego

unread,
Jul 18, 2017, 1:33:04 PM7/18/17
to kur...@googlegroups.com
Hi,

There are several emails published out there that we can't read.

You can contact us for comercial support at open...@gmail.com.

Thank you.

Best regards.

To unsubscribe from this group and stop receiving emails from it, send an email to kurento+unsubscribe@googlegroups.com.

To post to this group, send email to kur...@googlegroups.com.
Visit this group at https://groups.google.com/group/kurento.
Reply all
Reply to author
Forward
0 new messages