project-management-only/home-tv-station#14: Publish only mode



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.3
Created: 05-Aug-24 20:33



Description

I'd like to add a flag to the image to only start the publishing process rather than standing servers up.

That way, it'll be possible to run multiple channels - one standard pod can be spun up, with some others started in publish only mode (pushing into the one running the server).

Pods in publish only mode won't be able to use dynamic publishing or the like



Toggle State Changes

Activity


assigned to @btasker

The advantage of doing it this way, rather than allowing the pod to run several publishers, is that the load can be spread across nodes rather than having a single pod demand a large number of resources

Introducing a new env var: CONTAINER_MODE

Values:

  • combined (default)
  • production: only run the publisher process
  • server: only run Nginx

With this change, then it's possible to stand up a pod to act as a streaming server and then several pods to stream different channels in:

Pod 1 env vars

CONTAINER_MODE="server"
RTMP_APPLICATION="mytv"

Assuming that TCP port 1935 on pod 1 is fronted by a service called rtmp-service, we'd then create publishers using something like:

Pod 2 env vars

CONTAINER_MODE="publisher"
RTMP_SERVER="rtmp-service"
RTMP_APPLICATION="mytv"
RTMP_STREAMNAME="one"

Pod 3 env vars

CONTAINER_MODE="publisher"
RTMP_SERVER="rtmp-service"
RTMP_APPLICATION="mytv"
RTMP_STREAMNAME="two"

This would publish two streams

  • rtmp://[server]/mytv/one
  • rtmp://[server]/mytv/two

Both would also be available using HLS. However, it wouldn't be possible to:

  • Use the next api
  • Use dynamic publishing start/stop

Things like broadcast windows and the test card could still be used - the timings just need to be set in each pod.

verified

mentioned in commit github-mirror/Home-TV-Station@1549f1cd20508d8db8c92f2353707688e9de0c3e

Commit: github-mirror/Home-TV-Station@1549f1cd20508d8db8c92f2353707688e9de0c3e 
Author: B Tasker                            
                            
Date: 2024-08-06T08:14:17.000+01:00 

Message

feat: introduce ability to bring container in publisher or server only mode (project-management-only/home-tv-station#14)

+33 -18 (51 lines changed)
verified

mentioned in commit github-mirror/Home-TV-Station@472aab8d900bc32c98b4ac7cf6694d17eac3ccad

Commit: github-mirror/Home-TV-Station@472aab8d900bc32c98b4ac7cf6694d17eac3ccad 
Author: B Tasker                            
                            
Date: 2024-08-06T08:24:15.000+01:00 

Message +18 -0 (18 lines changed)