Running sample pplicaation (one2one-advanced-call) on a server failing to load video stream of peer.

1,369 views
Skip to first unread message

develop...@gmail.com

unread,
Nov 5, 2014, 7:06:39 AM11/5/14
to kur...@googlegroups.com
Hello!
     I am really impressed by the KMS. To see the applications running in live action, I tried to deploy the application a AWS server that I have. The one2one-advanced call sample application is the one im looking into. The application on the server is successfully able to register users and on calling both the user ends get the calling notification and accepting the share-cam-and-mic pop-up. However, the video stream of the peer never loads (the spinner gif keeps running endlessly). Can someone tell me why is this happening? Are there some ports which I have to keep open specifically for the transmission? (Currently I've opened 8080 and 8888). 

Regards,
Mohit 

develop...@gmail.com

unread,
Nov 5, 2014, 12:23:32 PM11/5/14
to kur...@googlegroups.com, develop...@gmail.com
The sample application I referred to above is here - http://54.187.83.104:8080/

Ivan Gracia

unread,
Nov 5, 2014, 12:26:13 PM11/5/14
to Kurento Public
Hi, 

Your WebRTC endpoint in the AWS network is not able to find it's public IP, unless you give him a hand ;-) There are some nice articles around on why STUN and TURN are needed to help WebRTC traverse NATs. 

In order to enable STUN in KMS, you'll have to edit the configuration file located in /etc/kurento/kurento.con.json. Look for the block WebRtcEndpoint and change the content for this one

    "WebRtcEndpoint" : {
      "stunServerAddress" : "173.194.78.127",
      "stunServerPort" : 19302
      //"turnURL" : "kurento:kurento@<public-ip>:3478"
      // "pemCertificate" : "file"
    } 

which is the configuration to use stun.l.google.com as STUN server. 

Now, you'll need to open some ports in you AWS console
  • 8080 TCP for the webserver
  • 8888 TCP for the websocket connection of the media server
  • All UDP for video via WebRTC
That setup should work!

Cheers,
Ivan Gracia



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

develop...@gmail.com

unread,
Nov 7, 2014, 7:56:48 AM11/7/14
to kur...@googlegroups.com
Hi! 
    Thank you so much for the speedy reply. I am quite a novice at this and hence am not able to figure out where am I going wrong. I'm attaching my kurento.con.json file. Please tell me what is wrong with it. My public-ip is 54.187.83.104
kurento.conf.json

develop...@gmail.com

unread,
Nov 7, 2014, 8:28:12 AM11/7/14
to kur...@googlegroups.com, develop...@gmail.com
Or here's the contents for easy viewing...

{
  "mediaServer" : {
    "net" : {
      // Uncomment just one of them
      /*
      "rabbitmq": {
        "address" : "127.0.0.1",
        "port" : 5672,
        "username" : "guest",
        "password" : "guest",
        "vhost" : "/"
      }
      */
      "websocket": {
        "port": 8888,
        //"secure": {
        //  "port": 8433,
        //  "certificate": "defaultCertificate.pem",
        //  "password": ""
        //},
        "path": "kurento",
        "threads": 10
      }
    }
  },
  "modules": {
    "kurento": {
      "SdpEndpoint" : {
        "sdpPattern" : "sdp_pattern.txt"
      },
      "HttpEndpoint" : {
        // "serverAddress" : "localhost",
        // "port" : 9091
        /*
          Announced IP Addess may be helpful under situations such as the server needs
          to provide URLs to clients whose host name is different from the one the
          server is listening in. If this option is not provided, http server will try
          to look for any available address in your system.
        */
        // "announcedAddress" : "localhost"
      },
      "WebRtcEndpoint" : {
         "stunServerAddress" : "54.187.83.104", // Only IP address are supported
         "stunServerPort" :19302,
        // turnURL gives the necessary info to configure TURN for WebRTC.
        //    'address' must be an IP (not a domain).
        //    'transport' is optional (UDP by default).
        // "turnURL" : "user:password@address:port(?transport=[udp|tcp|tls])",
        // "pemCertificate" : "file"
      },
      "PlumberEndpoint" : {
        // "bindAddress" : "localhost",
        /*
          Announced IP Address may be helpful under situations such as the endpoint needs
          to provide an IP address to clients whose host name is different from the one
          that the element is listening in. If this option is not provided, the bindAddress
          will be used instead.
        */
        // "announcedAddress" : "localhost"
      }
    }
    //"module1": { …. }
    //"module2": { …. }
  }
}

Ivan Gracia

unread,
Nov 7, 2014, 4:21:00 PM11/7/14
to Kurento Public, develop...@gmail.com
Watch out for the comma at the end of the stunServerPort key. Your Kurento Media Server instance didn't start because of this. If you open the log file in /var/log/kurento-media-server/media-server.log, you'll see the following message

Error reading configuration: /etc/kurento/kurento.conf.json(50): expected object

Cheers,
Ivan Gracia


develop...@gmail.com

unread,
Nov 16, 2014, 7:01:16 AM11/16/14
to kur...@googlegroups.com, develop...@gmail.com
Hi,
    I removed the comma at the end of the serverport key. It still stops after reaching the state "SDP answer received, setting remote description". Can you tell me why?

Regards,
Mohit


On Saturday, November 8, 2014 2:51:00 AM UTC+5:30, igracia wrote:
Watch out for the comma at the end of the stunServerPort key. Your Kurento Media Server instance didn't start because of this. If you open the log file in /var/log/kurento-media-server/media-server.log, you'll see the following message

Error reading configuration: /etc/kurento/kurento.conf.json(50): expected object

Cheers,
Ivan Graci


Ivan Gracia

unread,
Nov 16, 2014, 5:19:45 PM11/16/14
to kur...@googlegroups.com, develop...@gmail.com
Are the UDP ports open in your AWS security group?

develop...@gmail.com

unread,
Nov 16, 2014, 5:24:07 PM11/16/14
to kur...@googlegroups.com, develop...@gmail.com, izan...@gmail.com
Yes, I have opened all UDP ports and the TCP ports 8000,8080 and 19302.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+unsubscribe@googlegroups.com.

Ivan Gracia

unread,
Nov 16, 2014, 6:13:02 PM11/16/14
to develop...@gmail.com, kur...@googlegroups.com
Could you please attach the SDP answer from KMS? Let's see if the STUN server is reachable, and the IPs there are ok.

develop...@gmail.com

unread,
Nov 16, 2014, 6:27:24 PM11/16/14
to kur...@googlegroups.com, develop...@gmail.com, izan...@gmail.com
Hi,
   Can you tell me which file are you asking me to attach exactly? I dont have much experience working with this.

Ivan Gracia

unread,
Nov 16, 2014, 6:29:27 PM11/16/14
to develop...@gmail.com, kur...@googlegroups.com
If you are running one of the tutorials, you'll see a console at the bottom of the page. There's the SDP that the server sends. You can copy-paste the text in the console in a file, and attach to a mail so we can have a look at that.

develop...@gmail.com

unread,
Nov 17, 2014, 8:14:04 AM11/17/14
to kur...@googlegroups.com, develop...@gmail.com, izan...@gmail.com
I was not being allowed to attach the direct console output textfile so here goes,

Senging message: {"id":"register","name":"user1"}
Received message: {"id":"resgisterResponse","response":"accepted"}
Created SDP offer
Local description set
ICE negotiation completed
Invoking SDP offer callback function
Senging message: {"id":"call","from":"user1","to":"user2","sdpOffer":"v=0\r\no=Mozilla-SIPUA-33.1 15856 0 IN IP4 0.0.0.0\r\ns=SIP Call\r\nt=0 0\r\na=ice-ufrag:8039334b\r\na=ice-pwd:f6d9ab540d8d68050edc909c8254bf40\r\na=fingerprint:sha-256 AB:30:55:92:E6:9E:0A:D2:DE:FB:FF:BF:5B:24:66:41:67:6A:A5:94:5E:50:B0:5F:3B:29:BD:15:79:7D:C0:21\r\nm=audio 64293 RTP/SAVPF 109 0 8 101\r\nc=IN IP4 192.168.1.7\r\na=rtpmap:109 opus/48000/2\r\na=ptime:20\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-15\r\na=sendrecv\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=setup:actpass\r\na=candidate:0 1 UDP 2130379007 192.168.1.7 64293 typ host\r\na=candidate:3 1 UDP 2128609535 198.18.120.96 49787 typ host\r\na=candidate:0 2 UDP 2130379006 192.168.1.7 56540 typ host\r\na=candidate:3 2 UDP 2128609534 198.18.120.96 55170 typ host\r\na=rtcp-mux\r\nm=video 51482 RTP/SAVPF 120 126 97\r\nc=IN IP4 192.168.1.7\r\na=rtpmap:120 VP8/90000\r\na=rtpmap:126 H264/90000\r\na=fmtp:126 profile-level-id=42e01f;packetization-mode=1\r\na=rtpmap:97 H264/90000\r\na=fmtp:97 profile-level-id=42e01f\r\na=sendrecv\r\na=rtcp-fb:120 nack\r\na=rtcp-fb:120 nack pli\r\na=rtcp-fb:120 ccm fir\r\na=rtcp-fb:126 nack\r\na=rtcp-fb:126 nack pli\r\na=rtcp-fb:126 ccm fir\r\na=rtcp-fb:97 nack\r\na=rtcp-fb:97 nack pli\r\na=rtcp-fb:97 ccm fir\r\na=setup:actpass\r\na=candidate:0 1 UDP 2130379007 192.168.1.7 51482 typ host\r\na=candidate:3 1 UDP 2128609535 198.18.120.96 58426 typ host\r\na=candidate:0 2 UDP 2130379006 192.168.1.7 50012 typ host\r\na=candidate:3 2 UDP 2128609534 198.18.120.96 60015 typ host\r\na=rtcp-mux\r\n"}
Received message: {"id":"callResponse","response":"accepted","sdpAnswer":"v=0\r\no=- 15856 0 IN IP4 0.0.0.0\r\ns=TestSession\r\nc=IN IP4 0.0.0.0\r\nt=0 0\r\nm=audio 50729 RTP/SAVPF 0\r\nc=IN IP4 172.31.35.90\r\na=rtpmap:0 PCMU/8000\r\na=sendrecv\r\na=rtcp:37629 IN IP4 172.31.35.90\r\na=ice-ufrag:94G1\r\na=ice-pwd:CqKQd9S7rfen45W0kzrp79\r\na=fingerprint:sha-256 B2:50:85:DF:14:88:96:A8:E0:D3:D4:54:FB:21:FC:2B:F5:8F:C9:59:13:9D:D9:5D:38:52:8C:2A:E6:6A:CF:FE\r\na=candidate:1 1 UDP 2013266431 172.31.35.90 50729 typ host\r\na=candidate:1 2 UDP 2013266430 172.31.35.90 37629 typ host\r\nm=video 33134 RTP/SAVPF 120\r\nc=IN IP4 172.31.35.90\r\na=rtpmap:120 VP8/90000\r\na=sendrecv\r\na=rtcp-fb:120 nack\r\na=rtcp-fb:120 nack pli\r\na=rtcp-fb:120 ccm fir\r\na=rtcp:57362 IN IP4 172.31.35.90\r\na=ice-ufrag:8M3H\r\na=ice-pwd:KqNc8IR1s3kf+xUJT3STGF\r\na=fingerprint:sha-256 B2:50:85:DF:14:88:96:A8:E0:D3:D4:54:FB:21:FC:2B:F5:8F:C9:59:13:9D:D9:5D:38:52:8C:2A:E6:6A:CF:FE\r\na=candidate:2 1 UDP 2013266431 172.31.35.90 33134 typ host\r\na=candidate:2 2 UDP 2013266430 172.31.35.90 57362 typ host\r\n"}
SDP answer received, setting remote description


See any anomalies? 

Ivan Gracia

unread,
Nov 18, 2014, 11:07:16 AM11/18/14
to develop...@gmail.com, Kurento Public
Yes, I can see three different addresses 
  • 172.31.35.90
  • 198.18.120.96
  • 192.168.1.7
Can you identify these three addresses?

You will have to check which one is being picked up by your client. You can do so in chrome://webrtc-internals/, by checking the 'googRemoteAddress' or the 'googRemoteCandidateType'. If the address chosen is not accessible by your client, then you won't be able to see the video.

Ivan Gracia


develop...@gmail.com

unread,
Nov 18, 2014, 11:18:36 AM11/18/14
to kur...@googlegroups.com, develop...@gmail.com
In the case the address chosen in accessible to my client, what should I do? Try out a different address?

Ivan Gracia

unread,
Nov 18, 2014, 4:16:32 PM11/18/14
to Kurento Public, develop...@gmail.com
No, that's fine. If it's accessible that's fine.

The version of KMS you are using, has a number of issues related to WebRTC that have been corrected in the latest release (5.1.0), and I'd wager they'll solve your freezing issue. One of the improvements has been the implementation of congestion control, which might be the root of your issue, if the connection used by the client is not very good (<1Mb)

Cheers,

Ivan Gracia


develop...@gmail.com

unread,
Nov 18, 2014, 5:13:09 PM11/18/14
to kur...@googlegroups.com, develop...@gmail.com
Hi,
    Is the new version out yet? (I mean the github version currently is 5.1.0?) Also, thanks a lot for all your help! Keep up the good work and all the best! :D

Regards,
Mohit

Ivan Gracia

unread,
Nov 18, 2014, 5:40:53 PM11/18/14
to Kurento Public, develop...@gmail.com
Thank you for your feedback, and for the thumbs-up ;-)

