WebRTSP / ReStreamer

Media URLs ReStreamer and Cloud DVR
GNU General Public License v3.0
34 stars 6 forks source link

Problem outside my network #41

Closed more1982 closed 3 months ago

more1982 commented 7 months ago

Hello. I have a problem, when i'm using this app out of my network (in local it's working fine). So I opened port 5080, 5554 and 554 on my router, and app is working, but I can't see video, just spin. Maybe I must open some ports else? Can u help me plz? image

RSATom commented 7 months ago

If app is running behind NAT I'm afraid it's required to use some public TURN server.

RSATom commented 7 months ago

Other option is add forwarding for UDP port, but right now you'll have to forward almost all of them. Maybe it's possible to limit required UDP ports range - I'll check.

RSATom commented 7 months ago

it looks like it's possible https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/119 ... I'll try to add support for this soon.

more1982 commented 7 months ago

it looks like it's possible https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/119 ... I'll try to add support for this soon.

Thank you for your fast answer. Really need this app to run on VPS out of local network.

RSATom commented 7 months ago

VPS? I've thought you are trying to use behind home router... What exactly cloud provider are you trying to use? Is it Amazon EC2?

more1982 commented 7 months ago

VPS? I've thought you are trying to use behind home router... What exactly cloud provider are you trying to use? Is it Amazon EC2?

This will be in future:) Right now I'm using local network with mikrotik router. So Webrtsp server working fine inside local network. But not outside.

RSATom commented 7 months ago

Got it. I'll try to find solution. It's really can be useful... :+1:

more1982 commented 7 months ago

Got it. I'll try to find solution. It's really can be useful... 👍

I'm waitning your solution vary hard< my friend:)

RSATom commented 7 months ago

I just want to say with Amazon EC2 it can be simpler since it can use 1-to-1 NAT... But I didn't try it myself yet thought... It's another thing I shell try...

more1982 commented 7 months ago

If it will be usefull, i can give you some logs from my PC, when I'm trying to connect.

RSATom commented 7 months ago

Thanks, but I know the reason. So there is no need in your assistance right now.

RSATom commented 7 months ago

@more1982 I've pushed changes I hope will help you with your issue. You'll need to do following:

  1. [optional] sudo snap remove rtsp-to-webrtsp && sudo snap install rtsp-to-webrtsp --edge - to update config template to the latest version (or you can just put mentioned below section to your existing restreamer.conf)
  2. Uncomment min-rtp-port and rtp-ports-count (by removing # symbol at the beginning) and put there desired UDP(RTP) ports interval (more simulations clients you expecting - more wide interval there should be, something like rtp-ports-count > = max clients count)
  3. Uncomment stun-server
  4. Configure port forwarding for ports interval specified in 2. on your router
  5. restart app by sudo snap restart rtsp-to-webrtsp

I've tried above on Amazon EC2 instance - and it's working for me well. But in your case some issues are still possible...

RSATom commented 7 months ago

@more1982 any update?

more1982 commented 6 months ago

@more1982 any update?

No, It's still not working. Ihave a solution for my problem with media MTX. It is working for me. Thanks

RSATom commented 6 months ago

@more1982 so this issue can be closed, right?

RSATom commented 3 months ago

Tested the latest version behind router with NAT and following part in restreamer.conf:

webrtc: {
  stun-server: "stun://stun.l.google.com:19302"
  min-rtp-port: 5100
  rtp-ports-count: 100
}

and with configured on router forwarding for: TCP 5080, TCP 5554, UDP 5100-5200

and for me it's working...