Sign inSign up

tracktech/forwarder

By tracktech

•Updated over 5 years ago

Image
1

861

tracktech/forwarder repository overview

⁠Forwarder

⁠Run

Run the following command to startup the compose file in the current directory with an example stream

docker-compose up --build

The stream can then be accessed at http://localhost/stream.m3u8

⁠Architecture

We use ffmpeg to pull the video stream and encode it to an HLS stream. This is a http based streaming protocol that allows adaptive bitrate streaming. We use tornado to serve the files and handle authentication, to match the rest of the project.

⁠Environment options

⁠Camera

Required to specify

VariableDescription
CAMERA_URLThe video stream url of the camera
CAMERA_AUDIOWhether the camera stream contains an audio stream
⁠Streaming
VariableDescriptionDefault
SEGMENT_SIZEThe size of a single segment in seconds2
SEGMENT_AMOUNTThe amount of segments stored at once for a single stream5
REMOVE_DELAYThe amount of seconds of inactivity before a stream is closed60
TIMEOUT_DELAYThe amount of seconds to wait for a stream to open and produce segments30
STREAM_ENCODINGThe encoder used to encode the streamlibx264
STREAM_FOLDERThe folder in which the hls stream files are stored/app/streams
STREAM_LOWuse 'true' to enable a low quality streamfalse
STREAM_MEDIUMuse 'true' to enable a medium quality streamfalse
STREAM_HIGHuse 'true' to enable a high quality streamfalse
⁠SSL

If both are specified, ssl is enabled

VariableDescription
SSL_CERTThe ssl certificate path
SSL_KEYThe ssl key path
⁠Authentication
VariableDescription
PUBLIC_KEYThe public key file to validate the tokens with
AUDIENCEThe id of this client the token is meant for
CLIENT_ROLEThe role to check for in the token

⁠Example compose

version: "3.8"

services:
  forwarder:
    image: tracktech/forwarder
    environment:
      CAMERA_URL: // Video stream url
      CAMERA_AUDIO: // Wether the stream has audio
      STREAM_LOW: "true"
    ports:
      - published: 80
        target: 80

Tag summary

Content type

Image

Digest

Size

163.5 MB

Last updated

over 5 years ago

docker pull tracktech/forwarder