I'm sorry, I was using the nightly build. My bad! It should be released during this week, most likely. In the meantime, you may give the nightly a try, and see if that fixes your "freeze" issue.

Cheers,

Ivan Gracia


develop...@gmail.com

unread,
Nov 29, 2014, 4:49:23 PM11/29/14
to kur...@googlegroups.com, develop...@gmail.com
Hi Ivan!
    Is the new version out yet? Where can I get it from?

Regards,
Mohit

develop...@gmail.com

unread,
Nov 29, 2014, 5:01:36 PM11/29/14
to kur...@googlegroups.com, develop...@gmail.com
These are the latest versions for various distributions right? http://ubuntu.kurento.org/pool/main/k/kurento-media-server/

develop...@gmail.com

unread,
Nov 29, 2014, 5:58:18 PM11/29/14
to kur...@googlegroups.com, develop...@gmail.com
I tried out the new version. I think the handshake completed fine this time, but the videostream still freezes. Am I doing something wrong? Also, how can I check which version of kurento is running on my server? here's the link again : http://54.187.83.104:8080/

Senging message: {"id":"register","name":"aba"}

Received message: {"id":"resgisterResponse","response":"accepted"}
Received message: {"id":"incomingCall","from":"bab"}

Created SDP offer
Local description set
ICE negotiation completed
Senging
 message
