Introduction

Service for work with rtps streams retransmissions.

The luna-streams-retranslator is intended for rtsp streams retransmission into rtsp/hls streams.

The stream retransmission is required to display stream in GUI or to make non-processable stream processable by luna-video-agents.

The luna-streams-retranslator uses mediamtx (MIT License) and ffmpeg (LGPL License) for streams retransmission.

The mediamtx is configured to use JWT token-based authorization for streams accessing, but it allows to use rtsp stream reading and some other features from localhost. To make mediamtx protected and prevent external users from unforeseen access, it is highly recommended to allow access only service port (5250 by default) and hls streaming port (8888) outside from container.

To make HLS-streams links received by user workable it is required to properly set EXTERNAL_LUNA_STREAMS_HLS_RETRANSMISSION_ADDRESS setting with external address and port of luna-streams-retranslator container.

Warning: service horizontal scaling has some peculiarities, see scaling chapter for details.

Example of script to view HLS-retransmission:

<!DOCTYPE html>
<html>
<body>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>

<video id="video" controls></video>

<script>
if (Hls.isSupported()) {
  const video = document.getElementById('video');
  const hls = new Hls({
  xhrSetup: xhr => {
    xhr.setRequestHeader('Authorization', "Bearer <TOKEN>")
  }
})
  hls.attachMedia(video);

  hls.on(Hls.Events.MEDIA_ATTACHED, function () {
    hls.loadSource("http://localhost:8888/<RETRANSMISSION_ID>/index.m3u8");
  });

}
</script>

</body>
</html>