Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use kurento-media-server for audio only stream?

Tags:

webrtc

kurento

I want to have only audio stream communication between peers , I changed the parts of kurento.utils.js to get only audio stream via getusermedia but it's not working
I used this example node-hello-world example

WebRtcPeer.prototype.userMediaConstraints = {
    audio : true,
    video : {
        mandatory : {
            maxWidth : 640,
            maxFrameRate : 15,
            minFrameRate : 15
        }
    }
};

to

WebRtcPeer.prototype.userMediaConstraints = {
    audio : true,
    video : false
};

is it possible use kurento service for only audio stream?

like image 369
Sina Sharafzadeh Avatar asked Mar 11 '15 10:03

Sina Sharafzadeh


2 Answers

This is indeed possible with Kurento. There are two ways of doing this, depending on the desired scope of the modification:

  1. Per webrtc endpoint: when you process the SDP offer sent by the client, you get an SDP answer from KMS that you have to send back. After invoking the processOffer method call, you can tamper the SDP to remove all video parts. That way, your client will send back only audio.
  2. Globally: You can edit /etc/kurento/sdp_pattern.txt file removing all video related parts, this will force SdpEndpoints (parent class of WebrtcEndpoint) to only use audio.

EDIT 1

The file sdp_pattern.txt is deprecated in KMS 6.1.0, so method 2 shouldn't be used.


EDIT 2

There was an issue with the kurento-utils library, and the client was not correctly setting the OfferToReceiveAudio. It was fixed some time ago, and you shouldn't need tampering the SDPs now.

like image 102
igracia Avatar answered Sep 29 '22 11:09

igracia


git origin: https://github.com/Kurento/kurento-tutorial-js.git git branch: 6.6.0

My solution is only changing var offerVideo = true; to var offerVideo = false; in generateOffer function of kurento-utils.js file.

like image 27
Janu zhou Avatar answered Sep 29 '22 10:09

Janu zhou