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
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.
Required to specify
| Variable | Description |
|---|---|
| CAMERA_URL | The video stream url of the camera |
| CAMERA_AUDIO | Whether the camera stream contains an audio stream |
| Variable | Description | Default |
|---|---|---|
| SEGMENT_SIZE | The size of a single segment in seconds | 2 |
| SEGMENT_AMOUNT | The amount of segments stored at once for a single stream | 5 |
| REMOVE_DELAY | The amount of seconds of inactivity before a stream is closed | 60 |
| TIMEOUT_DELAY | The amount of seconds to wait for a stream to open and produce segments | 30 |
| STREAM_ENCODING | The encoder used to encode the stream | libx264 |
| STREAM_FOLDER | The folder in which the hls stream files are stored | /app/streams |
| STREAM_LOW | use 'true' to enable a low quality stream | false |
| STREAM_MEDIUM | use 'true' to enable a medium quality stream | false |
| STREAM_HIGH | use 'true' to enable a high quality stream | false |
If both are specified, ssl is enabled
| Variable | Description |
|---|---|
| SSL_CERT | The ssl certificate path |
| SSL_KEY | The ssl key path |
| Variable | Description |
|---|---|
| PUBLIC_KEY | The public key file to validate the tokens with |
| AUDIENCE | The id of this client the token is meant for |
| CLIENT_ROLE | The role to check for in the token |
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
Content type
Image
Digest
Size
163.5 MB
Last updated
over 5 years ago
docker pull tracktech/forwarder