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 http://localhost:3539/flex/health
# Should return: OK

Access the web interface at http://localhost:8080.

Creating Your First Pipeline

Option 1: Using the Web Interface

  1. Open the Flex Video web interface at http://localhost:8080
  2. Click New Pipeline
  3. Configure your pipeline:
  4. Pipeline ID: Enter a unique name (e.g., my-first-stream)
  5. Source: Enter your video source URI
  6. Encoding: Select codec and quality settings
  7. Output: Configure where to send the transcoded stream
  8. Click Create
  9. Click Play to start the pipeline

Option 2: Using the REST API

Create a simple pipeline that transcodes an RTSP stream:

curl -X POST http://localhost: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": 2000,
      "width": 1920,
      "height": 1080,
      "fps": 30,
      "quality": 7
    },
    "output": {
      "uri": "rtsp://0.0.0.0:8731/my-first-stream"
    }
  }'

Start the pipeline:

curl -X PUT http://localhost:3539/flex/pipeline/my-first-stream/play

Option 3: Using a Test Pattern

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

curl -X POST http://localhost: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

Viewing Your Stream

Once your pipeline is playing, view the output stream:

vlc rtsp://localhost:8731/my-first-stream
ffplay -rtsp_transport tcp rtsp://localhost:8731/my-first-stream
gst-launch-1.0 rtspsrc location=rtsp://localhost:8731/my-first-stream ! decodebin ! autovideosink

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 http://localhost:3539/flex/pipeline/my-first-stream/status

Stopping and Deleting

Stop a running pipeline:

curl -X PUT http://localhost:3539/flex/pipeline/my-first-stream/stop

Delete a pipeline:

curl -X DELETE http://localhost:3539/flex/pipeline/my-first-stream

Next Steps