- merge to main after checks and passing / build
- integrate root /Makefile into /infra/ system and methodology
- continue building of Cdaprod/cdapkg (working copy iphone)
- clean up minio deployment
- clean up tailscale apikey
- reinstitute traefik with tailscale (production networking)
Welcome to your new broadcast control room -- powered by containers, coffee, and code.
Iβm Cdaprod, and this repo is my blueprint for a local-first, software-defined, multi-cam live production pipeline.
Hereβs a cinematic + DevOps-style analogy to explain what Iβve built:
Streamed Intro Script
"Well Iβm here, and youβre watching this video -- so that means one thing: it worked..."
[ iPhone | Nikon | MacBook ]
|
v
βββββββββββββββββββββββ
| NGINX RTMP |
| (Live Ingest Apps) |
βββββββββββ¬ββββββββββββ
v
βββββββββββββββββββββββββββββ
| Composite Scene |
| (FFmpeg Scene Mixer) |
βββββββββββ¬βββββββββββββ¬βββββ
| |
[ RTMP ] [ HLS ]
/ \
YouTube, Twitch Web players, Dash.js
- Multiple RTMP Applications: Handle streams from different sources (
iphone,nikon,macbook). - Composite Scenes: Combine multiple streams into a single output for professional broadcasting.
- Portrait Mode Support: Perfectly scales iPhone portrait streams (9:19.5 aspect ratio).
- Placeholder Image: Automatically displays a "Weβll Be Right Back" image when idle.
- HLS Output: Multi-quality streams for adaptive playback.
- Health Checks and Monitoring: Stay on top of your server's health and stream status.
- Docker: Install Docker on your system.
- Docker Compose: Ensure Docker Compose is available.
-
Clone the Repository:
git clone https://github.com/yourusername/local-docker-rtmp-server.git cd local-docker-rtmp-server -
Add Your Placeholder Image:
- Place your branded image (
cdaprod-be-right-back.jpeg) in thepublic/assetsdirectory. Make it snazzy! π¨β¨
- Place your branded image (
-
Build and Start the Server:
docker-compose up --build
| File | Purpose |
|---|---|
Dockerfile |
Builds the Docker image with Nginx, RTMP, and FFmpeg. |
nginx.conf |
Configures RTMP applications, transcoding rules, and composite scene generation. |
| Application | Functionality |
|---|---|
iphone |
Handles iPhone portrait streams and streams a placeholder when idle. |
nikon |
Handles Nikon camera streams. |
macbook |
Handles MacBook streams. |
scene |
Combines iphone, nikon, and macbook streams into a single broadcast. |
stream |
Outputs the final processed stream for public broadcasting. |
hls |
Generates HLS output for adaptive playback. |
| Port | Description |
|---|---|
1935 |
RTMP (Publishing/Playback) |
18080 |
HTTP (Health/Stats) |
| Device | RTMP URL |
|---|---|
| iPhone | rtmp://192.168.0.21:1935/iphone/<stream-key> |
| Nikon | rtmp://192.168.0.21:1935/nikon/<stream-key> |
| MacBook | rtmp://192.168.0.21:1935/macbook/<stream-key> |
| Composite | rtmp://192.168.0.21:1935/scene/<stream-key> |
- RTMP:
rtmp://192.168.0.21:1935/stream/<stream-key> - HLS:
http://192.168.0.21:18080/hls/<stream-key>.m3u8
- Statistics:
http://192.168.0.21:18080/stat - Health Check:
http://192.168.0.21:18080/health
-
Device IPs:
- iPhone:
192.168.0.10 - MacBook:
192.168.0.9 - Nikon:
192.168.0.187 - RTMP Server:
192.168.0.21
- iPhone:
-
Stream Keys: Make them unique and secure (e.g.,
iphone-live,nikon-pro). -
Placeholder: Your custom "Weβll Be Right Back" image streams when idle. π¨
The following endpoints are triggered by the RTMP server (nginx.conf.template):
/on_publish?app=...&name=...&addr=...&clientid=.../on_publish_done?app=...&name=...&addr=...&clientid=...
Both events are enriched and forwarded to RabbitMQ (stream_events queue).
-
Stream Missing:
- Check device IPs in
nginx.conf. - Ensure stream key matches.
- Check device IPs in
-
Placeholder Not Displaying:
- Verify the image path in
public/assets.
- Verify the image path in
-
High Resource Usage:
- Optimize FFmpeg settings or upgrade hardware.
-
Add More Devices:
- Add applications in
nginx.conf. - Update composite FFmpeg rules.
- Add applications in
-
Adjust Quality:
- Modify resolutions and bitrates in FFmpeg settings.
-
Update IPs:
- Adjust
allow publishrules innginx.conf.
- Adjust
| Directory | Contents |
|---|---|
app/ |
Contains nginx.conf and Dockerfile. |
public/assets/ |
Holds the placeholder image and assets. |
data/recordings/ |
Stores recorded streams. |
tmp/hls/ |
Stores HLS fragments. |
Stream keys uniquely identify streams. Append them to the RTMP URL like this:
rtmp://192.168.0.21:1935/<application>/<stream-key>
| Device | Application | Stream Key | Full URL |
|---|---|---|---|
| iPhone | iphone |
iphone-live |
rtmp://192.168.0.21:1935/iphone/iphone-live |
| Nikon | nikon |
nikon-pro |
rtmp://192.168.0.21:1935/nikon/nikon-pro |
| MacBook | macbook |
macbook-test |
rtmp://192.168.0.21:1935/macbook/macbook-test |
| Composite | scene |
scene-main |
rtmp://192.168.0.21:1935/scene/scene-main |
- Found an issue? Open an issue or make a PR. π
- Need help? Find me on socials. Letβs chat! βοΈ