deepx-ai/dx_stream/dx-agent-stream-build-pipeline
Claude Code and agent skill by deepx-ai/dx_stream
- community
Checking that the SKILL.md file is still in the repository.
Build GStreamer pipeline application for dx_stream
Install
npx vskill@latest install deepx-ai/dx_stream/dx-agent-stream-build-pipelineSKILL.md
Skill: Build dx_stream Pipeline Application
This skill document is sufficient. Read this FIRST before exploring source code.Only read source files if this document lacks the specific information you need.
Overview
Build a GStreamer pipeline application for real-time video processing on DEEPX NPU. This skill covers all 5 pipeline categories with complete templates and patterns.
Output Isolation (MUST FOLLOW)
All AI-generated pipeline applications MUST be created under dx-agent-dev/, NOT in production directories. This prevents accidental modification of existing pipelines.
Session Directory
session.json Template
`session_id` MUST contain the agent identifier (R81). Format: YYYYMMDD-HHMMSS_<agent>_<model>_<task> where <agent> is one of: claude, codex, copilot, cursor, opencode.
`created_at` MUST include timezone offset. Do NOT use datetime.now().strftime(...) without appending timezone — downstream ISO 8601 parsers will reject timestamps without an offset.
When to Use Production Path
Only create files in production directories when the user EXPLICITLY says:
- "Add this to the production codebase"
- "Create this in the examples directory"
- "Make this a permanent addition"
Default behavior: ALWAYS use dx-agent-dev/.
Usage
Invoke with /dx-agent-stream-build-pipeline or ask the dx-stream-builder agent. Specify the pipeline category (single-model, multi-model, cascaded, parallel, or broker), the model name, and the input source type.
Template Compliance (MANDATORY)
The templates in this document are battle-tested against the actual dx_stream runtime. Generated code MUST follow these templates exactly.
Rules
- Follow the template structure — use the template as the baseline for correctness.
User-requested additions and modifications are allowed. Do NOT add unrequested features (no custom logging format, no FPS overlay unless asked)
- Default: single output sink —
fpsdisplaysinkORfakesink. If the user
requests file output, replace the display sink with videoconvert ! x264enc bitrate=4000 speed-preset=ultrafast tune=zerolatency ! h264parse ! mp4mux ! filesink location=...
- `--output` / `tee` is RECOMMENDED for detection pipelines — Detection
pipelines SHOULD include the --output argument in parse_args() and the tee code path for simultaneous display+recording, unless the user explicitly excludes it. When included, use the tee name=t pattern: `` tee name=t \ t. ! queue ! videoconvert ! fpsdisplaysink sync=false \ t. ! queue ! videoconvert ! x264enc bitrate=4000 speed-preset=ultrafast tune=zerolatency ! h264parse ! mp4mux ! filesink location=output.mp4 ` **CRITICAL: x264enc MUST include tune=zerolatency`** — see Pitfall #14
- English log messages — all
logger.info/logger.errormessages in English,
matching the style of existing examples
- `--headless` flag — always include it in
pipeline.py. Additionally check
DISPLAY env as fallback (see template)
- `run_<app>.sh` MUST delegate to `pipeline.py` — the shell wrapper MUST invoke
python pipeline.py with --input and --model arguments. Embedding gst-launch-1.0 inline in run_<app>.sh is PROHIBITED (see Anti-Patterns below). The test test_run_script_invokes_pipeline enforces this and will fail on inline gst-launch.
- Path resolution —
run_<app>.shusesDX_STREAM_ROOT(2 levels up from
dx-agent-dev/<session>/), NOT the production 3-level-up pattern. See the run_<app>.sh template below for the exact code
Anti-Patterns (NEVER Do)
- Using
x264encwithouttune=zerolatency(see Pitfall #14) - Using relative model paths in
dxinfer model-path=(must be absolute) - Copying
SRC_DIRcalculation from production scripts indx_stream/pipelines/ - Writing log messages in Korean or other non-English languages
- Adding unrequested features that complicate the pipeline (e.g., FPS overlay, auto-recording)
- Embedding `gst-launch-1.0` inline in `run_<app>.sh` — PROHIBITED. The run script
MUST delegate to python pipeline.py, not call gst-launch-1.0 directly. Example of the correct pattern: ```bash # CORRECT — delegates to pipeline.py: source "$DX_STREAM_ROOT/venv-dx_stream/bin/activate" python pipeline.py --input "$INPUT_VIDEO" --model "$MODEL_PATH" \ --postprocess-lib /usr/local/share/gstdxstream/lib/{POSTPROCESS_LIB}
# ANTI-PATTERN (PROHIBITED) — inline gst-launch embedding: gst-launch-1.0 urisourcebin uri=file://$INPUT_VIDEO ! decodebin ! dxpreprocess ... ```
- Omitting `dxrate` after RTSP decodebin — always add
dxrate max-rate=30in the
RTSP source branch. Example: urisourcebin uri=rtsp://... ! decodebin ! dxrate max-rate=30 ! dxpreprocess ...
- `created_at` without timezone offset — always use
datetime.now().astimezone().isoformat(timespec='seconds')
Phase 0: Prerequisites Check
Before starting the build workflow, verify:
Working directory note: All Phase 0 commands assume you are in thedx_stream/root.The sanity check script lives TWO levels up:../../scripts/sanity_check.sh(NOTscripts/sanity_check.sh— that path does not exist fromdx_stream/).NEVER pipe through| tailor| head— they mask the exit code and may hide failures.
- dx-runtime:
bash ../../scripts/sanity_check.sh --dx_rt
- ← MANDATORY: run from `dx_stream/` root with the `../../` prefix. Do NOT truncate the path.
- FAIL →
bash ../../install.sh --all --exclude-app --exclude-stream --skip-uninstall --venv-reuse - Re-run sanity_check.sh — must PASS after install
- If still failing → STOP (unconditional). User instructions to continue do NOT override this.
If NPU hardware init failure ("Device initialization failed"): tell the user a cold boot / system reboot is required, then STOP. NEVER proceed with code generation while sanity check is failing. NEVER mark this check as "done" when it actually failed.
- GStreamer plugins:
gst-inspect-1.0 dxinfer— FAIL →./install.sh && ./build.sh - Postprocess libraries:
ls /usr/local/share/gstdxstream/lib/libpostprocess_*.so - Python venv (for pipeline.py): The
pydxsmodule is only available inside
the dx_stream virtual environment. Verify it: ``bash source venv-dx_stream/bin/activate && python3 -c "import pydxs; print('pydxs OK')" ``
- FAIL →
./install.sh && ./build.sh(creates venv-dx_stream and installs pydxs) - If venv exists but
pydxsnot importable →source venv-dx_stream/bin/activate && pip install -e . - IMPORTANT: The README.md template MUST document this venv activation step
so users know to activate it before running pipeline.py (see pitfall #15)
- DX-H1 V-NPU (optional): Build V-NPU support with
./build.sh --dxvnpu.
On Windows, DEEPX_VNPU_DIR must identify the installed V-NPU SDK. Confirm optional codec registration with gst-inspect-1.0 dxvnpudec and gst-inspect-1.0 dxvnpuenc before generating a hardware-codec pipeline.
Prerequisites
- DX-RT installed and NPU detected (
dxrt-cli -s) - GStreamer plugin registered (
gst-inspect-1.0 dxinfer) - Model file downloaded (
./setup.sh --model="<model>.dxnn")
Quick Reference
DX-H1 V-NPU Usage
- Use
dxvnpudecanddxvnpuenconly in standard raw-video codec branches; they
are outside the application/x-dxvideoraw multi-stream domain.
- Set
dxinfer backend=dxvnpuonly for a V-NPU-specific inference deployment.
Use backend=auto when the pipeline must retain fallback behavior.
dxpreprocess,dxscale, anddxconvertmay use a VNPU transform kernel for
image resize and color conversion. Do not make that optional acceleration a pipeline requirement.
Supported Models (14)
| Model | Task | Input Size | Postprocess .so | |
|---|---|---|---|---|
| EfficientNet_Lite0 | Classification | 224x224 | libpostprocess_object_class.so | |
| SCRFD500M | Face Detection | 640x640 | libpostprocess_scrfd500m.so | |
| YoloV5S_PPU | Object Detection | 640x640 | libpostprocess_ppu.so | |
| YOLOv5s_Face | Face Detection | 640x640 | libpostprocess_yolov5s_face.so | |
| yolo26n | Object Detection | 640x640 | libpostprocess_yolo26od.so | |
| yolo26n-pose | Pose Estimation | 640x640 | libpostprocess_yolo26pose.so | |
| yolo26n-seg | Segmentation | 640x640 | libpostprocess_yolo26seg.so | |
| YoloV5S | Object Detection | 640x640 | libpostprocess_yolov5s_6.so | |
| YoloV7 | Object Detection | 640x640 | libpostprocess_yolov7.so | |
| YoloV8N | Object Detection | 640x640 | libpostprocess_yolov8n.so | |
| YoloV9S | Object Detection | 640x640 | libpostprocess_yolov9s.so | |
| YoloXS | Object Detection | 640x640 | libpostprocess_yoloxs.so | |
| YOLOV11N | Object Detection | 640x640 | libpostprocess_yolov11.so | |
| yolov8m_pose | Pose Estimation | 640x640 | libpostprocess_yolov8m_pose.so |
Core Pipeline Pattern
DxTracker is RECOMMENDED for object-detection pipelines. Pipelines whosetask is object detection (yolo*, ssd, scrfd, efficient-det, etc.) SHOULD includedxtrackerbetweendxpostprocessanddxosdby default. Use the config file../../dx_stream/configs/tracker_config.json(relative to the session directory).The user may explicitly exclude tracker if not needed for their use case.
Template: pipeline.py (Python GStreamer Pipeline)
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.deepx/skills/dx-agent-stream-build-pipeline/SKILL.md
Popularity
- Repository stars
- 3
- Repository forks
- 5
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Aug 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/deepx-ai/dx_stream/dx-agent-stream-build-pipeline)