Skip to main content

Multistream Inference

gst-ai-multistream-inference processes multiple video streams simultaneously, with independent object detection per stream. Suitable for surveillance and multi-channel analytics.

Prerequisites

Steps

1. Install ffmpeg and Transcode Video

The default video format has compatibility issues with Q900's GStreamer rendering pipeline. Transcode to baseline H.264:

radxa@airbox$
sudo apt install -y ffmpeg
sudo ffmpeg -y -i /etc/media/video.mp4 \
-c:v libx264 \
-profile:v baseline \
-level 3.1 \
-pix_fmt yuv420p \
-vf scale=640:480 \
-r 30 \
-g 30 \
-keyint_min 30 \
-bf 0 \
-an \
-movflags +faststart \
/etc/media/video_safe.mp4

Key parameters:

ParameterPurpose
-profile:v baselineDisable B-frames, avoiding qtdemux dmabuf negotiation conflicts
-bf 0Turn off B-frames
-keyint_min 30 -g 301-second keyframe interval for reliable seeking
-movflags +faststartMoves moov atom to front, speeding up decoder init
-anRemove audio to reduce file size

2. Create Config File

All streams reference the same transcoded video:

radxa@airbox$
python3 -c "
import json
with open('/etc/configs/config-multistream-inference.json') as f:
c = json.load(f)
c['input-file-path'] = ['/etc/media/video_safe.mp4'] * 16
json.dump(c, open('/tmp/cfg_multistream.json', 'w'), indent=2)
print('config written')
"

3. Run

radxa@airbox$
gst-ai-multistream-inference --config-file=/tmp/cfg_multistream.json

Press Ctrl + C to stop.

Expected Output

HTP Core Count = 2
Run app with model: /etc/models/yolox_quantized.tflite and labels: /etc/labels/yolox.json and use case: Detection
VERBOSE: Replacing 329 out of 329 node(s) with delegate (TfLiteQnnDelegate) node
...
Pipeline state changed from PAUSED to PLAYING

The display shows multiple detection streams simultaneously.

Validation

  • 329 ops per stream, all delegated to DSP
  • Pipeline reaches PLAYING state
  • Q900 supports a maximum of 16 concurrent streams with this configuration

    You need to be logged into GitHub to post a comment. If you are already logged in, please ignore this message.

    Radxa-docs © 2026 by Radxa Computer (Shenzhen) Co.,Ltd. is licensed under CC BY 4.0