Go Live
Go Live sends your program to Facebook, YouTube and other platforms (any RTMP or RTMPS address) from a server in the cloud, on a schedule. The program leaves the main location only once: the Go Live server, a KRZN Live on a VPS, sends it to every platform. An event can also air a video stored on the server, like a telecast.
vMix --SRT/RTMP (LAN)--> central KRZN Live --SRT, once, with a buffer--> Go Live server (cloud) --RTMPS--> FB 1, FB 2, YouTube...
└─ videos of the schedule (played on the server)
The Go Live server runs on its own:
- it goes live by itself at the times of the schedule, even when the central computer is off, asleep or restarting;
- an event airs either the live program from the main location, or a scheduled video already on the server: the live starts with the first frame of the video and ends when the video ends, with no slate, and it keeps streaming when the internet connection of the main location is down;
- with signed-in Facebook pages and YouTube channels, it creates each broadcast ahead (shown as "Upcoming" with its reminder), with the title, description, thumbnail and settings of the event, publishes it when the stream arrives, and ends it after the live;
- for a live program, a buffer (30 seconds by default) hides the cuts of the internet connection of the main location shorter than that, and a slate ("We'll be right back", optional) keeps the platforms live during a longer cut;
- at the end time of a live program, it never cuts a live program: it ends 2 minutes after the program stops (at most one hour after the end time);
- it sends the alerts itself (Telegram, webhook): before an event when the program or the video is missing, when it goes live, when a platform refuses, when it ends.
Install the Go Live server
The Go Live server is the Linux build of the same program, with the configuration in scripts/golive/golive.yml. A small server is enough: it copies the program and the videos without re-encoding them. Free: Oracle Cloud Always Free; or AWS Lightsail (2 TB of traffic per month included). 4 telecasts a week on 3 platforms send about 280 GB a month at 6 Mbit/s.
| Port | Use |
|---|---|
| 9890/UDP | SRT: the program from central |
| 9987/TCP | Control API (HTTPS), used by central |
- Build the Linux binary:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o krznlive .(GOARCH=arm64for an ARM server, like Oracle Ampere). - Copy
krznliveand the files ofscripts/goliveinto a folder on the server. - Run
sudo GOLIVE_PASS=<a long password> sh install-golive.sh. The installer creates a self-signed certificate for the Control API, prints its fingerprint, and installs FFmpeg (it plays the videos of the schedule). On a server that already runs the KRZN Live edge, use other ports:API_PORT=9988 SRT_PORT=9891, andMEMORY_MAX=200Mon a small server. Updates don't needGOLIVE_PASS; they are refused while live (FORCE=1to update anyway). - Allow the ports in the firewall of the provider.
Logs: journalctl -u krznlive-golive. The configuration, videos, thumbnails and slates are in /opt/krznlive-golive/golive-hub/.
Set up central
On the Go Live page of the dashboard:
- Go Live server: the path with the program (the stream of vMix), optionally a 4K version of it, the address of the server, the password and the fingerprint printed by the installer, and the buffer. These are the
goLive*settings ofkrznlive.yml. - Platforms: one per account (for instance FB 1, FB 2 and YouTube). Each one is either signed in (recommended) or uses a stream key. Quality: 1080p, or 4K for YouTube (Facebook live is 1080p at most).
- Videos and thumbnails: add videos from the Recordings (a recorded service or a saved clip) or from a file, and thumbnails (JPEG, PNG; 1280x720 is best).
- Schedule: the events (weekly on some days, or once on a date), what they air (live program or scheduled video), the time, the platforms, and their settings.
The configuration is saved in golive.json next to krznlive.yml (and copied to the other computers of a cluster) and sent to the Go Live server, with the alert destinations of Settings > Alerts. Stream keys, tokens and secrets are never shown again in the dashboard.
The Go Live now button (with the program or a video) and End live work at any time. An event of the schedule ended with End doesn't start again.
Sign in to Facebook and YouTube
The sign-in happens on the web page of the Go Live server (in the cloud), which keeps the accounts (accounts.json on the server: central only knows their names). The broadcasts are created and started even when central is off.
The web page is published with HTTPS by nginx (location /golive/ to 127.0.0.1:9989, see scripts/edge/nginx-intercom.conf); its public address is goLiveHubURL in golive.yml (set by the installer with PUBLIC_URL=https://call.example.com/golive). It has its own password, set on the Go Live page of central. From it, the team sees the state, the platforms and the next telecasts, goes live and ends, from any phone or computer.
The sign-in uses your own apps, created once:
- Google: in Google Cloud Console, create a project, enable "YouTube Data API v3", create an OAuth client of type Web application with
<goLiveHubURL>/oauth/callbackas authorized redirect URI (for instancehttps://call.artsministy.online/golive/oauth/callback), and publish the consent screen (In production; in Testing, the sign-in expires every 7 days). - Facebook: in Meta for Developers, create an app with Facebook Login, and add the same address to "Valid OAuth Redirect URIs". The person who signs in must be an admin of the page and of the app. Live videos through the API go to pages.
Enter the IDs and secrets under "Sign-in apps" on the Go Live page, then use Sign in with YouTube / Sign in with Facebook on each platform (central asks the server for a one-time link and opens it), or the same buttons on the web page of the server. For YouTube, the server creates a stream named "KRZN Live Go Live" on the channel and uses it for every broadcast.
Settings of an event
Each event has its own settings (open Settings on the event). Save them as a template to reuse them; weekly events can change the title, description, thumbnail and video of one date.
| Setting | YouTube | |
|---|---|---|
Title ({date} is replaced by the date), description, thumbnail |
yes (the thumbnail as the cover of the "Upcoming" post) | yes |
| Announce ahead (create the broadcast this long before) | yes (7 days at most) | yes |
| Who can watch | minimum age, countries | public, unlisted, private; made for kids |
| Embedding | yes | yes |
| After the live | keep the video, or remove it | - |
| Category, tags, language, playlist, license, latency, rewind (DVR) | - | yes |
Chat options, captions and the viewer count are set on the platforms.
Scheduled videos
A video is prepared on central: copied when it's already H.264 and AAC, converted otherwise (with the graphics card), plus a 1080p copy of a 4K video for Facebook. It's then uploaded to the server in parts: an upload cut by the internet continues where it stopped, and the file is used only once its checksum matches. Upload it the day before: about 5 GB for 2 hours at 1080p. One video can be used by several events.
15 minutes before an event, the server checks that its video is there. At the time, if the video isn't complete on the server, the event doesn't go live and the team gets an alert. If the player stops by accident, it continues where the video was.
4K
A platform set to 4K (YouTube) receives the 4K program (goLiveSource4K: a second stream from vMix in 4K), or the 4K original of a scheduled video. When the 4K program is missing, it receives the 1080p one. Facebook always receives 1080p. The main location needs enough upload for both programs (about 30 to 45 Mbit/s, less with HEVC for the 4K one).
The buffer and the slate
The buffer (goLiveBuffer, 30 s by default) is the latency of SRT between central and the server: lost packets are sent again until they are that old, and the connection survives a cut of the internet shorter than that. The platforms receive the live program that much later. It was tested with cuts of 5 seconds and a buffer of 8 seconds: no interruption, same connection. The server keeps a silent connection for 60 seconds (readTimeout in golive.yml).
The slate (optional, live programs only) is made on central in the format of the program, when the program arrives while nothing is live. The switch between the program and the slate doesn't disconnect the platforms.
Cluster
In a cluster, only the main computer sends the program and manages the Go Live server. Stream the program from vMix to every computer (vMix has up to 3 stream outputs): after a takeover, the new main computer sends it. Scheduled videos don't depend on central at all.
Limits
- The Go Live server doesn't re-encode the program: vMix must send what platforms accept (H.264 and AAC, a keyframe every 2 seconds at most, video and audio).
- A cut longer than the buffer shows the slate (or nothing, without slate); the missed part is in the recording at central.
- Facebook and YouTube decide which settings their API accepts for each kind of account; a setting refused is reported on the Go Live page and stays editable on the platform.
- If the server itself stops, the live stops.