:
{"id":"incomingCallResponse","from":"bab","callResponse":"accept","sdpOffer":"v=0\r\no=Mozilla-SIPUA-33.1
 19526 0 IN IP4 0.0.0.0\r\ns=SIP Call\r\nt=0
0\r\na=ice-ufrag:3686de72\r\na=ice-pwd:7a20c0f28b5780b3545f2ba22c7c53d8\r\na=fingerprint:sha-256
 
B1:65:13:13:96:6F:53:85:21:E5:68:20:03:76:A9:A5:B9:CE:45:60:93:BB:E3:A0:23:21:3D:17:DB:CE:D4:53\r\nm=audio
 60303 RTP/SAVPF 109 0 8 101\r\nc=IN IP4 192.168.1.7\r\na=rtpmap:109
opus/48000/2\r\na=ptime:20\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8
PCMA/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101
0-15\r\na=sendrecv\r\na=extmap:1
urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=setup:actpass\r\na=candidate:0
 1 UDP 2130379007 192.168.1.7 60303 typ host\r\na=candidate:3 1 UDP
2128609535 198.18.80.77 65322 typ host\r\na=candidate:0 2 UDP 2130379006
 192.168.1.7 61598 typ host\r\na=candidate:3 2 UDP 2128609534
198.18.80.77 63423 typ host\r\na=rtcp-mux\r\nm=video 65200 RTP/SAVPF 120

 126 97\r\nc=IN IP4 192.168.1.7\r\na=rtpmap:120
VP8/90000\r\na=rtpmap:126 H264/90000\r\na=fmtp:126
profile-level-id=42e01f;packetization-mode=1\r\na=rtpmap:97
H264/90000\r\na=fmtp:97
profile-level-id=42e01f\r\na=sendrecv\r\na=rtcp-fb:120
nack\r\na=rtcp-fb:120 nack pli\r\na=rtcp-fb:120 ccm fir\r\na=rtcp-fb:126
 nack\r\na=rtcp-fb:126 nack pli\r\na=rtcp-fb:126 ccm fir\r\na=rtcp-fb:97
 nack\r\na=rtcp-fb:97 nack pli\r\na=rtcp-fb:97 ccm
fir\r\na=setup:actpass\r\na=candidate:0 1 UDP 2130379007 192.168.1.7
65200 typ host\r\na=candidate:3 1 UDP 2128609535 198.18.80.77 50673 typ
host\r\na=candidate:0 2 UDP 2130379006 192.168.1.7 63800 typ
host\r\na=candidate:3 2 UDP 2128609534 198.18.80.77 55280 typ
}

                                                                       
                                                                       
                                                               
                                                       
                                                       
                                                       
                                                       

Jose Antonio Santos Cadenas

unread,
Nov 30, 2014, 9:13:52 AM11/30/14
to kur...@googlegroups.com, develop...@gmail.com
You should update all packages, not just mesiaserver, because the functionality is spread across all of them.

develop...@gmail.com

unread,
Nov 30, 2014, 10:37:52 AM11/30/14
to kur...@googlegroups.com, develop...@gmail.com
Hi,
    Can you redirect me to some place where I can get the complete package? The new version I mean... 5.1.0. 

Thanks,
Mohit

Jose Antonio Santos Cadenas

unread,
Nov 30, 2014, 12:34:24 PM11/30/14
to kur...@googlegroups.com, develop...@gmail.com
Reply all
Reply to author
Forward
0 new messages