PlayerEndpoint - no audio, video only?

63 views
Skip to first unread message

Neil Young

unread,
Mar 22, 2022, 7:01:41 AM3/22/22
to kurento
Hi,

Can anybody confirm, that the PlayerEndpoint only supports video and no audio?

I'm having a publisher component, which makes KMS play a remote stream and connects that with the WebRTCEndpoint properly.

My subscriber component joins the room and makes KMS sending an offer, which is answered then properly. Both offer and answer contain audio caps:

This is a trace from the subscriber side: The offer comes from KMS, answer from the browser client:


SDP OFFER received:
v=0
o=- 3856935176 3856935176 IN IP4 0.0.0.0
s=Kurento Media Server
c=IN IP4 0.0.0.0
t=0 0
a=group:BUNDLE audio0 video0 application0
m=audio 1 RTP/SAVPF 96 0
a=setup:actpass
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=rtpmap:96 opus/48000/2
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=sendonly
a=mid:audio0
a=ssrc:64411447 cname:user1086216515@host-3a475a98
a=ice-ufrag:O9ZE
a=ice-pwd:gH/T4OdVEb8iEJtnZGV5XD
a=fingerprint:sha-256 87:D9:12:75:CA:A7:A8:8A:79:38:C3:E7:7D:BE:E2:62:D3:BE:6B:75:78:1D:62:63:EC:1F:3D:99:62:64:5E:7C
m=video 1 RTP/SAVPF 100 101
b=AS:5000
a=setup:actpass
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=rtpmap:100 VP8/90000
a=rtpmap:101 H264/90000
a=fmtp:101 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=sendonly
a=mid:video0
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtcp-fb:101 ccm fir
a=ssrc:3962909268 cname:user1086216515@host-3a475a98
a=ice-ufrag:O9ZE
a=ice-pwd:gH/T4OdVEb8iEJtnZGV5XD
a=fingerprint:sha-256 87:D9:12:75:CA:A7:A8:8A:79:38:C3:E7:7D:BE:E2:62:D3:BE:6B:75:78:1D:62:63:EC:1F:3D:99:62:64:5E:7C
m=application 1 UDP/DTLS/SCTP webrtc-datachannel
a=setup:actpass
a=sctp-port:5000
a=mid:application0
a=ice-ufrag:O9ZE
a=ice-pwd:gH/T4OdVEb8iEJtnZGV5XD
a=fingerprint:sha-256 87:D9:12:75:CA:A7:A8:8A:79:38:C3:E7:7D:BE:E2:62:D3:BE:6B:75:78:1D:62:63:EC:1F:3D:99:62:64:5E:7C

SDP ANSWER created:
v=0
o=- 5437438350332595441 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio0 video0 application0
a=msid-semantic: WMS
m=audio 9 RTP/SAVPF 96 0
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:4rUx
a=ice-pwd:hIgAECjnjmjcwrMNRS/WFqhC
a=ice-options:trickle
a=fingerprint:sha-256 0E:2E:B6:E9:B1:46:9A:5F:5E:BA:7C:94:19:2F:30:76:94:0D:8A:6B:57:B0:51:FE:ED:70:DE:40:DE:FC:78:EE
a=setup:active
a=mid:audio0
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=recvonly
a=rtcp-mux
a=rtpmap:96 opus/48000/2
a=fmtp:96 minptime=10;useinbandfec=1
a=rtpmap:0 PCMU/8000
m=video 9 RTP/SAVPF 100 101
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:4rUx
a=ice-pwd:hIgAECjnjmjcwrMNRS/WFqhC
a=ice-options:trickle
a=fingerprint:sha-256 0E:2E:B6:E9:B1:46:9A:5F:5E:BA:7C:94:19:2F:30:76:94:0D:8A:6B:57:B0:51:FE:ED:70:DE:40:DE:FC:78:EE
a=setup:active
a=mid:video0
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=recvonly
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtpmap:101 H264/90000
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=fmtp:101 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
m=application 9 UDP/DTLS/SCTP webrtc-datachannel
c=IN IP4 0.0.0.0
a=ice-ufrag:4rUx
a=ice-pwd:hIgAECjnjmjcwrMNRS/WFqhC
a=ice-options:trickle
a=fingerprint:sha-256 0E:2E:B6:E9:B1:46:9A:5F:5E:BA:7C:94:19:2F:30:76:94:0D:8A:6B:57:B0:51:FE:ED:70:DE:40:DE:FC:78:EE
a=setup:active
a=mid:application0
a=sctp-port:5000

But on the subscriber side only video appears.



Neil Young

unread,
Mar 22, 2022, 7:08:45 AM3/22/22
to kurento
Found this in KMS logs while establishing the subscriber session:

2022-03-22T11:07:20,900535 1119 0x0000ffffb3689690 warning kmsbasertpsession         kmsbasertpsession.c:720 kms_base_rtp_session_start_transport_send() <kmswebrtcsession25>  Cannot configure connection for media (id=2)
2022-03-22T11:07:20,930650 1119 0x0000fffe8dffa690 warning enctreebin                kmsenctreebin.c:458 kms_enc_tree_bin_configure() <kmsenctreebin30>  Invalid encoder for caps: audio/x-opus, channels=(int)[ 1, 2 ], channel-mapping-family=(int)0
2022-03-22T11:07:20,930871 1119 0x0000fffe8dffa690 warning enctreebin                kmsenctreebin.c:458 kms_enc_tree_bin_configure() <kmsenctreebin31>  Invalid encoder for caps: audio/x-opus, channels=(int)[ 1, 2 ], channel-mapping-family=(int)0


A codec problem?

Mahendra Gurjar

unread,
Mar 22, 2022, 7:11:42 AM3/22/22
to kur...@googlegroups.com
Hi

