Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

integration with media-stream-library-js #6

Closed
a-detiste opened this issue Jun 9, 2020 · 3 comments
Closed

integration with media-stream-library-js #6

a-detiste opened this issue Jun 9, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@a-detiste
Copy link

Hi,

I'm trying to make this work with https://github.com/AxisCommunications/media-stream-library-js
and websockify.

First attempt with VLC is OK and asking the right url proxyStream
(we are using your proxy as a drop-in replacement for live555ProxyServer);
but in the second attempt from localhost (the TCP end of the Websocket->TCP bridge);
the URL got somewhat mangled as proxyStreamtrackID=0, and that doesn't match anything.

This somewhat worked with live555ProxyServer.

Willing to help, providing traces etc....

2020/06/09 07:07:38 [RTSP client 10.150.21.35:54907] connected
2020/06/09 07:07:38 [RTSP client 10.150.21.35:54907] OPTIONS
2020/06/09 07:07:38 [RTSP client 10.150.21.35:54907] DESCRIBE
2020/06/09 07:07:38 [RTSP client 10.150.21.35:54907] SETUP
2020/06/09 07:07:38 [RTSP client 10.150.21.35:54907] PLAY
2020/06/09 07:07:38 [RTSP client 10.150.21.35:54907] is receiving on path 'proxyStream', 1 track via udp
2020/06/09 07:08:09 [RTSP client 10.150.21.35:54907] TEARDOWN
2020/06/09 07:08:09 [RTSP client 10.150.21.35:54907] disconnected
2020/06/09 07:10:16 [RTSP client 127.0.0.1:54764] connected
2020/06/09 07:10:16 [RTSP client 127.0.0.1:54764] OPTIONS
2020/06/09 07:10:16 [RTSP client 127.0.0.1:54764] DESCRIBE
2020/06/09 07:10:16 [RTSP client 127.0.0.1:54764] SETUP
2020/06/09 07:10:16 [RTSP client 127.0.0.1:54764] ERR: there is no stream on path 'proxyStreamtrackID=0'
2020/06/09 07:10:16 [RTSP client 127.0.0.1:54764] disconnected

@aler9 aler9 added the bug Something isn't working label Jun 17, 2020
@aler9
Copy link
Owner

aler9 commented Jun 17, 2020

Hello, in my opinion the bug is in media-stream-library-js, and i also found where it is. When an RTSP client contacts a server, this happens:

  • the client sends a DESCRIBE request to obtain infos about a stream on a certain path
  • the server sends back a SDP document, which describes the stream (how many tracks there are, what is their codec). This document contains, for each track, an URL that is needed to connect to this specific track, that is saved in the control field of the document.

The track URL can be relative, for instance (taken from the RTSP 1.0 specification https://tools.ietf.org/html/rfc2326#appendix-C.2):

a=control:trackID=1

the leading slash is omitted, so if the stream URL is

rtsp://example.com/movie

The resulting track URL is

rtsp://example.com/movie/trackID=1

media-stream-library-js does not insert the leading slash between the absolute URL and the relative URL:
https://github.com/AxisCommunications/media-stream-library-js/blob/master/lib/components/rtsp-session/index.ts#L350

so http://localhost:554/proxyStream/trackID=0 becomes http://localhost:554/proxyStreamtrackID=0.

Try to use http://localhost:554/proxyStream/ as url (with the trailing slash) or edit the library. If it works, we can then send a PR.

@a-detiste
Copy link
Author

Hi,

Thank you so much, adding the slash in the javascript did helped !

@aler9
Copy link
Owner

aler9 commented Jun 28, 2020

This should be definitively fixed in v0.3.10 - i added a trailing slash to the Content-Base header, so editing media-stream-library-js is not needed anymore.

@aler9 aler9 closed this as completed Jun 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants