> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Pipeline Configuration

> Post-setup tuning for Livepeer gateway pipelines - video transcoding profiles (JSON encoding ladder, presets, recipes) and AI inference tuning (retry timeouts, model selection, warm vs cold behaviour).

This page covers post-setup tuning mechanisms for video and AI pipelines.

* Video tuning centres on the transcoding profile (output renditions).
* AI tuning centres on retry behaviour, model selection, and inference parameters.

*Quick Reference*

> [tab] Video tuning
>
> <table>
>   <tr>
>     `-transcodingOptions`
>
>     Encoding ladder (output renditions, bitrate, codec, GOP)
>   </tr>
>
>   <tr>
>     `-maxPricePerUnit`
>
>     Per-pixel price cap for orchestrator selection
>   </tr>
>
>   <tr>
>     `-maxSessions`
>
>     Concurrent stream limit (default: 10)
>   </tr>
> </table>

> [tab] AI tuning
>
> <table>
>   <tr>
>     `-httpIngest`
>
>     Enables AI pipeline endpoints on the HTTP port (required)
>   </tr>
>
>   <tr>
>     `-aiProcessingRetryTimeout`
>
>     Failover speed when an orchestrator is slow or unresponsive
>   </tr>
>
>   <tr>
>     `-maxPricePerCapability`
>
>     Per-pipeline, per-model price cap
>   </tr>
> </table>

## Configuration Details

