bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
12.06k stars 1.52k forks source link

Not responding path (rtsp h265 camera to hls, connect through vpn) #2175

Closed longdq01 closed 1 year ago

longdq01 commented 1 year ago

Which version are you using?

v0.23.8

Which operating system are you using?

Describe the issue

I've created a path publish rtsp camera to server

paths:
  proxied:
    source: rtsp://admin:@192.168.1.81:554
  all:
  ...

Source ip camera is 192.168.1.81 because this camera and my Pi same network. I want to convert rtsp -> hls and access hls link via openvpn, for example: http://10.8.0.16:8888/proxied (10.8.0.16 is ip of pi)

... But, I can only access to http://10.8.0.16:8888 with 404 response image

When I access http://10.8.0.16:8888/proxied, it's pending for a long time image

If I access http://192.168.1.127:8888/proxied (192.168.1.127 is local ip of Pi), it's working well

Describe how to replicate the issue

  1. Download release binary and edit config file
  2. Connect Pi to vpn
  3. Run ./mediamtx

Did you attach the server logs?

yes image

Did you attach a network dump?

no, i don't know how to

Thanks !

aler9 commented 1 year ago

Hello, in the logs there's no trace of any request coming from the VPN to the server. Make sure that your firewall allows incoming connections from the VPN. The only port required for HLS to work is TCP 8888.

If you still have problems attach server logs with option logLevel: debug (as written in instructions) as they allow to view any incoming request to the server.

longdq01 commented 1 year ago

i checked the firewall, i think it's not blocking anything. Because, sometime it's work but sometime not.

For now I can go to client with ip 10.8.0.19 image

But not 10.8.0.20 image

I'm sure server is running on port 8888 image

What can I do, please thanks !

aler9 commented 1 year ago

In the instructions and in my reply there's clearly written to attach logs generated with logLevel: debug. Please reopen the issue and attach such logs.

longdq01 commented 1 year ago

log.txt

Yes, my server's log here, I see my request in line:

Aug 13 01:47:20 bpi-iot-ros-ai mediamtx[4303]: 2023/08/13 01:47:20 DEB [HLS] [conn 10.8.0.25:14049] GET /cam81/
Aug 13 01:47:20 bpi-iot-ros-ai mediamtx[4303]: 2023/08/13 01:47:20 DEB [HLS] [conn 10.8.0.25:14049] [c->s] GET /cam81/ HTTP/1.1

But nothing happend in my screen :(

aler9 commented 1 year ago

In my opinion the issue is linked to the fact that when you are in the VPN your browser is unable to download the subresources of the HLS page. These includes:

If you open Developer Tools (F12) and go to the "Network" and the "Console" page, you're able to see the status of requests to download the subresources.

longdq01 commented 1 year ago

Yes, I can see it's pending for long time when download index.m3u8. I'm very confuse because sometime it's work

mateothegreat commented 1 year ago

You need to share a screenshot of the network tab of your developer tools. Specifically, we need to see the host of the pending requests to first determine if it's using the VPN tunnel.

If that is the case then we have a plethora of other VPN related things that could be causing the issue.

At a glance, we have addresses all over the place based on the comments above:

The "hanging" of the requests means the connection was successfully opened but is in purgatory between the tun interface, the VPN routing, and/or the landing side tun interface.

I'd see guidance on a devops/sysadmin oriented server on discord (ping me if you need a link).

Good luck!

longdq01 commented 1 year ago

Thanks you for help @mateothegreat ! but I think it's quite old, I stopped running it

github-actions[bot] commented 6 months ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.