Skip to main content

Examples

End-to-end recipes covering the most common deployment patterns.

Single Stream with Display

Detect objects in a video file and show results on screen.

pipeline:
name: "Display Demo"

streams:
- uri: "file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4"

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

sinks:
width: 1280
height: 720
outputs:
- type: "display"

Single Stream with Kafka Analytics

Run detection and send results to Kafka (no video output).

pipeline:
name: "Kafka Analytics"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

- type: "tracker"
tracker_type: "NvSORT"

sinks:
width: 1920
height: 1080
outputs:
- type: "fps"
- type: "kafka"
broker: "kafka-host:9092"
topic: "detections"

Multi-Stream with Tiled RTSP Output

Two cameras combined into a single tiled RTSP stream.

pipeline:
name: "Tiled Output"

streams:
- uri: "rtsp://camera1/live"
source_id: 0
- uri: "rtsp://camera2/live"
source_id: 1

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

- type: "tracker"
tracker_type: "IOU"

sinks:
width: 1280
height: 720
outputs:
- type: "rtsp"
url: "rtsp://localhost:8554/tiled"
codec: "h264"
bitrate: 4000000

Multi-Stream with Per-Stream Outputs

Two cameras, each with its own RTSP output plus a tiled display.

pipeline:
name: "Per-Stream Output"

streams:
- uri: "rtsp://camera1/live"
source_id: 0
- uri: "rtsp://camera2/live"
source_id: 1

models:
- name: "yolo-detector"
type: "detector"
architecture: "yolo"
onnx_file: /path/to/model.onnx
label_file: /path/to/labels.txt

- type: "tracker"
tracker_type: "NvSORT"

sinks:
width: 1280
height: 720
outputs:
- type: "display"
- type: "rtsp"
mode: "multi"
codec: "h264"
bitrate: 4000000
streams:
- source_id: 0
url: "rtsp://localhost:8554/cam0"
- source_id: 1
url: "rtsp://localhost:8554/cam1"

Detector + Classifier Chaining

Detect vehicles, track them, then classify their color.

pipeline:
name: "Chaining Pipeline"

streams:
- uri: "file:///path/to/video.mp4"
source_id: 0

models:
# Primary detector
- name: "vehicle-detector"
type: "detector"
architecture: "yolo"
onnx_file: /path/to/vehicle_model.onnx
label_file: /path/to/vehicle_labels.txt
active_classes: [0, 2]

# Tracker between detector and classifier
- type: "tracker"
tracker_type: "IOU"

# Secondary classifier on detected objects
- name: "color-classifier"
type: "classifier"
onnx_file: /path/to/color_model.onnx
label_file: /path/to/color_labels.txt
operate_on: "vehicle-detector"
operate_on_classes: [0, 2]

sinks:
width: 1280
height: 720
outputs:
- type: "display"