> [tab] Video
>
> ## Video Transcoding Tuning
>
> Pass a profile to the gateway via the `-transcodingOptions` flag, either as a comma-separated list of built-in presets or as a path to a JSON file.
>
> ### Built-in Presets
>
> The simplest option. Presets follow the pattern `P<height>p<fps>fps<aspect>`:
>
> ```bash icon="terminal" theme={null}
> -transcodingOptions P240p30fps16x9,P360p30fps16x9,P720p30fps16x9
> ```
>
> Use built-in presets for development or when the defaults match your use case. For production, a JSON profile gives you control over bitrate, codec, and GOP size.
>
> ### JSON Format
>
> Create a `transcodingOptions.json` file and reference it with `-transcodingOptions /path/to/transcodingOptions.json`.
>
> ```json icon="terminal" theme={null}
> [
> {
>     "name": "1080p",
>     "width": 1920,
>     "height": 1080,
>     "bitrate": 6500000,
>     "fps": 0,
>     "profile": "h264constrainedhigh",
>     "gop": "1"
> },
> {
>     "name": "720p",
>     "width": 1280,
>     "height": 720,
>     "bitrate": 3000000,
>     "fps": 0,
>     "profile": "h264constrainedhigh",
>     "gop": "1"
> },
> {
>     "name": "480p",
>     "width": 854,
>     "height": 480,
>     "bitrate": 1600000,
>     "fps": 0,
>     "profile": "h264constrainedhigh",
>     "gop": "1"
> },
> {
>     "name": "240p",
>     "width": 426,
>     "height": 240,
>     "bitrate": 600000,
>     "fps": 0,
>     "profile": "h264constrainedhigh",
>     "gop": "1"
> }
> ]
> ```
>
> **Field reference:**
>
> <table>
>   <tr>
>     `width`
>
>     Yes
>
>     Output width in pixels
>   </tr>
>
>   <tr>
>     `height`
>
>     Yes
>
>     Output height in pixels
>   </tr>
>
>   <tr>
>     `bitrate`
>
>     Yes
>
>     Output bitrate in bits per second
>   </tr>
>
>   <tr>
>     `name`
>
>     No
>
>     Human-readable label, used in HLS manifest
>   </tr>
>
>   <tr>
>     `fps`
>
>     No
>
>     Target frames per second; `0` preserves source FPS
>   </tr>
>
>   <tr>
>     `profile`
>
>     No
>
>     H.264 profile: `h264constrainedhigh`, `h264high`, `h264main`, `h264baseline`
>   </tr>
>
>   <tr>
>     `gop`
>
>     No
>
>     GOP size in seconds or `"intra"` for keyframe-only; lower values reduce latency
>   </tr>
> </table>
>
> ### Per-platform Setup
>
> > [accordion] Docker
> >
> > Mount the JSON file as a volume and reference it via a path inside the container:
> >
> > ```yaml icon="terminal" theme={null}
> > # docker-compose.yml
> > services:
> > gateway:
> >     image: livepeer/go-livepeer:master
> >     volumes:
> >     - ./transcodingOptions.json:/config/transcodingOptions.json
> >     - gateway-data:/root/.lpData
> >     command: |
> >     -gateway
> >     -transcodingOptions /config/transcodingOptions.json
> >     -rtmpAddr 0.0.0.0:1935
> >     -httpAddr 0.0.0.0:8935
> >     -orchAddr https://orch1.example.com:8935
> > ```
> >
> > Alternatively, write directly to the gateway's data volume:
> >
> > ```bash icon="terminal" theme={null}
> > nano /var/lib/docker/volumes/gateway-lpData/_data/transcodingOptions.json
> > ```
> >
> > And reference it at the container path:
> >
> > ```icon="terminal" theme={null}
> > -transcodingOptions /root/.lpData/transcodingOptions.json
> > ```
>
> > [accordion] Linux (systemd)
> >
> > Create the profile file in your chosen config directory:
> >
> > ```bash icon="terminal" theme={null}
> > sudo nano /usr/local/bin/lptConfig/transcodingOptions.json
> > ```
> >
> > Reference it in your systemd service file (`/etc/systemd/system/livepeer.service`):
> >
> > ```ini icon="terminal" theme={null}
> > ExecStart=/usr/local/bin/livepeer \
> > -gateway \
> > -transcodingOptions /usr/local/bin/lptConfig/transcodingOptions.json \
> > -rtmpAddr 0.0.0.0:1935 \
> > -httpAddr 0.0.0.0:8935
> > ```
> >
> > Reload systemd after any service file change:
> >
> > ```bash icon="terminal" theme={null}
> > sudo systemctl daemon-reload && sudo systemctl restart livepeer
> > ```
>
> > [accordion] Windows
> >
> > Create the profile file in the `.lpData` directory:
> >
> > ```icon="terminal" theme={null}
> > C:\Users\%USERNAME%\.lpData\transcodingOptions.json
> > ```
> >
> > Reference it in your startup `.bat` file:
> >
> > ```bat icon="terminal" theme={null}
> > livepeer.exe ^
> > -gateway ^
> > -transcodingOptions C:\Users\%USERNAME%\.lpData\transcodingOptions.json ^
> > -rtmpAddr 0.0.0.0:1935 ^
> > -httpAddr 0.0.0.0:8935
> > ```
>
> ### Profile Recipes
>
> > [accordion] Standard adaptive bitrate ladder (recommended)
> >
> > Four renditions covering mobile to desktop. Viewers' players switch automatically based on available bandwidth.
> >
> > ```json icon="terminal" theme={null}
> > [
> > { "name": "720p",  "width": 1280, "height": 720,  "bitrate": 3000000, "fps": 0, "profile": "h264constrainedhigh", "gop": "1" },
> > { "name": "480p",  "width": 854,  "height": 480,  "bitrate": 1600000, "fps": 0, "profile": "h264constrainedhigh", "gop": "1" },
> > { "name": "360p",  "width": 640,  "height": 360,  "bitrate": 800000,  "fps": 0, "profile": "h264constrainedhigh", "gop": "1" },
> > { "name": "240p",  "width": 426,  "height": 240,  "bitrate": 400000,  "fps": 0, "profile": "h264constrainedhigh", "gop": "1" }
> > ]
> > ```
>
> > [accordion] Low-latency single rendition
> >
> > For use cases where you need a single output with minimal end-to-end latency (for example, feeding a monitoring pipeline or an AI processing step).
> >
> > ```json icon="terminal" theme={null}
> > [
> > { "name": "480p-lowlat", "width": 854, "height": 480, "bitrate": 1200000, "fps": 0, "profile": "h264baseline", "gop": "0.5" }
> > ]
> > ```
> >
> > `h264baseline` is more compatible with edge players. `"gop": "0.5"` halves the default GOP, reducing segment duration and latency.
>
> > [accordion] High-quality archive (1080p)
> >
> > Single high-quality rendition for recording or post-production.
> >
> > ```json icon="terminal" theme={null}
> > [
> > { "name": "1080p-hq", "width": 1920, "height": 1080, "bitrate": 8000000, "fps": 0, "profile": "h264high", "gop": "2" }
> > ]
> > ```
> >
> > Higher bitrate and larger GOP (less overhead, better compression). Not suitable for live playback - use with `-objectStore` for archival.

