跳转到主要内容
SDK Version: Next

Building DX-Stream on Windows

This guide covers building the DX-Stream GStreamer plugin on Windows (MSVC x64).

The Windows build produces gstdxstream.dll, the same GStreamer plugin that Linux builds as libgstdxstream.so.

Quick Start

install.bat :: Install all dependencies (one-time)
build.bat :: Build the plugin + custom libraries + apps
setup.bat :: Download sample models and videos (one-time)
run_demo.bat :: Run demo menu

Custom Libraries & Apps

dx_stream\custom_library\build.bat :: Build postprocess/msgconv custom libraries
dx_stream\apps\build.bat :: Build example apps (mqtt, kafka, usermeta)

These require the main plugin to be built first (build.bat).


Prerequisites and System Setup

Hardware Requirements

  • x86_64 Windows 10/11 PC
  • DEEPX DX-M1 or compatible NPU (for runtime inference)

Software Requirements

The following must be installed manually before running install.bat.

#SoftwarePurposeDownload
1Visual Studio 2022C++ compiler (MSVC)visualstudio.microsoft.com
2Git for WindowsSource control, vcpkggit-scm.com
3Python 3.9+Meson build system hostpython.org
4GStreamer MSVC x86_64Multimedia frameworkgstreamer.freedesktop.org
5DEEPX SDKNPU runtime (dxrt)DEEPX SDK installer

Visual Studio 2022

Run the installer and select the "Desktop development with C++" workload.

Git for Windows

Install with default options. Ensure git is in your PATH.

Python

Download the official installer. Check "Add Python to PATH" during installation.

GStreamer

Download and install both packages from the official site:

  • Runtime (MSVC 64-bit)
  • Development (MSVC 64-bit)

Default install path: C:\Program Files\gstreamer\1.0\msvc_x86_64

IMPORTANT

The Development package is required for headers and .pc files.

DEEPX SDK

Install the DEEPX SDK using the official installer (DX_SDK_*.exe). The installer registers DEEPX_SDK_DIR as a system environment variable automatically — no manual path configuration is needed.

Default install path: C:\Program Files\DEEPX\DX_SDK_<version>

Expected directory structure (set up by the installer)

%DEEPX_SDK_DIR%\
include\
lib\x64\dxrt.lib
bin\dxrt.dll

Environment Variables Configuration

Most environment variables are configured automatically — no manual set commands are needed.

DEEPX_SDK_DIR (auto-configured by DEEPX SDK installer)

The DEEPX SDK installer sets DEEPX_SDK_DIR as a system environment variable. All build scripts read this variable automatically to locate the NPU runtime headers and libraries.

If for any reason the variable is missing, set it manually.

set DEEPX_SDK_DIR=C:\Program Files\DEEPX\DX_SDK_<version>

Installation and Dependency Provisioning

Standard Installation (install.bat)

After the prerequisites and environment variables are set.

install.bat

This automatically:

  • Step 1. Verifies all prerequisites are present
  • Step 2. Installs meson and ninja via pip
  • Step 3. Clones and bootstraps vcpkg (if not present)
  • Step 4. Installs C++ libraries via vcpkg: eigen3, opencv4, libyuv, mosquitto, librdkafka
  • Step 5. Generates opencv4.pc (required for meson to find OpenCV)
  • Step 6. Validates DEEPX_SDK_DIR path

Air-Gapped Network (No Internet)

On an internet-connected machine.

C:\vcpkg\vcpkg install eigen3:x64-windows opencv4:x64-windows libyuv:x64-windows ^
mosquitto:x64-windows librdkafka:x64-windows
C:\vcpkg\vcpkg export eigen3:x64-windows opencv4:x64-windows libyuv:x64-windows ^
mosquitto:x64-windows librdkafka:x64-windows --zip

Copy the resulting zip to the air-gapped machine, extract installed/x64-windows/ to:

dx_stream\vcpkg_installed\x64-windows\

Then run build.bat directly (vcpkg_installed already present).


Compilation and Ecosystem Building

Core Framework Plugin Compilation (build.bat)

Basic Build

