Adding Speex Codec Support in RTPendpoint

282 views
Skip to first unread message

Damien Fétis

unread,
Nov 24, 2015, 11:13:12 AM11/24/15
to kurento
Hi all,

I'm trying to add Sppex audio codec in Kurento RtpEndpoint to toalk sppex to my Astersik.
But I find some issues with it.

I start from current git dev version of kms-core and change these files to add speex related code :

src/server/interface/core.kmd.json
src/server/config/SdpEndpoint.conf.json
src/server/implementation/objects/MediaElementImpl.cpp
src/gst-plugins/commons/kmsenctreebin.c
src/gst-plugins/commons/kmsbasertpendpoint.c
src/gst-plugins/commons/kmsagnosticcaps.h

After building and Install my custom version of kms-core speex codec appears in RTPEndpoint gererated offer :

v=0
o=- 3657369182 3657369182 IN IP4 XX.XX.XX.XX
s=Kurento Media Server
c=IN IP4 XX.XX.XX.XX
t=0 0
m=audio 37390 RTP/AVPF 96 97 98
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=rtpmap:96 opus/48000/2
a=rtpmap:97 AMR/8000
a=rtpmap:98 speex/16000
a=ssrc:1478855009 cname:user2779369982@host-f6a9d855
m=video 33464 RTP/AVPF 104 105
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=rtpmap:104 VP8/90000
a=rtpmap:105 H264/90000
a=rtcp-fb:104 nack
a=rtcp-fb:104 nack pli
a=rtcp-fb:104 ccm fir
a=rtcp-fb:105 nack
a=rtcp-fb:105 nack pli
a=rtcp-fb:105 ccm fir
a=ssrc:944096919 cname:user2779369982@host-f6a9d855


For my test I connect a WebRtcendPoint to RtpEndpoint (in half duplex)  and I make a call to my astersik.
With  PCMU codec all is ok but not with my speex version.

And I can only send Audio in speex from my Kurento to my Astersik but I can't receive Audio.

Someone have an idea of what i'm missing on the Kurento audio receive part ?

Best Regards,
Damien.
speex-patch.tgz

Jose Antonio Santos Cadenas

unread,
Nov 24, 2015, 12:18:40 PM11/24/15
to kurento
Have you tried just adding SPEEX (in capital lettters) to configuration file (/etc/kurento/modules/kurento/SdpEndpoint.conf.json) and not changing anything else?

--
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.

Damien Fétis

unread,
Nov 25, 2015, 11:27:51 AM11/25/15
to kurento
Hi Jose, thank you for your response.

I tried to add SPEEX in configuration file and not changing other thinks but it doesn't work (I can't send nor receive audio)

To make the sending Speex works I had to change this :

First In src/gst-plugins/commons/kmsbasertpendpoint.c function get_caps_codec_name :
if (g_ascii_strcasecmp ("speex", codec_name) == 0) {
    return "SPEEX";
}

Because without this it fill speex in encoding-name in gst_caps_new_simple.
Maybe it_s due to Astersik SDP where the speex codec line is "a=rtpmap:98 speex/16000"

And second change is in src/gst-plugins/commons/kmsagnosticcaps.h
audio/x-speex ==> audio/x-speex,rate=[8000, 16000],channels=1;

Because without setting this sample rate limite I have the Dark Vador voice on my Astersik call.

But I still can't receive speex audio. Could you please explain me how the RtpEndpoint media receiver part works ?

Best Regards,

Damien.

Jose Antonio Santos Cadenas

unread,
Nov 25, 2015, 11:56:53 AM11/25/15
to kurento
Ok, then your changes makes sense, but the caps change is not the better place to do it, I have to think about where is the better place to add them because this caps is something that we want to remove. Additionally adding caps there is only working for your case, but not for other rates that payloader can support. Probably if we set correctly the caps at the src pad of the payloader this can be fixed (but not sure 100%).

About the receiving part, maybe you have a negotiation problem between gstreamer elements. You could get a dot of the gstreamer element invoking getGstreamerDot() method of the pipeline and share it with us so we can see what is going on.
Reply all
Reply to author
Forward
0 new messages