Live Broadcasts
Photogram Live and Vibez Live let players broadcast live video. Two steps: turn it on, then set up the relay so it runs smoothly. Bodycams are different and need none of this (see below).
Step 1: Turn it on
In configs/photogram.lua, find Live and set:
Live = {
Enabled = true,
},Restart the resource. Players now have a Go Live button. That is all it takes to work.
This works, but it can cut out
With only Step 1, video runs through your game server, and on a busy stream a viewer can drop to a black "No picture from this live" screen. Step 2 fixes that. Do it before players rely on Live.
Step 2: Set up the relay (stops the cutting out)
The relay is a small server that carries the video the right way. Set it up once and the cutting out is gone.
1. Turn the relay on. In configs/media.lua:
Enabled = true,2. Restart, and read the console for the port:
[sd-phone:media] relay ready at ws://127.0.0.1:305673. Put a domain in front of that port, with HTTPS.
The relay is only listening on a plain local address on your server, and phones refuse to connect to that. A phone will only talk to a relay over a secure wss:// address backed by a real certificate. To give it one, you point a domain at your server and run a small program called a reverse proxy in front of the relay: it accepts the secure public connection from players and quietly hands it to the relay on 127.0.0.1:30567.
You need two things.
- A domain or subdomain pointed at your server. Add a DNS
Arecord, for examplemedia.yourserver.compointing at your server's public IP. Your domain registrar or Cloudflare DNS (free) does this. - A reverse proxy on the server. Pick one below. If you have never done this, use Caddy.
Easiest, Caddy (free, automatic certificate). Caddy is a tiny web server that fetches and renews the HTTPS certificate for you, so there is nothing to buy or configure. Install it, make a file named Caddyfile with the three lines below, then run caddy run in that folder (or caddy start to keep it running in the background):
media.yourserver.com {
reverse_proxy 127.0.0.1:30567
}That is the whole setup. Caddy gets the certificate on the first connection. More detail in the Caddy reverse-proxy quick-start.
If you already run nginx. Add a server block, using your own certificate (a free one from Let's Encrypt via certbot). The Upgrade and Connection lines are required, without them the connection the relay needs will not open:
server {
listen 443 ssl;
server_name media.yourserver.com;
ssl_certificate /etc/letsencrypt/live/media.yourserver.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/media.yourserver.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:30567;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}Behind Cloudflare's proxy (orange cloud)? Turn on Network → WebSockets for that domain in the Cloudflare dashboard, or live streams will not connect. Nothing else changes.
media-server/README.md in the resource has these same proxy examples plus how to run the relay as a background service.
4. Tell the phone the address. In server.cfg:
set sd_phone_relay_url "wss://media.example.com/ws"5. Restart and check. Open a live stream. A small Relay label on the picture means it worked. Server means it is still on the old path.
Two rules the browser will not bend
The address must start with wss://, and the certificate must be real (a free Let's Encrypt or Cloudflare one is fine). A plain ws:// or a self-signed certificate will not connect.
Just testing on your own PC? Skip the domain and use set sd_phone_relay_loopback 1 instead. Running the relay on a separate machine? Set SelfHost = false in configs/media.lua and follow media-server/README.md.
Settings
configs/photogram.lua under Live. Vibez Live uses the same behaviour and the same relay.
| Setting | Default | What it does |
|---|---|---|
Enabled | false | Lets players broadcast |
MaxViewers | 50 | Viewers per stream (0 = unlimited) |
Bitrate | 900000 | Quality in bits/s. Higher looks better and costs more |
Fps | 25 | Frame rate |
TimesliceMs | 250 | Leave this alone |
KeyframeMs | 4000 | How fast someone joining mid-stream sees a picture |
Without the relay, every viewer costs your server one copy of the stream (about Bitrate each). The relay removes that cost, so it is worth setting up once you have real audiences.
Fixes
| Problem | Fix |
|---|---|
| Black "No picture from this live" | Set up the relay (Step 2). No relay yet? Lower Bitrate in configs/photogram.lua. |
| Label says Server, you wanted Relay | The relay address is missing or your players cannot reach it. Recheck sd_phone_relay_url and that the domain loads. |
| Relay will not connect | The address must be wss:// with a real certificate. ws:// and self-signed do not work. |
| No Go Live button | Live.Enabled is still false in configs/photogram.lua. |
Not the same as video calls
Live does not use TURN. TURN is only for video calls, set up in installation step 5. Adding TURN keys does nothing for Live. The relay above is what Live needs.
Why the difference: a video call is one person to one person, so TURN can relay it. A broadcast is one person to many, and no home connection can upload a copy to every viewer. The relay is the thing that takes one upload and sends it to everyone.
Bodycams
MDT bodycams and dashcams do not stream video, so nothing on this page affects them. The watching terminal draws the officer's view in its own game engine. The only setting is how many terminals may watch one officer at once, MaxViewers in configs/bodycam.lua.
