Skip to content

Getting Started

This guide walks you through creating your first video pipeline with Flex Video.

Prerequisites

Before you begin, ensure Flex Video is running:

# Check service health
curl -k https://<encoder-ip>:3539/flex/health
# Should return: OK

Access the web interface at https://:8443.

Self-Signed Certificate

Flex Video uses a self-signed TLS certificate. Your browser will show a certificate warning on first visit -- this is expected. Accept the warning to proceed. When using curl, add the -k flag to skip certificate verification.

Firefox Users

If the web interface loads but shows a blank page or spinner, you may need to accept the API certificate separately. Open https://<encoder-ip>:3539 in a new tab, accept the warning, then refresh the web interface. See Troubleshooting for details.

Creating Your First Pipeline

Option 1: Using the Web Interface

  1. Open the Flex Video web interface at https://<encoder-ip>:8443
  2. Click the Add Pipeline button
  3. Select a pipeline type from the menu:
    • Simple Pipeline: Single source with encoding and output options
    • Multiview Pipeline: Compose 1-4 video sources into one output stream
    • Advanced Pipeline: Raw GStreamer pipeline string
  4. Configure your pipeline settings
  5. Enable Save Pipeline to persist the configuration (optional)
  6. Click Start Pipeline

Your pipeline appears in the list with a green "Playing" status.

Option 2: Using the REST API

Create a simple pipeline that transcodes an RTSP stream:

curl -k -X POST https://<encoder-ip>:3539/flex/pipeline \
  -H "Content-Type: application/json" \
  -d '{
    "id": "my-first-stream",
    "mode": "simple",
    "on_demand": true,
    "source": {
      "uri": "rtsp://192.168.1.100:8554/live",
      "latency_ms": 200
    },
    "encoding": {
      "codec": "h264",
      "bitrate": 750,
      "width": 1920,
      "height": 1080,
      "fps": 30,
      "quality": 5
    },
    "output": {
      "uri": "rtsp://0.0.0.0:8731/my-first-stream"
    }
  }'

Start the pipeline:

curl -k -X PUT https://<encoder-ip>:3539/flex/pipeline/my-first-stream/play

Option 3: Using a Test Pattern

Don't have a video source? Use a test pattern:

curl -k -X POST https://<encoder-ip>:3539/flex/pipeline \
  -H "Content-Type: application/json" \
  -d '{
    "id": "test-stream",
    "mode": "simple",
    "on_demand": true,
    "source": {
      "uri": "test://smpte"
    },
    "encoding": {
      "codec": "h264",
      "bitrate": 1000,
      "width": 1280,
      "height": 720,
      "fps": 30,
      "quality": 5
    },
    "output": {
      "uri": "rtsp://0.0.0.0:8731/test"
    }
  }'

Available test patterns: smpte, ball, snow, black, white, checkers-1, circular, zone-plate

Hardware-Accelerated Decoding

On supported platforms (Raspberry Pi, NXP i.MX8M Plus, and Intel/AMD x86_64 with VAAPI), Flex Video automatically uses hardware-accelerated video decoders when available, reducing CPU usage. On x86_64 VAAPI systems, hardware-accelerated encoding is also supported. If you experience issues, you can force software decoding by setting FLEX_FORCE_SW_DECODERS=true in /opt/flex/.env. See Hardware Acceleration for details.

Viewing Your Stream

Once your pipeline is playing, you can view the output using any RTSP-compatible player:

ffplay -rtsp_transport tcp rtsp://<encoder-ip>:8731/my-first-stream

See Receiving & Playback for more options including VLC, GStreamer, TAK integration, and audio playback setup.

Pipeline States

Pipelines transition through these states:

State Description
ready Pipeline created, not yet started
playing Pipeline is actively processing video
paused Pipeline is paused (buffers held)
error Pipeline encountered an error

Check pipeline status:

curl -k https://<encoder-ip>:3539/flex/pipeline/my-first-stream/status

Managing Pipelines

From the Web Interface

The Pipeline List page provides quick actions for each pipeline:

  • Play/Stop: Start or stop pipelines with a single click
  • Edit: Modify pipeline configuration
  • Delete: Remove saved pipelines (not available for on-demand pipelines)

From the API

Stop a running pipeline:

curl -k -X PUT https://<encoder-ip>:3539/flex/pipeline/my-first-stream/stop

Delete a pipeline:

curl -k -X DELETE https://<encoder-ip>:3539/flex/pipeline/my-first-stream

Next Steps