6

I am using Kurento media server for video streaming, I have h264 video source over RTSP. I am creating PlayerEndpoint using below code.

pipeline.create('PlayerEndpoint', {uri: 'rtsp://hostaddress:8554/stream', useEncodedMedia: false}, function(error, _playerEndpoint) {

But still it converts/encodes h264 into VP8, It needs more processing for encoding. So I am getting delay in video stream. I just want to stream h264 video directly without conversion/encoding into VP8. I think Firefox support for H264 video codec.

Is it possible to disable encoding in Kurento media server? If yes, then please help me for same or suggest any more code changes if needed.

Can Firefox able to play such h264 stream form KMS?

Nilesh Wagh
  • 940
  • 1
  • 12
  • 26

1 Answers1

11

You can't disable transcodifications in Kurento. What you can do is prevent them. If you are transcoding to VP8, I take it you are connecting the player to a WebRTC endpoint. In order to do this, your WebRTC must be negotiated to use h264. This can be done in FF, and also in Chrome. You'll need

  • openh264-gst-plugins-bad-1.5 installed in your KMS (please restart after installing)
  • make sure the SDP sent by the client only announces h264

With that, you should get h264 in the whole pipeline.


UPDATE

You can force the use of h264 in WebRtcEndpoints by modifying the file /etc/kurento/modules/kurento/SdpEndpoint.conf.json. At the bottom of that config file, there's a section for the video codecs. If you comment out VP8, you'll be forcing the other peer to use h264

"videoCodecs" : [
//    {
//      "name" : "VP8/90000"
//    },
    {
      "name" : "H264/90000"
    }
]
igracia
  • 3,543
  • 1
  • 18
  • 23
  • Did this work out for you Nilesh? i've been wanting to experiment with such an approach myself...wondering if you ever got this working? – Ashish Aug 19 '16 at 13:00
  • @Ashish This works indeed. Last time I had a use for this was this morning, and it was working fine. Are you having any problems? Check the updated answer. – igracia Aug 19 '16 at 14:35
  • thanks for your help - I haven't yet given it a try, was just researching the implementation before actually doing some coding. Thanks for the updates to the answer - definitely makes it more complete now. – Ashish Aug 26 '16 at 03:58
  • I followed the above and Kurento is taking up 33% CPU on a Core i7 3770K so it looks like it is still transcoding, but transcoding from the source H.264 to the H.264 in the browser. Is there any way to force transcoding/encoding to be off? – Roman Gaufman Apr 28 '17 at 18:25
  • @RomanGaufman Suffered form the transcoding problem here, too. How do you know it's transcoding from H.264 to H.264? – Alston Jul 04 '17 at 13:27
  • @Stallman could you check with and without VP8 enabled? Also, please make sure that you are indeed sending an H264 stream. You should definitely see different numbers if you are sending H264. – igracia Jul 05 '17 at 13:00
  • @igracia I'm pretty sure it's H.264 stream from IP cameras. But how can I stop the H.264 to H.264 transcoding, it's not required as Chrome and FF support open H.264 – Alston Jul 05 '17 at 13:47
  • Are sure that your browser is indeed negotiating H.264, because otherwise it could be negotiating VP8. That's what FF and Chrome do by default if you don't prevent it. – igracia Jul 25 '17 at 08:44
  • How can I do the same in Java? – FearX Jan 03 '20 at 20:36