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

Oven Media Player crashes and Oven Media Engine displays errors when streaming to WebRTC #312

Closed
isarantidis opened this issue Mar 22, 2021 · 9 comments

Comments

@isarantidis
Copy link

Describe the bug
Oven Media Player crashes and Oven Media Engine displays errors when streaming to WebRTC

To Reproduce
Steps to reproduce the behavior:

  1. Run the OvenMediaEngine Docker image (see versions below)
  2. Push an RTMP stream to OvenMediaEngine via GStreamer using the following pipeline:
    .\gst-launch-1.0 ksvideosrc ! videoconvert ! clockoverlay ! x264enc !queue ! flvmux ! rtmpsink location='rtmp://localhost:1935/app/stream live=true'
  3. Open OvenMediaPlayer in Edge via link: https://ovenplayer.com/docs/demo.html#sources=%5B%7B%22id%22%3A0%2C%22file%22%3A%22ws%3A%2F%2Flocalhost%3A3333%2Fapp%2Fstream%22%2C%22type%22%3A%22webrtc%22%7D%5D&lowLatency=false&liveDelay=false
  4. The page loads normally but after 5-6 seconds the page crashes displaying a generic Edge message: "This page is having a problem, try coming back to it later"

Logs
[2021-03-19 02:50:26.890] E [SckPoolICE:18] Ice | stun_address_attribute_format.cpp:84 | IPv6 is not supported
[2021-03-19 02:50:26.890] W [SckPoolICE:18] Ice | stun_attribute.cpp:63 | Data is too short: type: 0x2112, data length: 44 (expected: 42052)
[2021-03-19 02:50:26.890] W [SckPoolICE:18] Ice | stun_message.cpp:172 | Could not parse attribute
[2021-03-19 02:50:26.890] E [SckPoolICE:18] Ice | ice_port.cpp:569 | Could not parse STUN packet from <DatagramSocket: 0x55fe12c9bed0, #18, state: Bound, UDP, N/A>
[2021-03-19 02:50:29.395] E [SckPoolICE:18] Ice | stun_address_attribute_format.cpp:84 | IPv6 is not supported
[2021-03-19 02:50:29.395] W [SckPoolICE:18] Ice | stun_attribute.cpp:63 | Data is too short: type: 0x2112, data length: 44 (expected: 42052)
[2021-03-19 02:50:29.395] W [SckPoolICE:18] Ice | stun_message.cpp:172 | Could not parse attribute
[2021-03-19 02:50:29.395] E [SckPoolICE:18] Ice | ice_port.cpp:569 | Could not parse STUN packet from <DatagramSocket: 0x55fe12c9bed0, #18, state: Bound, UDP, N/A>
[2021-03-19 02:50:32.128] I [SckPoolRtcSigna:15] Socket.Server | server_socket.cpp:129 | [#13] [0x55fe12c89c70] Client(<ClientSocket: 0x7fc6a0003f00, #73, state: Closed, TCP, 172.17.0.1:45988>) is disconnected
[2021-03-19 02:50:32.128] I [SckPoolRtcSigna:15] WebRTC Publisher | webrtc_publisher.cpp:548 | Stop commnad received : #default#app/stream/101
[2021-03-19 02:50:32.128] I [SckPoolRtcSigna:15] Monitor | stream_metrics.cpp:144 | A session has been stopped playing #default#app/stream on the WebRTC publisher. Concurrent Viewers[WebRTC(0)/Stream total(0)/App total(0)]
[2021-03-19 02:50:32.129] I [SckPoolRtcSigna:15] Signalling | rtc_signalling_server.cpp:322 | Client is disconnected: <WebSocketClient: 0x7fc6c83c48d0, <ClientSocket: 0x7fc6a0003f00, #73, state: Closed, TCP, 172.17.0.1:45988>> (#default#app / stream, ufrag: local: h6ntvj, remote: F0aj)

Server:

  • OS: Windows 10
  • OvenMediaEngine Version: Docker, latest (0.11.1) and dev

Player:

  • OS: Windows 10
  • Browser: Edge
@getroot
Copy link
Member

getroot commented Mar 22, 2021

This is probably caused by IPv6 (it doesn't seem to be related to GStreamer). OME doesn't support IPv6 yet. Please try again with IPv4.

@isarantidis
Copy link
Author

Ok, so I assume that STUN returns then an IPv6 address as the public address instead of IPv4 correct?

@isarantidis
Copy link
Author

Ok, now I set ws://192.168.1.11:3333/app/stream in the OvenMediaPlayer and I get the following logs. To provide more info my network setup is that everything sits behind a home router, where my laptop has the IP:192.168.1.11. On this laptop (Windows 10) I deploy the OvenMediaEngine docker using Docker for Windows & WSL and try to access the signalling endpoint as mentioned in the beginning via my web browser running on the same laptop.

I have not modified the Server.xml at all.

[2021-03-19 12:45:15.205] I [SckPoolRtcSigna:11] Signalling | rtc_signalling_server.cpp:184 | New client is connected: <ClientSocket: 0x7fd370014330, #74, state: Connected, TCP, 172.17.0.1:36516>
[2021-03-19 12:45:15.561] I [SckPoolRtcSigna:11] Monitor | stream_metrics.cpp:119 | A new session has started playing #default#app/stream on the WebRTC publisher. WebRTC(1)/Stream total(1)/App total(1)
[2021-03-19 12:45:16.205] W [SckPoolICE:19] Ice | ice_port.cpp:841 | Could not find ice port information
[2021-03-19 12:45:16.252] W [SckPoolICE:23] Ice | ice_port.cpp:841 | Could not find ice port information
[2021-03-19 12:45:16.299] W [SckPoolICE:27] Ice | ice_port.cpp:841 | Could not find ice port information
[2021-03-19 12:45:16.361] W [SckPoolICE:31] Ice | ice_port.cpp:841 | Could not find ice port information
[2021-03-19 12:45:28.718] I [SckPoolRtcSigna:11] Socket.Server | server_socket.cpp:129 | [#9] [0x55e2b147f460] Client(<ClientSocket: 0x7fd370014330, #74, state: Closed, TCP, 172.17.0.1:36516>) is disconnected
[2021-03-19 12:45:28.718] I [SckPoolRtcSigna:11] WebRTC Publisher | webrtc_publisher.cpp:548 | Stop commnad received : #default#app/stream/104
[2021-03-19 12:45:28.719] I [SckPoolRtcSigna:11] Monitor | stream_metrics.cpp:144 | A session has been stopped playing #default#app/stream on the WebRTC publisher. Concurrent Viewers[WebRTC(0)/Stream total(0)/App total(0)]
[2021-03-19 12:45:28.719] I [SckPoolRtcSigna:11] Signalling | rtc_signalling_server.cpp:322 | Client is disconnected: <WebSocketClient: 0x7fd370012300, <ClientSocket: 0x7fd370014330, #74, state: Closed, TCP, 172.17.0.1:36516>> (#default#app / stream, ufrag: local: EMsb1u, remote: aNW7)

@getroot
Copy link
Member

getroot commented Mar 24, 2021

@isarantidis
I'm not sure because I don't know your environment exactly, but it probably fails for the following reasons:

  1. As the first candidate among ice candidates extracted by OME, the player attempts to connect to the ICE (Stun Binding). Packets were delivered from the player to the server, but the response from the server did not reach the player (for various reasons such as network firewall, docker forwarding settings, etc.)

  2. The player tries to connect as the second candidate among ICE candidates, but the server is waiting for a response as the first candidate, so "Could not find ice port information" is logged.

If this is the cause, the simplest solution is to write the correct IP that can communicate with the player instead of * in *:10000-10005/udp in Server.xml.

@getroot
Copy link
Member

getroot commented Mar 30, 2021

@isarantidis
Improved Ice connection to the latest master branch. Even if you don't change the settings, your problem may have been solved.

@isarantidis
Copy link
Author

Thanks I will try it today. As per your previous comment, I wrote a specific IP in Server.xml and there were no more errors in the server logs.
Still cannot play a WebRTC stream though (browser crashes as before).
It may be something weird related to my network setup. I am trying debug the situation but even the browser logs do not say much.

@isarantidis
Copy link
Author

Ok, so I can verify that using the latest docker dev image I did not need to specify a specific address in IceCandidate. Still I could not make it play WebRTC in the browser.

Docker Logs:
image

Browser Logs:
image

I am thinking of trying not to use docker in case it somehow messes my network setup and maybe build Oven Media Engine from source.

@getroot
Copy link
Member

getroot commented Mar 31, 2021

@isarantidis
What was your docker command?

Connecting as a 172.17.0.1 candidate is wrong. You must connect to the HOST IP. If your docker is not getting external IP from stun.l.google.com:19302, you still have to set your host IP in IceCandidate.
For someone to check this information, you have to upload the entire OvenMediaEngine.log file. Otherwise, the analysis is difficult because I have to guess your settings every time.

@isarantidis
Copy link
Author

The docker command I used was the one from https://airensoft.gitbook.io/ovenmediaengine/getting-started.

In any case I was able to successfully stream using WebRTC by building the source code in Ubuntu instead of using docker :) I will still try to figure out what is wrong with my docker setup.

gitbook-com bot pushed a commit that referenced this issue May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants