mediamtx: Unable to proxy stream with authentication/URL params, 401 (Unauthorized)

Which version are you using?

Docker Hub Latest - 0.9.11

Describe the problem

I am trying to proxy some RTSP stream generated by some AXIS CCTV cameras, they require basic auth, as well as some parameters in the URL to config the correct stream profile. It seems that the URL is causing issues with the server, as it’s reporting a 401 error when trying to connect.

Here’s the startup, and failure log captured from Docker.

2020/08/29 10:02:37 [0/0/0] rtsp-simple-server v0.9.11
2020/08/29 10:02:37 [0/0/0] [UDP/RTP listener] opened on :8050
2020/08/29 10:02:37 [0/0/0] [UDP/RTCP listener] opened on :8051
2020/08/29 10:02:37 [0/0/0] [TCP listener] opened on :8554
2020/08/29 10:03:55 [1/0/0] [client 10.11.12.248:61819] connected
2020/08/29 10:03:55 [1/0/0] [client 10.11.12.248:61819] OPTIONS
2020/08/29 10:03:55 [1/0/0] [client 10.11.12.248:61819] DESCRIBE
2020/08/29 10:03:55 [1/0/0] [source shutter] starting on demand
2020/08/29 10:03:55 [1/0/0] [source shutter] started
2020/08/29 10:03:55 [1/0/0] [source shutter] connecting
2020/08/29 10:03:55 [1/0/0] [source shutter] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/29 10:04:00 [2/0/0] [client 10.11.12.248:61824] connected
2020/08/29 10:04:00 [2/0/0] [client 10.11.12.248:61824] SETUP
2020/08/29 10:04:00 [2/0/0] [client 10.11.12.248:61824] ERR: the path must contain a base path and a control path (shutter)
2020/08/29 10:04:00 [1/0/0] [client 10.11.12.248:61824] disconnected
2020/08/29 10:04:00 [2/0/0] [client 10.11.12.248:61825] connected
2020/08/29 10:04:00 [2/0/0] [client 10.11.12.248:61825] OPTIONS
2020/08/29 10:04:00 [2/0/0] [client 10.11.12.248:61825] ERR: path must begin with a slash
2020/08/29 10:04:00 [1/0/0] [client 10.11.12.248:61825] disconnected
2020/08/29 10:04:00 [1/0/0] [source shutter] connecting
2020/08/29 10:04:00 [1/0/0] [source shutter] ERR: DESCRIBE: bad status code: 401 (Unauthorized)
2020/08/29 10:04:01 [2/0/0] [client 10.11.12.248:61826] connected
2020/08/29 10:04:01 [2/0/0] [client 10.11.12.248:61826] OPTIONS
2020/08/29 10:04:01 [2/0/0] [client 10.11.12.248:61826] DESCRIBE
2020/08/29 10:04:02 [2/0/0] [client 10.11.12.248:61826] ERR: publisher of path 'shutter' has timed out
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61826] disconnected
2020/08/29 10:04:02 [2/0/0] [client 10.11.12.248:61819] ERR: publisher of path 'shutter' has timed out
2020/08/29 10:04:02 [0/0/0] [client 10.11.12.248:61819] disconnected
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61827] connected
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61827] SETUP
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61827] ERR: the path must contain a base path and a control path (shutter)
2020/08/29 10:04:02 [0/0/0] [client 10.11.12.248:61827] disconnected
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61828] connected
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61828] OPTIONS
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61828] ERR: path must begin with a slash
2020/08/29 10:04:02 [0/0/0] [client 10.11.12.248:61828] disconnected
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61829] connected
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61829] OPTIONS
2020/08/29 10:04:02 [1/0/0] [client 10.11.12.248:61829] DESCRIBE
2020/08/29 10:04:05 [1/0/0] [source shutter] connecting

and here’s my docker-compose.yml

version: '3.8'

services:
  rtsp-proxy:
    image: aler9/rtsp-simple-server:latest
    volumes:
      - $PWD/rtsp-simple-relay/rtsp-simple-server.yml:/rtsp-simple-server.yml
    network_mode: "host"

and my rtsp-simple-server.yml

writeTimeout: 5s

paths:
  shutter:
    source: "rtsp://cctv:shh57@10.11.13.111:554/axis-media/media.amp?videocodec=h264&camera=5&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes
  goodsinout:
    source: "rtsp://cctv:shh57@10.11.13.113:554/axis-media/media.amp?videocodec=h264&camera=6&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes
  warehousemiddle:
    source: "rtsp://cctv:shh57@10.11.13.114:554/axis-media/media.amp?videocodec=h264&camera=6&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes
  mezupper:
    source: "rtsp://cctv:shh57@10.11.13.115:554/axis-media/media.amp?videocodec=h264&camera=6&fps=15"
    sourceProtocol: tcp
    sourceOnDemand: yes

Did you attach a network dump?

no

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (10 by maintainers)

Commits related to this issue

Most upvoted comments

(removed)

Thanks for the swift reply.

I have tried the same URL in VLC and it connects without issue.

Attached is a network dump from the docker host, it is filtered to only show traffic to the camera as their is some other slightly more sensitive stuff on the host, but there is definitely traffic to/from the camera IP address in the capture.

Let me know if I can provide anything else to help, I’m guessing this has to be something stupid at this end if it’s working for you with the same scenario, I just can’t work out what it it 👍

Thanks!

Gareth axis_camera.pcap.zip