> [tab] AI
>
> ## AI Tuning
>
> AI tuning focuses on retry behaviour, model selection, and inference parameters.
>
> > [!NOTE]
> >
> > For AI routing architecture and orchestrator discovery, see [AI Pipelines](/v2/gateways/guides/node-pipelines/ai-pipelines.md). This section explains the tuning parameters you adjust after your AI gateway is running.
>
> ### Retry Timeouts
>
> The `-aiProcessingRetryTimeout` flag controls how long the gateway waits before retrying a failed AI request with another orchestrator. The value accepts Go duration format (`30s`, `1m`, `2m30s`).
>
> ```bash icon="terminal" theme={null}
> -aiProcessingRetryTimeout 30s
> ```
>
> The right value depends on your workload:
>
> <table>
>   <tr>
>     Lightning / LCM models
>
>     `15s`
>
>     Fast inference (4-8 steps), warm models respond in seconds
>   </tr>
>
>   <tr>
>     Standard diffusion (SDXL)
>
>     `30s`
>
>     20-50 inference steps, moderate GPU time
>   </tr>
>
>   <tr>
>     Audio / LLM pipelines
>
>     `45s`
>
>     Variable processing time depending on input length
>   </tr>
>
>   <tr>
>     BYOC / large models
>
>     `60s` or higher
>
>     Custom containers may have cold-start delays or heavy compute
>   </tr>
> </table>
>
> Setting this too low causes the gateway to retry before the orchestrator has loaded the model, producing multiple failed attempts. Setting it too high delays failover when an orchestrator is genuinely unresponsive.
>
> ### Model Selection
>
> The model you request in each API call directly affects latency, quality, and cost.
>
> **Warm vs cold models:**
>
> Orchestrators load models into GPU memory. A warm model responds in milliseconds. A cold model must load from disk first, adding seconds to minutes of latency. During the current beta, orchestrators support one warm model per GPU.
> Check [tools.livepeer.cloud/ai/network-capabilities](https://tools.livepeer.cloud/ai/network-capabilities) before selecting a model. For latency-sensitive applications, confirm your chosen model is warm on at least one connected orchestrator.
>
> **Inference parameters by model family:**
>
> <table>
>   <tr>
>     Lightning / Turbo
>
>     4-8
>
>     1.0-2.0
>
>     Optimised for speed. Too many steps degrades quality.
>   </tr>
>
>   <tr>
>     LCM (Latent Consistency)
>
>     4-8
>
>     1.0-2.0
>
>     Similar to Lightning. Fast, low step count.
>   </tr>
>
>   <tr>
>     Standard SDXL
>
>     20-50
>
>     7.0-9.0
>
>     Higher quality, slower. Too few steps produces noisy output.
>   </tr>
>
>   <tr>
>     SD 1.5 / 2.x
>
>     20-30
>
>     7.0-9.0
>
>     Older generation. Lower VRAM requirements.
>   </tr>
> </table>
>
> Using the wrong step count for a model family produces either slow responses (too many steps on a Lightning model) or degraded image quality (too few steps on a standard model).

## Key Differences

AI gateways do not use RTMP, do not need `-transcodingOptions`, and require `-httpIngest` to enable AI endpoints on the HTTP port. The `-httpIngest` flag is a boolean toggle with no value - it activates AI pipeline endpoints (`/text-to-image`, `/llm`, etc.) on whatever port `-httpAddr` is set to.

<table>
  <tr>
    Ingest

    RTMP (`-rtmpAddr`) + HTTP

    HTTP only (`-httpIngest` required)
  </tr>

  <tr>
    Profile config

    `-transcodingOptions` (encoding ladder)

    No profile - model selected per request
  </tr>

  <tr>
    Session limits

    `-maxSessions` (concurrent streams)

    No session limit flag
  </tr>

  <tr>
    Retry control

    Automatic (per segment)

    `-aiProcessingRetryTimeout` (per request)
  </tr>

  <tr>
    Pricing flag

    `-maxPricePerUnit` (per pixel)

    `-maxPricePerCapability` (per pipeline/model)
  </tr>
</table>

For the full side-by-side comparison, see [AI vs Video Comparison](/v2/gateways/guides/node-pipelines/ai-pipelines.md#ai-vs-video-comparison).

## Configuration Verification

> [tab] Video
>
> **Check startup log for profile loading:**
>
> ```icon="terminal" theme={null}
> I0501 11:07:47.609839  1 mediaserver.go:201] Transcode Job Type: [{480p0 ...} {720p0 ...}]
> ```
>
> **Send a test stream and check the HLS manifest:**
>
> ```bash icon="terminal" theme={null}
> ffprobe http://localhost:8935/<stream-key>.m3u8
> ```
>
> **Update transcoding options at runtime:**
>
> ```bash icon="terminal" theme={null}
> curl -X POST http://localhost:5935/setTranscodingOptions \
> -d "transcodingOptions=P240p30fps16x9,P720p30fps16x9"
> ```

> [tab] AI
>
> **Check the health endpoint:**
>
> ```bash icon="terminal" theme={null}
> curl -s http://localhost:8935/health
> ```
>
> **Send a test inference request:**
>
> ```bash icon="terminal" theme={null}
> curl -X POST http://localhost:8935/text-to-image \
> -H "Content-Type: application/json" \
> -d '{
>     "model_id": "SG161222/RealVisXL_V4.0_Lightning",
>     "prompt": "a test image",
>     "width": 512,
>     "height": 512,
>     "num_inference_steps": 4,
>     "guidance_scale": 1.5
> }'
> ```
>
> A JSON response with an `images` array confirms routing is working.
>
> **Check connected orchestrators and their capabilities:**
>
> ```bash icon="terminal" theme={null}
> curl http://localhost:5935/getOrchestrators
> ```

> [tab] General
>
> **Check effective configuration via livepeer\_cli:**
>
> ```bash icon="terminal" theme={null}
> livepeer_cli -host 127.0.0.1 -http 5935
> ```
>
> Option 1 ("Get node status") shows your current deposit, reserve, connected orchestrators, and active sessions.
>
> **Check gateway status:**
>
> ```bash icon="terminal" theme={null}
> curl http://localhost:5935/status
> ```

## Related Pages

> [card] [AI Pipelines](/v2/gateways/guides/node-pipelines/ai-pipelines.md)
>
> AI routing architecture, orchestrator discovery, and capability matching.

> [card] [Video Pipelines](/v2/gateways/guides/node-pipelines/video-pipelines.md)
>
> Video transcoding pipeline flow, RTMP/HTTP ingest, and orchestrator selection.

> [card] [Pricing Strategy](/v2/gateways/guides/payments-and-pricing/pricing-strategy.md)
>
> Price caps for video and AI, competitive positioning, and ETH volatility handling.

> [card] [Dual Configuration](/v2/gateways/setup/configure.md)
>
> Architecture, port setup, and session management for dual gateways.

> [card] [Scaling](/v2/gateways/guides/advanced-operations/scaling.md)
>
> Resource contention signals, GPU memory pressure, and when to split workloads.

> [card] [Configuration Flags](/v2/gateways/resources/reference/technical/configuration-flags.md)
>
> Complete flag reference for all go-livepeer gateway flags.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.