build.bat

Output: gst-dxstream-plugin\builddir\src\gstdxstream.dll

Build Options

build.bat --clean :: Remove builddir and rebuild from scratch
build.bat --type=debug :: Debug build (symbols, no optimization)
build.bat --clean --type=debug :: Combine options

Building Custom Libraries and Example Applications

Custom libraries (postprocess, message_convert) and example apps have their own build scripts, separate from the main plugin build.

Custom Libraries

dx_stream\custom_library\build.bat :: Build all
dx_stream\custom_library\build.bat --clean :: Clean rebuild
dx_stream\custom_library\build.bat --type=debug :: Debug build

Builds every subdirectory under postprocess_library/ and message_convert_library/ that contains a meson.build.

Output DLLs are in each subdirectory's builddir/.

Example Apps

dx_stream\apps\build.bat :: Build all
dx_stream\apps\build.bat --clean :: Clean rebuild

Builds mqtt_sub_example, kafka_consume_example, usermeta_app.

Output executables are in each subdirectory's builddir/.

Demo Assets (Models & Videos)

NOTE

Both scripts require the main plugin to be built first — they resolve dependency('gstdxstream') via the auto-generated gstdxstream-uninstalled.pc in the plugin builddir.


Asset Provisioning and Demo Execution

Fetching Demo Assets (setup.bat)

setup.bat

Downloads sample AI models and test videos required by the demo pipelines. Assets are saved to dx_stream\samples\.

For air-gapped environments, manually place model files (.dxnn) in dx_stream\samples\models\ and video files in dx_stream\samples\videos\.

Running Interactive Demos (run_demo.bat)

run_demo.bat :: Interactive demo menu
run_demo.bat --internal-rtsp :: Use internal RTSP server for demo 9

The demo menu matches the Linux run_demo.sh layout:

#DemoModel
0Object DetectionYOLOv26n
1Object DetectionYoloV5S PPU
2Face DetectionYOLOv5s_Face
3Face DetectionSCRFD500M PPU
4Pose EstimationYOLOv26n_Pose
5Pose EstimationYOLOV5Pose PPU
6Semantic SegmentationYOLOv26n-Seg
7Multi-Object TrackingYoloV5S + OC_SORT
8Multi-Stream (4ch)Compositor Grid
9Multi-Channel (RTSP)dxinputselector
-Secondary ModeMulti-Model Cascade

Pipeline scripts are located in dx_stream\pipelines\windows\. Each script is self-contained and can be run independently if DXSTREAM_ROOT is set:

set DXSTREAM_ROOT=C:\path\to\dx_stream
dx_stream\pipelines\windows\object_detection_yolo26n.bat
dx_stream\pipelines\windows\rtsp.bat --internal-rtsp

Full Build + Demo Workflow

build.bat --clean
setup.bat :: Download models & videos (first time only)
run_demo.bat

Production Target Deployment

Target Machine Prerequisites

The target machine must have:

  • GStreamer Runtime (MSVC 64-bit) installed — provides core GStreamer DLLs
  • VC++ Redistributable 2015-2022 (x64) — provides MSVCP140.dll, VCRUNTIME140.dll

Source Build Deployment Routine

DX-Stream on Windows uses source-build distribution. Clone the repository, build, and run on the target machine:

git clone <repo-url>
cd dx_stream
install.bat
build.bat
setup.bat
run_demo.bat
NOTE

DEEPX_SDK_DIR is set automatically by the DEEPX SDK installer. Install the DEEPX SDK before running build.bat

build.bat automatically:

  • Builds the plugin, custom libraries, and apps
  • Collects all DLLs into install\bin\
  • Registers GST_PLUGIN_PATH and user Path entries

Required Environment Variables & Verification

The following are set automatically by build.bat:

set GST_PLUGIN_PATH=%PROJECT_ROOT%\install\lib\gstreamer-1.0
set PATH=%PROJECT_ROOT%\install\bin;%PROJECT_ROOT%\install\share\gstdxstream\lib;%PROJECT_ROOT%\install\share\gstdxstream\bin;%PROJECT_ROOT%\install\lib\gstreamer-1.0;%PATH%
VariablePurpose
GST_PLUGIN_PATHTells GStreamer where to find gstdxstream.dll
PATHMakes dependency DLLs (opencv, dxrt, etc.) discoverable at runtime

