Accessing RTSP Stream from SS Web Server

kappa12
edited June 2019 in SecuritySpy
I'm trying to access the RTSP stream from the SS web server, but I haven't had any luck so far. I've read the spec at https://www.bensoftware.com/securityspy/web-server-spec.html, which leads me to believe that this is the correct URL to use:

http://user:password@ss-server-ip-address:8000/++stream?cameraNum=1&codec=h264

However, when I access this URL on my SS instance, I get a 404 error. I've confirmed that the credentials I'm using are correct and that the web server is working b/c I can access the still JPEG image successfully:

http://user:password@ss-server-ip-address:8000/++image?cameraNum=1

I've tried several options while troubleshooting, but none made a difference:

• Using "rtsp://" instead of "http://"
• Using HTTPS
• Enabling the "Recompress video data from this device" option
• Specifying the height and width parameters in the request
• Authenticating as a user with admin privileges

Can anyone point me in the right direction on how to access the RTSP stream from SS?

Comments

  • 404 means "resource not found" and indicates something wrong with the request you are using.

    What client software are you using to receive the stream? For example, if you are using VLC, the URL to use would be something like this:

    rtsp://192.168.1.2:8000/++stream?cameraNum=1&codec=h264

    (I've just checked this here and it works for me in VLC, using the "Open Network..." option in the File menu).
  • Hi Ben,

    Thanks for the info. Providing me with the example URL helped because, as obvious as it sounds, I wasn't entirely sure if I should be specifying "http" or "rtsp" for the URL prefix. It wasn't explicitly stated on the web API spec page, so I tried both but neither appeared to work. After seeing your example URL and using "rtsp" and trying again, I discovered that VLC was timing out for me because it was switching to use TCP transport. I switched to a different machine and the timeouts didn't occur, so I guess it was a client issue on the original machine.

    Regarding the client I'm using, I'm trying set up viewing via the "Homebridge FFMPEG Camera" plugin for Homebridge. I was able to get this to work by adding '-rtsp_transport tcp' to the configuration parameters. Once that was added, everything worked as expected.

    On the web server spec page, it might be worth specifying the URL prefix for requests that are not done via HTTP. I know it should be obvious when RTSP is needed, but the delay/timeout I was having with my local VLC instance made me think I was doing the wrong thing.

    Thanks again for the help!
  • Great to hear you got this working!

    The web server specifications page does indicate that this request should be made using RTSP. The thing is, the format specifier at the start of the URL isn't really part of the server specification - SecuritySpy itself doesn't need it - it's purpose is to tell the client which protocol to use. But perhaps I'll add a note to the document, as it may help others.

    I'm not sure why you were having problems in the first place, as SecuritySpy does use TCP transport for RTSP streams. Perhaps there was some other configuration issue with VLC on that machine. If you delete the VLC preferences this may solve it.
  • Hey Ben, I am also struggling to grab the rtsp stream from the ss server. I want to place in a m3u file. With the rtsp url, do I include username:password ahead of your example ?
    I have tried that in VLC and I get an error 'Nothing to Play'
  • Hi @kaps, firstly make sure you are using the correct camera number. This can be seen in the Camera Info window in SecuritySpy (if you don't see this column, click the header bar where you see the column names and a menu will pop up that allows you to add it).

    If you don't specify a username/password in the URL, VLC should ask you for one. Otherwise you can add one to the URL using the method described under "Authentication in URL" in the SecuritySpy Web Server Specification document.
  • Thanks Ben. For some reason the non default port I was using in the RTSP url wasn't working. After I enable 8000, it works.

    With regarding selecting a group view, what is the correct syntax. Ive tried the below url, and it only shows the first camera

    rtsp://username:password/live?groupSelect1=test&cameraNum=0&cameraNum=1&cameraNum=2&cameraNum=3
  • Good to hear you have got this working.

    Each RTSP stream is for a single camera only - SecuritySpy cannot produce a single stream with multiple cameras composed together.