No, it's supported both Audio and Video.


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/kurento/84fd6c0f-5666-483d-8927-280e7e9df084n%40googlegroups.com.

Neil Young

unread,
Mar 22, 2022, 7:19:49 AM3/22/22
to kurento
Thanks. Yes, I believe that, however, my installation seems to have a problem with it.


Will see, if I can trace what's wrong with self->priv->enc

Neil Young

unread,
Mar 22, 2022, 7:38:36 AM3/22/22
to kurento
Same problem with a BigBuckBunny stream rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4

0:00:36.904306603 28064 0xfffee80171e0 WARN              enctreebin kmsenctreebin.c:458:kms_enc_tree_bin_configure:<kmsenctreebin0> Invalid encoder for caps: audio/x-opus, channels=(int)[ 1, 2 ], channel-mapping-family=(int)0




Neil Young

unread,
Mar 22, 2022, 8:42:36 AM3/22/22
to kurento
The reason for the error 

"Invalid encoder for caps: audio/x-opus, channels=(int)[ 1, 2 ], channel-mapping-family=(int)0"

is, that the element self->priv->enc is never set, because my installation doesn't have found a matching encoder:


encoder_factory is NULL here. Not because there is no encoder (there is at least vp8enc and dtlssrtpenc and encodebin, but none of those fulfils the requirement which is tested a couple of lines above, so encoder_factory is set to NULL again.

if (gst_element_factory_get_num_pad_templates (encoder_factory) != 2)
encoder_factory = NULL;


I think I don't have an audio encoder and I don't know why. Is there a special "audio encoder" section in the player endpoint configuration?


The loaded config shows an Audio codec at least:

0:00:00.018386559 47254 0xaaab161d9600 INFO       KurentoLoadConfig loadConfig.cpp:271:loadConfig: Loaded config in effect:

{

    "mediaServer": {

        "resources": {

            "\/\/exceptionLimit": "0.8",

            "\/\/killLimit": "0.7",

            "garbageCollectorPeriod": "240",

            "\/\/": "Default: false",

            "disableRequestCache": "false"

        },

        "net": {

            "websocket": {

                "\/\/ipv6": "false",

                "port": "8888",

                "secure": {

                    "\/\/port": "8433",

                    "\/\/certificate": "cert+key.pem",

                    "\/\/": "Password for the private key, if one was set when the key was created",

                    "\/\/password": ""

                },

                "\/\/registrar": {

                    "\/\/address": "ws:\/\/localhost:9090",

                    "\/\/localAddress": "localhost"

                },

                "\/\/": "Default: SOMAXCONN (128)",

                "\/\/connqueue": "128",

                "path": "kurento",

                "threads": "10"

            }

        }

    },

    "configPath": "\/etc\/kurento",

    "modules": {

        "kurento": {

            "SdpEndpoint": {

                "numAudioMedias": "1",

                "numVideoMedias": "1",

                "audioCodecs": [

                    {

                        "name": "opus\/48000\/2",

                        "\/\/": "Next is an example about how a codec can be configured.",

                        "\/\/": "WARNING: Usage of properties is not yet supported",

                        "\/\/properties": {

                            "\/\/maxcodedaudiobandwidth": "16000",

                            "\/\/maxaveragebitrate": "20000",

                            "\/\/stereo": "1",

                            "\/\/useinbandfec": "1",

                            "\/\/usedtx": "0"

                        }

                    },

                    {

                        "name": "PCMU\/8000"

                    },

                    {

                        "name": "AMR\/8000"

                    }

                ],

                "videoCodecs": [

                    {

                        "name": "VP8\/90000"

                    },

                    {

                        "name": "H264\/90000"

                    }

                ],

                "configPath": "\/etc\/kurento\/modules\/kurento"

            },

            "RecorderEndpoint": {

                "configPath": "\/etc\/kurento\/modules\/kurento"

            },

            "PlayerEndpoint": {

                "configPath": "\/etc\/kurento\/modules\/kurento"

            },

            "HttpEndpoint": {

                "serverAddress": "localhost",

                "port": "9091",

                "configPath": "\/etc\/kurento\/modules\/kurento"

            },

            "WebRtcEndpoint": {

                "configPath": "\/etc\/kurento\/modules\/kurento"

            },

            "MediaElement": {

                "configPath": "\/etc\/kurento\/modules\/kurento"

            },

            "UriEndpoint": {

                "defaultPath": "file:\/\/\/var\/lib\/kurento\/",

                "configPath": "\/etc\/kurento\/modules\/kurento"

            },

            "BaseRtpEndpoint": {

                "configPath": "\/etc\/kurento\/modules\/kurento"

            }

        }

    }

}


Up to now I was able to do audio connections between pub/sub, but I strictly try to prevent transcoding, so now a proper audio encoder is missing.


I'm having a full source installation of KMS and all of its dependencies (GStreamer etc) on that machine. Checking for "opus" with "gst-inspect-1.5 | grep opus" just shows rtp stuff and decoders...


libav:  avdec_opus: libav Opus decoder

libav:  avdec_cllc: libav Canopus Lossless Codec decoder

libav:  avdec_hq_hqa: libav Canopus HQ/HQA decoder

libav:  avdec_hqx: libav Canopus HQX decoder

libav:  avmux_opus: libav Ogg Opus muxer

rtp:  rtpopuspay: RTP Opus payloader

rtp:  rtpopusdepay: RTP Opus packet depayloader


Could one of you please be so kind as to run  "gst-inspect-1.5 | grep opus" on his installation and post the output?


TIA



Neil Young

unread,
Mar 22, 2022, 5:15:18 PM3/22/22
to kurento
Found and fixed it. Thanks for the contribution. No
Reply all
Reply to author
Forward
0 new messages