Verification

After building, open a new cmd.exe and run:

gst-inspect-1.0 dxpreprocess

If this prints element details, DX-Stream is correctly installed.

Critical DLL Naming Constraints

The plugin DLL must be named gstdxstream.dll (no version suffix). GStreamer derives the plugin entry point symbol from the filename:

  • gstdxstream.dll → looks for gst_plugin_dxstream_get_desc
  • gstdxstream-0.dll → looks for gst_plugin_dxstream_0_get_desc ✗ (symbol not found)

The build system already handles this — soversion is only applied on Linux where symlinks resolve the naming. Do not rename the DLL after building.


Technical Reference and Troubleshooting

Dependency Mapping Summary Matrix

DependencySourceMethod
gstreamer-1.0, gstreamer-video-1.0, json-glib-1.0, zlibGStreamer installerdependency() (pkg-config)
eigen3, opencv4vcpkgdependency() (pkg-config)
libyuvvcpkgcc.find_library()
libmosquitto, rdkafkavcpkgdependency() (pkg-config)
dxrt, dxdspDEEPX internalcc.find_library()
dl (POSIX dynamic linking)Linux onlySkipped on Windows (dx_dlfcn.h shim)

Platform Comparisons: Windows vs. Linux Build

AspectLinuxWindows
Dependency installinstall.sh (apt/source)install.bat (vcpkg)
CompilerGCC / ClangMSVC (cl.exe)
Buildbuild.shbuild.bat
Plugin DLL namelibgstdxstream.so (with .so.0 symlink)gstdxstream.dll (no version suffix)
Dynamic loadingdlopen / dlsymLoadLibrary / GetProcAddress (via dx_dlfcn.h)
Plugin scannerDefaultDefault
DistributionSource buildSource build
Demo launcherrun_demo.shrun_demo.bat
Pipeline scriptsdx_stream/pipelines/ (shell scripts)dx_stream/pipelines/windows/ (batch files)
Apps / custom_librarybuild.sh (meson install)build.bat (meson compile only)
Python bindings (pydxs)BuiltNot included

Troubleshooting and Diagnostics

GStreamer Registry Cache

GStreamer caches plugin scan results in:

%LOCALAPPDATA%\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64-msvc.bin

If the plugin was previously blacklisted (e.g., environment not set up correctly at first launch), delete this cache and retry:

del "%LOCALAPPDATA%\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64-msvc.bin"

DEEPX_SDK_DIR not set

[ERROR] DEEPX_SDK_DIR environment variable is not set.

Install the DEEPX SDK using the official installer — it sets DEEPX_SDK_DIR automatically. If already installed, open a new terminal so the updated system environment is loaded. As a last resort, set it manually:

set DEEPX_SDK_DIR=C:\Program Files\DEEPX\DX_SDK_<version>

install.bat fails: prerequisites missing

Install the listed software and re-run. install.bat will not proceed until all prerequisites are satisfied.

meson setup fails: dependency not found

Run install.bat first. If already run, check that vcpkg_installed\x64-windows\lib\pkgconfig\ contains the expected .pc files.

Link error: unresolved external symbol

Verify vcpkg_installed\x64-windows\lib contains the required .lib files.

MSVC not found

Run from a regular cmd.exe prompt (not PowerShell). build.bat calls vcvarsall.bat internally.

gst-inspect-1.0 dxpreprocess: No such element

Check in order:

  • Step 1. GST_PLUGIN_PATH points to the folder containing gstdxstream.dll
  • Step 2. PATH includes install\bin for dependency DLLs
  • Step 3. Delete registry cache: del "%LOCALAPPDATA%\Microsoft\Windows\INetCache\gstreamer-1.0\registry.x86_64-msvc.bin"
  • Step 4. Verify DLL is named gstdxstream.dll (not gstdxstream-0.dll)