Incorrect stream URL being requested
I'm having a problem streaming from a camera/server setup (non-Axis) into the example browser page. The essence of the problem is this:
-
The server response to DESCRIBE includes:
Content-Base: rtsp://A.B.C.D/1?mode=Live&seek=0&fps=100&metainfo=&follow=0/ -
The client then sends:
SETUP rtsp://A.B.C.D/track1 RTSP/1.0 -
The server responds with
404 - Stream not found.
When I compare this with the behaviour of VLC Player (which works fine), this sends:
SETUP rtsp://A.B.C.D/1?mode=Live&seek=0&fps=100&metainfo=&follow=0/track1 RTSP/1.0
So clearly media-stream-library is omitting the URL search params. Upon investigation, the issue seems to be in _controlURL(attribute) (lib/components/rtsp-session/index.ts, line 264). The value of baseURL is rtsp://A.B.C.D/1?mode=Live&seek=0&fps=100&metainfo=&follow=0/, and the value of attribute is Track1. However, new URL(attribute, baseURL).href returns rtsp://A.B.C.D/track1, i.e. no search params. If I change the code to return baseURL & attribute, the correct URL is returned and it all works fine. However, I realise this might not be a good solution generally.
Any advice on how to fix this properly would be greatly appreciated.
Thanks for your short investigation! At first sight it looks like we have a bug? Feel free to make a pull request with your workaround, it's always easier to discuss a solution when there is already some code proposal.
This issue is stale because it has been open for 90 days with no activity.
This issue was closed because it has been inactive for 90 days since being marked as stale.