media-stream-library-js icon indicating copy to clipboard operation
media-stream-library-js copied to clipboard

Incorrect stream URL being requested

Open tagsmi opened this issue 4 years ago • 1 comments

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:

  1. The server response to DESCRIBE includes: Content-Base: rtsp://A.B.C.D/1?mode=Live&seek=0&fps=100&metainfo=&follow=0/

  2. The client then sends: SETUP rtsp://A.B.C.D/track1 RTSP/1.0

  3. 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.

tagsmi avatar Dec 01 '21 14:12 tagsmi

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.

steabert avatar Feb 18 '22 14:02 steabert

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Apr 27 '23 01:04 github-actions[bot]

This issue was closed because it has been inactive for 90 days since being marked as stale.

github-actions[bot] avatar Jul 26 '23 01:07 github-actions[bot]