# Live RTMP/SRT ingest and restream

Source: https://docs.quake.ai/resources/iac-templates/live-ingest-restream
Markdown: https://docs.quake.ai/resources/iac-templates/live-ingest-restream.md

---

# Live RTMP/SRT ingest and restream

This pattern composes Compute, Network, and Object Storage.



Quake AI does not provide managed live video ingest or transcoding. This template provisions a customer-owned VM running NGINX-RTMP or SRS on CPU. Transcoding is CPU-only, so multi-rung ABR ladders are bounded. Prefer pass-through restream to downstream platforms where possible.



## What this template deploys

- Private network and router for the ingest instance
- One ingest VM with cloud-init that installs NGINX-RTMP (default) or SRS
- **1 floating IP** on the ingest port for public RTMP (1935/tcp) and SRT (configurable UDP) pushes
- Security group rules scoped to `encoder_cidr` for ingest and `admin_cidr` for SSH
- Optional Object Storage bucket for HLS replay when `enable_hls_recording` is true

Point OBS or a hardware encoder at the `rtmp_publish_url` output. The instance restreams to each URL in `restream_targets`.

## Prerequisites

- OpenTofu or Terraform >= 1.6.0
- OpenStack application credentials (`source openrc.sh`)
- One floating IP available in your project quota
- EC2-compatible Object Storage credentials when enabling HLS replay. See [S3 storage ACL template](/resources/iac-templates/s3-storage-acl).

## Parameters

| Parameter | Description | Default |
| --- | --- | --- |
| `key_name` | SSH keypair name (must already exist in your project) | required |
| `ingest_server` | `nginx-rtmp` or `srs` | `nginx-rtmp` |
| `ingest_flavor` | CPU flavor for ingest/restream work | `c2a.large` |
| `encoder_cidr` | CIDR allowed to push RTMP/SRT | `0.0.0.0/0` |
| `admin_cidr` | CIDR allowed for SSH | `0.0.0.0/0` |
| `application_name` | RTMP application name | `live` |
| `stream_key` | Optional publish key | `""` |
| `restream_targets` | Downstream RTMP push URLs | `[]` |
| `enable_hls_recording` | Upload HLS segments to Object Storage | `false` |
| `hls_bucket_name` | Replay bucket (when recording enabled) | `""` |
| `s3_access_key` / `s3_secret_key` | EC2-compat credentials for replay upload | required when recording |
| `image_name` | Boot image name | `Ubuntu-24.04` |
| `external_network` | Shared external network for router gateway and floating IP | `PublicStatic` |
| `private_cidr` | Private subnet CIDR for the ingest instance | `192.168.75.0/24` |
| `instance_name` | Ingest instance display name | `live-ingest` |
| `srt_port` | UDP port for SRT ingest when using srs | `10080` |
| `s3_endpoint` | Quake AI S3-compatible endpoint URL | `https://object.us-east-1.rumble.cloud` |
| `s3_region` | S3 region identifier for the AWS provider | `us-east-1` |

## Cost and sizing

Size `ingest_flavor` for the number of simultaneous restream targets and any CPU transcoding you enable. The template allocates exactly one floating IP. Object Storage charges follow your plan allowance for stored replay segments.

## When to use this pattern

Accept a single RTMP or SRT push from OBS or a hardware encoder and fan out to YouTube, Twitch, or custom RTMP endpoints without a managed live-video SaaS. For batch audio processing, see the [audio post-production worker](/resources/iac-templates/audio-worker) template.

## Estimated cost

<PricingCompanion
  components={[
    { kind: "template", slug: "live-ingest-restream", required: true },
  ]}
/>

## Template source

<TemplateSource slug="live-ingest-restream" />

<TemplateVariations base="live-ingest-restream" />

<TemplateResourceMap template="live-ingest-restream" format="opentofu" />

## Outputs

| Output | Description |
| --- | --- |
| `ingest_floating_ip` | Public IP for encoder pushes |
| `rtmp_publish_url` | Base RTMP URL (`rtmp://FIP/live`) |
| `floating_ip_count` | Always `1` for this pattern |
| `hls_bucket` | Replay bucket name when recording is enabled |

## See also

- [Deploy the live ingest template](/resources/deployments/deploy-live-ingest-restream-template)
- [S3 storage ACL template](/resources/iac-templates/s3-storage-acl)
- [Live streaming and restream solution](/resources/solutions/live-streaming-and-restream)
