Skip to main content
SDK Version: Next
DX-STREAM manual (PDF)

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_64 1.16.3+Multimedia frameworkgstreamer.freedesktop.org
5pkg-config (if not included with GStreamer)Build dependency discoverypkgconf releases
6DEEPX 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

The minimum supported version is 1.16.3; newer versions are allowed without an upper-version limit. Versions 1.16.3 and 1.28.4 have been verified on Windows; this validation history is separate from the minimum-version policy.

Download and install both packages from the official site:

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

install.bat queries the selected SDK's bin\gst-inspect-1.0.exe --version and displays its path and version. It stops before dependency installation if the version is below 1.16.3, the query fails or exceeds 10 seconds, or its output cannot be parsed. Errors include the minimum version and download link. build.bat uses Meson's existing gstreamer-1.0 >=1.16.3 dependency constraint to validate the development SDK; no duplicate build-script check is needed. Install matching Runtime and Development versions.

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

IMPORTANT

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

pkg-config

After checking GStreamer, install.bat adds its detected bin directory to PATH and checks that pkg-config --version succeeds. If GStreamer provides a working pkg-config, no separate installation is needed.

Otherwise, download and install the x64 MSI from pkgconf releases. Ensure its installation directory is on PATH, open a new terminal, and verify pkg-config --version before running install.bat again. The script only checks this prerequisite; it does not download or install pkgconf.

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\dxrt.lib (or lib\x64\dxrt.lib on older SDK versions)
bin\dxrt.dll

Environment Variables Configuration​

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

GStreamer root (configured by the GStreamer installer)

Windows build, demo, pipeline, and test scripts check GSTREAMER_1_0_ROOT_MSVC_X86_64 first, then the legacy GSTREAMER_1_0_ROOT_X86_64 variable, and finally the default C:\Program Files\gstreamer\1.0\msvc_x86_64 directory. Candidates must contain bin\gst-launch-1.0.exe and bin\gst-inspect-1.0.exe for runtime checks or lib\pkgconfig\gstreamer-1.0.pc for build checks; invalid candidates are skipped. Batch entrypoints share scripts\setup_gstreamer.bat so they also work in a fresh terminal without inheriting the environment from a previous build. The selected root supplies PATH; development checks also set PKG_CONFIG_PATH. After installing or changing GStreamer, open a new terminal to pick up its environment variables.

For manual gst-inspect-1.0 or gst-launch-1.0 commands in CMD, configure the current terminal from the project root first:

call scripts\setup_gstreamer.bat runtime

Build, demo, and pipeline batch scripts perform this setup automatically.

The build copies required vcpkg runtime DLLs, including OpenSSL 3 DLLs used by mosquitto.dll, into install\bin. GStreamer's bundled OpenSSL version may differ, so it is not a substitute for those dependencies.

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>

DEEPX_VNPU_DIR (auto-configured by the DX-H1 V-NPU SDK installer)

Build with --dxvnpu requires the SDK CMake package at:

%DEEPX_VNPU_DIR%\lib\cmake\dxvnpu\dxvnpuConfig.cmake

The installer also provides the VNPU runtime DLL directory. build.bat and run_demo.bat add %DEEPX_VNPU_DIR%\bin to their process PATH.


Installation and Dependency Provisioning​

Standard Installation (install.bat)​

After the prerequisites and environment variables are set.

install.bat

This automatically:

  • Step 1. Verifies prerequisites, checking pkg-config immediately after GStreamer
  • 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

On success, the script updates the calling CMD's PATH with the detected GStreamer bin directory. If pkg-config is missing or cannot run, prerequisite checking fails with manual installation instructions before any automatic installation.

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 --dxv3 :: Enable DX V3 transform backend (requires dxdsp; --v3 is an alias)
build.bat --dxvnpu :: Enable DXVNPU backend (requires DEEPX_VNPU_DIR)
build.bat --rkrga :: Enable RK RGA transform backend (requires librga)
build.bat --plugin-only :: Build only the plugin (skip custom libraries, apps, pydxs)
build.bat --uninstall :: Remove install directory and registered environment variables
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/.

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 8

The demo menu matches the Linux run_demo.sh layout:

#DemoModel
0Object DetectionYOLO26n
1Object DetectionYoloV5S PPU
2Face DetectionYOLOv5s_Face
3Pose EstimationYOLO26n_Pose
4Instance SegmentationYOLO26n-Seg
5Depth EstimationYOLO26n_Depth
6Multi-Object TrackingYoloV5S + OC_SORT
7Multi-Stream (4ch)Compositor Grid
8Multi-Channel (RTSP)dxinputselector
9Secondary 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, apps, and Python bindings (pydxs)
  • Collects all DLLs into install\bin\
  • Prepends this checkout's entries to User GST_PLUGIN_PATH and Path, preserving unrelated entries

Required Environment Variables & Verification​

build.bat merges the following entries into the persistent User environment. Existing entries for other plugins, SDKs, and checkouts are retained; repeated builds do not duplicate this checkout's entries. The commands below illustrate the resulting search paths, not commands to overwrite your persistent variables:

set GST_PLUGIN_PATH=%PROJECT_ROOT%\install\lib\gstreamer-1.0;%GST_PLUGIN_PATH%
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.

Uninstall​

build.bat --uninstall

This removes this checkout's install directory, build directories, dedicated venv-dx_stream, and Python packaging artifacts. Only this checkout's entries are removed from User GST_PLUGIN_PATH and Path; other checkouts, shared SDK variables, and Machine environment variables are left unchanged.

Exit code 0 means cleanup completed. If files remain locked or environment updates fail, the command reports an error and returns 1, rather than reporting success. Close applications using DX-Stream, check the reported permissions or environment error, and retry. Repeated uninstall is safe when artifacts and entries are already absent. Restart your terminal or IDE after environment changes. Environment registration failures also cause build.bat to return 1, even if the build artifacts were installed successfully.

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 install to install\share\gstdxstream\); standalone custom_library\build.bat and apps\build.bat compile only
Python bindings (pydxs)Built with rpathBuilt with Windows DLL loader

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)