Pipelines¶
Pipelines are the core of Flex Video, defining how video is ingested, processed, and delivered.
Pipeline Types¶
SimplePipeline¶
SimplePipeline provides a high-level configuration interface:
Best for:
- Standard transcoding workflows
- Users who don't need GStreamer knowledge
- Consistent, maintainable configurations
AdvancedPipeline¶
AdvancedPipeline accepts raw GStreamer pipeline strings:
{
"id": "custom-pipeline",
"mode": "advanced",
"raw_pipeline": "videotestsrc ! videoconvert ! x264enc ! rtph264pay ! udpsink host=239.1.1.1 port=5004"
}
Best for:
- Custom processing requirements
- Unusual source/sink combinations
- GStreamer experts
Source Configuration¶
Supported Sources¶
| Scheme | Description | Example |
|---|---|---|
rtsp:// | RTSP stream | rtsp://camera.local:8554/live |
udp:// | UDP unicast/multicast | udp://239.1.1.1:5004 |
file:// | Local file | file:///video/sample.ts |
test:// | Test pattern | test://smpte |
RTSP Sources¶
Latency tuning:
| Network | Recommended latency_ms |
|---|---|
| Wired LAN | 50-100 |
| WiFi | 200-500 |
| WAN/Internet | 500-2000 |
UDP Multicast Sources¶
Network Interface
Set network_interface when using multicast to ensure packets arrive on the correct interface.
Test Patterns¶
Available patterns for testing without a real source:
| Pattern | Description |
|---|---|
smpte | SMPTE color bars |
ball | Bouncing ball |
snow | Random noise |
black | Solid black |
checkers-1 | 1px checkerboard |
circular | Circular pattern |
zone-plate | Zone plate |
Encoding Configuration¶
"encoding": {
"codec": "h264",
"bitrate": 2000,
"width": 1920,
"height": 1080,
"fps": 30,
"quality": 7
}
Codecs¶
| Codec | License | Efficiency | Compatibility |
|---|---|---|---|
h264 | Free | Good | Excellent |
h265 | Licensed | Better | Good |
av1 | Free | Best | Limited |
Bitrate Guidelines¶
| Resolution | Low | Medium | High |
|---|---|---|---|
| 720p | 1000 kbps | 2000 kbps | 4000 kbps |
| 1080p | 2000 kbps | 4000 kbps | 8000 kbps |
| 4K | 8000 kbps | 15000 kbps | 25000 kbps |
Quality Preset¶
The quality setting (1-10) balances encoding speed vs. output quality:
| Range | Use Case |
|---|---|
| 1-3 | Real-time, low latency |
| 4-6 | Balanced (recommended) |
| 7-10 | High quality, archival |
Output Configuration¶
RTSP Output (Recommended)¶
Outputs to the built-in RTSP server. Clients connect to rtsp://server-ip:8731/stream-name.
UDP Multicast Output¶
MTU Settings¶
| Value | Use Case |
|---|---|
| 1200 | VPN, tunnels |
| 1400 | Default, safe |
| 1500 | Standard Ethernet |
| 9000 | Jumbo frames |
Optional Features¶
Overlays¶
Add text or timestamp overlays:
Transform¶
Apply video transformations:
Rotation values: 0, 90, 180, 270
Crop¶
Crop the video frame:
Geolocation¶
Set static or dynamic position:
"geolocation": {
"latitude": 38.8977,
"longitude": -77.0365,
"altitude": 100.0,
"heading": 45.0,
"is_dynamic": false
}
Set is_dynamic: true when position will be updated from KLV metadata.
Pipeline Lifecycle¶
┌─────────┐ play ┌─────────┐
│ ready │──────────────►│ playing │
└─────────┘ └─────────┘
▲ │
│ stop │
└─────────────────────────┘
On-Demand vs Auto-Start¶
| Setting | Behavior |
|---|---|
on_demand: true | Pipeline created in ready state, must call /play |
on_demand: false | Pipeline starts immediately on creation |
Pipeline Limits¶
Pipeline limits are controlled by your license:
- Check limits:
GET /flex/licensed - Exceeding limits returns HTTP 402
Best Practices¶
- Use descriptive IDs:
entrance-cam-h264notpipe1 - Match resolution to source: Don't upscale unnecessarily
- Set appropriate latency: Higher for unreliable networks
- Use RTSP output: Better client compatibility than UDP
- Monitor pipeline state: Use SSE for real-time updates