Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect Kurento KMS running on Docker to an RTSP Multicast URI #349

Closed
tioperez opened this issue Feb 18, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@tioperez
Copy link

commented Feb 18, 2019

KMS Version:

Version: 6.6.0
Found modules:
        Module: 'core' version '6.6.0'
        Module: 'elements' version '6.6.0'
        Module: 'filters' version '6.6.0'

Other libraries versions:

ii  gstreamer1.5-libav:amd64             1.8.2.1~20160909143244.96.g493eee4.trusty  amd64        libav plugin for GStreamer
ii  gstreamer1.5-nice:amd64              0.1.13.1~20160909144510.80.gd9ef50e.trusty amd64        ICE library (GStreamer plugin)
ii  gstreamer1.5-plugins-bad:amd64       1.8.1.1~20160909144557.99.gf836e53.trusty  amd64        GStreamer plugins from the "bad" set
ii  gstreamer1.5-plugins-base:amd64      1.8.1.1~20160909142623.55.g7b19cfd.trusty  amd64        GStreamer plugins from the "base" set
ii  gstreamer1.5-plugins-good:amd64      1.8.1.1~20160909143047.112.g9ee4248.trusty amd64        GStreamer plugins from the "good" set
ii  gstreamer1.5-plugins-ugly:amd64      1.8.1.1~20160909192513.89.g2685b0f.trusty  amd64        GStreamer plugins from the "ugly" set
ii  gstreamer1.5-pulseaudio:amd64        1.8.1.1~20160909143047.112.g9ee4248.trusty amd64        GStreamer plugin for PulseAudio
ii  gstreamer1.5-x:amd64                 1.8.1.1~20160909142623.55.g7b19cfd.trusty  amd64        GStreamer plugins for X11 and Pango
ii  kms-core-6.0                         6.6.0.20160909201132.trusty                amd64        Kurento core module
ii  kms-elements-6.0                     6.6.0.20160912112100.trusty                amd64        Kurento elements module
ii  kms-filters-6.0                      6.6.0.20160912114031.trusty                amd64        Kurento filters module
ii  kms-jsonrpc-1.0                      1.1.1.trusty                               amd64        Kurento jsonrpc library
ii  kmsjsoncpp                           1.6.3~20160909143252.40.gd78deb7.trusty    amd64        Kurento jsoncpp library
ii  kurento-media-server-6.0             6.6.0.20160912115811.trusty                amd64        Kurento Media Server
ii  libgstreamer-plugins-bad1.5-0:amd64  1.8.1.1~20160909144557.99.gf836e53.trusty  amd64        GStreamer development files for libraries from the "bad" set
ii  libgstreamer-plugins-base1.5-0:amd64 1.8.1.1~20160909142623.55.g7b19cfd.trusty  amd64        GStreamer libraries from the "base" set
ii  libgstreamer1.5-0:amd64              1.8.1.1~20160909144007.170.g0d6031b.trusty amd64        Core GStreamer libraries and elements
ii  libnice10:amd64                      0.1.13.1~20160909144510.80.gd9ef50e.trusty amd64        ICE library (shared library)

Client libraries

  1. Application Server (Back-end)
  • Language: Java
  • Version: 6.9.0
<dependency>
    <groupId>org.kurento</groupId>
    <artifactId>kurento-client</artifactId>
    <version>6.9.0</version>
</dependency>
  1. Kurento-utils (Front-end)
  • Language: JavaScript (Front-end)
  • Version: 6.9.0
    "kurento-utils": "^6.9.0"

Browsers tested

  • Chrome: 72.0.3626.109 (Official Build) (64-bit)

System description:

  • KMS is located and running on a Docker container
  • No STUN server.
  • No TURN server.

What steps will reproduce the problem?

  1. Follow the tutorial Docs » Kurento Tutorials » Java - Player and implements an application server and a js client. OK
  2. Try to play a RTSP stream UNICAST and MULTICAST on GStreamer. This works fine. using the following command. Works fine, So it is not a problem with the network. OK

gst-launch-1.0 rtspsrc location="rtsp://xxxxx:xxxxx@xxx.xxx.xxx.xxx?multicast=1" ! decodebin ! autovideosink

  1. Try to play a RTSP stream UNICAST. This works fine. OK
  2. Try to play a RTSP stream in MULTICAST. Does not works. ¡ ERROR !

What is the expected result?

The expected result is that it reproduces the RTSP stream in MULTICAST without problems as it worked with the RTSP stream in UNICAST.

What happens instead?

KMS does not play the RTSP stream in MULTICAST and returns the following error:

Gist: Log KMS v6.6.0 Connection Kurento IP camera Multicast

Pay special attention to line:
kms2 | 0:04:34.165887894 1 0x7fe214002230 DEBUG rtspsrc gstrtspsrc.c:7553:gst_rtspsrc_handle_message:<source> timeout on UDP port

Does it happen with one of the tutorials?

Docs » Kurento Tutorials » Java - Player

Please provide any additional information below.

I also compare the Wireshark frames using GStreamer and Kurento. With GStreamer are not problems but using Kurento it appears that the camera starts to send data to the MULTICAST address but Kurento does not visualize the flow, it gives an "invalid uri" error and executes the TEARDOWN.

Here is the result of Wireshark packages:

@tioperez tioperez changed the title Cannot connect Kurento KMS to a RTSP Multicast URI Cannot connect Kurento KMS to an RTSP Multicast URI Feb 19, 2019

@tioperez

This comment has been minimized.

Copy link
Author

commented Feb 20, 2019

I have edited the question using the logging tip:

export GST_DEBUG="${GST_DEBUG:-3},playerendpoint:5,uridecodebin:5,rtspsrc*:5"

provided by @j1elo

@j1elo

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2019

Please check the GStreamer command with gst-launch-1.5 (note the 1.5) to make sure you use exactly the same libraries that KMS uses. You'll have to install the package gstreamer1.5-tools for this.

Also KMS 6.6.0 is several years old, it's probably a good idea updating to recent versions. Latest one is 6.9.0.

Last: Can you provide a gstreamer, vlc, or equivalent command that generates a test RTSP stream so we can try on our side?

@tioperez tioperez changed the title Cannot connect Kurento KMS to an RTSP Multicast URI Cannot connect Kurento KMS running on Docker to an RTSP Multicast URI Feb 21, 2019

@tioperez

This comment has been minimized.

Copy link
Author

commented Feb 21, 2019

Following this documentation:

https://doc-kurento.readthedocs.io/en/6.9.0/dev/dev_guide.html#add-kurento-repository

I was able to execute the gst-launch-1.5 command in the following way:

gst-launch-1.5 rtspsrc location =" rtsp://xxxxx:xxxxx@xxx.xxx.xxx.xxx/?multicast=1"! Decodebin! autovideosink

Then the result was as expected, the video could be played in MULTICAST without problems.

After this I found the following post:

https://stackoverflow.com/questions/51737969/how-to-support-multicast-network-in-docker

Then I could verify that the error came from Docker, specifically the configuration of its network.

The solution to this problem is to expose the KMS service in the following way in Docker Compose with:

network_mode: host

version: "3.7"
services:
  kms:
    image: kurento/kurento-media-server:6.9.0
    container_name: kms
    restart: always
    network_mode: host
    environment:
      - GST_DEBUG=2,Kurento*:5 

@tioperez tioperez closed this Feb 21, 2019

@j1elo j1elo self-assigned this Apr 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.