A request and a possible way to support HLS cameras
  • I am aware that SecuritySpy only supports RTSP streams from cameras and that these are the streams provided by 'real' security cameras i.e. Hikvision, Foscam etc.

    I (and others) have previously requested support for some 'smart home' type cameras and it seems these predominantly use HLS (HTTPS Live Streaming) rather than RTSP. Based on those conversations this is not a repeat of those requests to directly support HLS.

    However I have looked in to the possibility of using a proxy to translate HLS to RTSP. In theory this seems possible and indeed I found many examples of using a proxy to translates RTSP to HLS which in this case is the wrong way round.

    See https://github.com/home-assistant/architecture/issues/113 as an example.

    This post therefore is a request for anyone to respond who knows of an existing solution which can proxy HLS to RTSP and thereby make the stream potentially suitable for use with SecuritySpy.

    Admittedly I am not a programmer but the approach used to proxy RTSP to HLS seems to purely involve rewrapping the stream in a HLS container without the need for re-encoding and therefore seems a simple enough process as evidenced by the numerous solutions to do this. It would therefore to a layman seem the reverse should be equally achievable.

    If there is no such solution already available would the author consider this as an enhancement?
  • I've never tried HLS to RTSP conversion, but VLC may be able to do this. If you go to the "Open Network" option in the File menu in VLC, there is an option called "Stream Output", which will convert the incoming stream to an outgoing stream of your choosing.

    While the video data itself can be the same in a RTSP stream and a HLS stream, the encapsulation methods are very different: RTSP splits up audio and video data into small chunks and sends them via a continuous stream of RTP packets, whereas HSL has text-based playlists that are continually updated, pointing to short MPEG-2 chunks.
  • I'd be interested to know if this works too
  • @Ben
    I will look at VLC at least purely as a test, however I don't regard it as a suitable solution as it requires manual setup and is not as far as I can see able to do multiple streams i.e. for multiple cameras. The ideal solution needs something like the various and numerous RTSP to HLS proxies which can be scripted.

    Hypothetically such a HLS to RTSP proxy could then be embedded as a module in the SecuritySpy.app package.

    Note: All the HLS streams I have seen are MPEG4 which considering HLS originated with Apple makes sense. This does not necessarily preclude the possibility of some being MPEG2.

    I will repeat the fact I am not a programmer :) However have a look at this https://www.npmjs.com/package/node-media-server it sounds like it may be capable of what is required. It would however require a programmer to utilise it.

    Alternatively there are a lot of examples detailing using ffmpeg to transcode a RTSP stream to a HLS stream, as per https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=2441

    Would it be possible to do the reverse?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!