OptrisOptrisDocumentation

Documentation/OTC SDK/Overviewv12.0

Installation

One document for every platform and every language. The SDK ships as a pre-built package; you do not build it. Install the package for your system, then reference it from your project in whichever language you write.

What You Need

What your own application needs, by language. Nothing here is needed to run the SDK: the package brings its own dependencies, including its own FFmpeg build, which is why you must not install libavcodec-dev and friends.

If you write in You need
C++ a C++17 compiler or later. The public headers compile at -std=c++17 and the installed CMake target requires no more. Optris builds and tests with GCC 13+, Clang 17+ and MSVC 19.36+. That list is what is tested, not what the language level demands
C any C99 compiler. optris/sdk_c.h is a flat C99 ABI and needs nothing else
C# / .NET .NET 10.0. On Linux the NuGet package also needs libusb-1.0 from your distribution; see C# and .NET
Python Python 3.9+. The binding is pure Python and has no compile step
Rust a stable toolchain with Cargo, 1.70 or later

CMake 3.14+ if you consume the SDK through its CMake package.

On Windows there is nothing else to install. The SDK library otcsdk-34.dll and the two binding libraries are built with Microsoft's C++ compiler and use its runtime, and the SDK ships that runtime beside the library: msvcp140.dll, msvcp140_atomic_wait.dll, vcruntime140.dll and vcruntime140_1.dll are in the installation's bin folder, in runtimes/win-x64/native of the NuGet packages, and next to the library in a Windows Python wheel. They are Microsoft's own files, unchanged; their licence terms are in licenses\MSVC-RUNTIME-NOTICE.txt. Python, .NET and your own programs that load the SDK from there need neither Visual Studio nor the Microsoft Visual C++ Redistributable. The ready-made programs the SDK installs (simpleView, showcase, the command line tools and the programs in examples\bin) find everything they use in their own folder: examples\bin holds a copy of otcsdk-34.dll and of the four runtime files beside the examples, so the examples you run are built exactly like the ones you build yourself and use the same library.

If you copy only otcsdk-34.dll into your own application, copy those four files beside it as well, or install the Microsoft Visual C++ Redistributable (x64) on the computers your application runs on.

Note: The first time a camera is opened on a machine, the SDK looks for its calibration files in the directory named by ImagerConfig::calibration_path, on the camera itself (on models that store them), and on the Optris calibration servers, and keeps what it obtains in the user data directory (GetCalibrationDir()). A machine that will be offline needs the files copied there beforehand. Imager::GetCalibrationStatus() reports whether a camera ended up calibrated.

Where the Packages Are

  • Optris Thermal Camera SDK: the product page
  • The platform packages, on download.optris.com. Each link below always leads to the newest 12.0 release for that system:
System Package
Windows 10 and 11, 64-bit installer
Debian 13 amd64, arm64
Debian 12 amd64, arm64
Ubuntu 24.04 amd64, arm64
Ubuntu 22.04 amd64, arm64

On Debian and Ubuntu the apt repository is the other way to the same package.

For C#, Python and Rust, start with the package registry of your language. Each binding is published there, and that is the first thing to do in a project of your own:

Language Registry Add it with
C# nuget.org, package Optris.Sdk dotnet add package Optris.Sdk
Python PyPI, package optris-sdk pip install optris-sdk
Rust crates.io, crates optris-sdk and optris-sdk-sys both in [dependencies], see Rust
  • C#: the NuGet package carries the SDK library for 64-bit Windows and Linux and needs no SDK installation; see C# and .NET.
  • Python: the wheels carry the SDK library and need no SDK installation; see Python with pip.
  • Rust: the crates carry the bindings and not the SDK library, so the platform package above has to be installed as well; see Rust.

The C# and Python bindings also ship inside the platform packages, for a computer without access to the registries.

Windows

Run the downloaded .exe installer. It adds the installation directory as an entry of the system-wide environment variable OTC_SDK_DIR, and registers the installation with CMake's package registry so find_package(otcsdk) finds it.

It also adds the installation's bindings\python3 folder to the system-wide PYTHONPATH, so import optris_sdk works in any Python on the computer with nothing else to install. A Python that has its own optris-sdk from pip uses that copy and its library instead of the installation's: a virtual environment with pip install optris-sdk, a Python with the package in its own site-packages, or one with pip install --user optris-sdk. Before it loads anything, the installation's copy looks for one of these and, if there is one, gives way to it. Without one, import optris_sdk loads the installation's package and bin\otcsdk-34.dll, as before.

The installer writes install.log in the installation directory. It records that the Microsoft Visual C++ runtime shipped in bin is the one in use, and whether a system-wide Microsoft Visual C++ Redistributable is also installed; neither is needed. Only if the runtime files in bin were missing would the installer warn and name Microsoft's download, and the installation continues either way. install.log also records whether the working copy of the examples in your Documents folder could be written.

For deployment tools, the entry in "Apps & features" carries the installation folder, the installed size and a silent uninstall command (QuietUninstallString, which runs Uninstall SDK.exe /S).

Uninstalling leaves one folder behind on purpose: C:\ProgramData\Optris\otcsdk\claims. Every program built with SDK 12.0.13 or later on this computer, from any installation and any user account, records there which camera it has open, so that two programs never open the same camera; Optris Relay does the same once it is built with such an SDK. Removing the folder while another Optris program is running would let a second program open a camera that is in use, so the uninstaller does not. The files in it are small and are ignored once the program that wrote them has ended. You can delete the folder when no Optris software is left on the computer.

OTC_SDK_DIR is a list: it holds one semicolon-separated entry per SDK installation, and other Optris software, such as Optris Relay, can add an entry of its own. A program built with the SDK does not depend on it. It reads the palettes, norm tables and Formats.def that ship with the SDK library it loaded: from the installation folder, from the Python package or from the NuGet package. Only a library with no data of its own, such as one linked statically into a program or copied alone beside one, reads OTC_SDK_DIR; it uses the first entry that names an existing folder and logs which entry it chose and which it passed over. Uninstalling an installation removes only that installation's entry, so the others keep working. To build against a particular installation, name its folder rather than building a path from OTC_SDK_DIR.

Debian and Ubuntu

The SDK ships as a package for each distribution in the table below, built against that distribution's own libraries. Building it from source is not supported and is not something you should need; if your distribution is not in the table, ask Optris for a package for it rather than building one.

Suite Distribution
trixie Debian 13
bookworm Debian 12
noble Ubuntu 24.04 LTS
jammy Ubuntu 22.04 LTS
stable alias for the current Debian stable

Architectures: amd64 and arm64.

Installing a package built for another distribution is refused rather than silently broken: the package records the C library floor of the system it was built on, so apt says so up front instead of failing later at load time with a message about GLIBC_2.38 not found.

The package file, downloaded directly

The file name carries the distribution and the architecture, and both must match your system:

sudo apt install ./otcsdk-12.0.29-debian-13-amd64.deb

otcsdk-12.0.29-ubuntu-24.04-arm64.deb is the same thing for Ubuntu 24.04 on arm64. apt install ./file.deb, with the leading ./, resolves the dependencies from your configured repositories, which a bare dpkg -i does not.

The apt repository

Optris also runs an apt repository at apt.optris.com, one suite per distribution:

# 1. Trust the signing key.
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://apt.optris.com/gpg.key \
  | sudo gpg --dearmor -o /etc/apt/keyrings/optris.gpg

# 2. Add the repository. Replace "trixie" with your suite.
echo "deb [signed-by=/etc/apt/keyrings/optris.gpg] https://apt.optris.com trixie main" \
  | sudo tee /etc/apt/sources.list.d/optris.list

# 3. Install.
sudo apt update
sudo apt install otcsdk

If apt update cannot reach it from your network, use the direct package download above.

The package version carries the suite it was built for (12.0.29~trixie1, 12.0.29~noble1), so builds of the same SDK version for different distributions stay distinguishable and sort predictably. apt policy otcsdk says which one you have.

What the Linux Package Does

  • Puts the library in /usr/lib, the headers in /usr/include, the command line tools in /usr/bin, and the CMake package files in /usr/lib/cmake/otcsdk.
  • Puts the five FFmpeg shared libraries in /usr/lib/otcsdk/, not in /usr/lib. libavcodec.so.61 is a path the distribution's own libavcodec61 package owns, and two packages claiming it would conflict; libotcsdk.so reaches them through an RPATH of $ORIGIN/otcsdk. Nothing else on the machine sees them, and the SDK declares no dependency on the distribution's FFmpeg.
  • Installs two udev rules. 89-otcsdk-usb.rules makes the camera writable by users in the video group; without it a USB camera enumerates read-only and the SDK cannot open it. 90-otcsdk-hid-libusb.rules keeps the kernel's usbhid driver off the camera's HID control interface, which this package's libusb HID backend has to claim for itself.
  • Reloads the udev rules, runs ldconfig, and registers desktop entries.
  • Installs the Python binding into the system dist-packages, the managed C# assembly beside the library, the examples under /usr/share/otcsdk/examples/, with the Optris.Sdk NuGet package that the C# examples build against in examples/packages/, and the ready-made example programs (the c_ examples, simpleView and the playground) in /usr/lib/otcsdk/examples/bin/.
  • Puts only the HTML manual and the changelog in /usr/share/doc/otcsdk/. Many Ubuntu systems, including the official container images and the minimal and cloud images, are set up to leave out everything under /usr/share/doc when a package is installed, so nothing you need to build or run is there. Up to 12.0.10 the examples were in /usr/share/doc/otcsdk/examples/, and on those systems they were missing after an install that reported success.

Add yourself to the video group if you are not already in it, then log out and back in; group membership is only picked up at login:

sudo usermod -aG video "$USER"

A camera that was already plugged in is handled by the install, so a replug is not normally needed. 90-otcsdk-hid-libusb.rules reacts to a bind event, and usbhid claimed the HID control interface long before the package arrived. Reloading the rule database does not replay a bind, so the postinst releases the interface by hand on the cameras that are present. It does so narrowly: only interface 2 of an 0403:de37 device, only when its class really is HID, and only when usbhid is the driver holding it, so a camera another program already has open through libusb is untouched. Replug only a camera that was in use through hidraw while the install ran.

The Linux Archive, Without apt

The SDK is also built as a .tar.gz archive for each distribution, holding the same SDK as the .deb, for machines where you cannot or do not want to install a system package: a build container, a machine you have no root on, a deployment that keeps several SDK versions side by side.

The archive is not among the downloads on download.optris.com. What you can download and install yourself is listed in Where the Packages Are: the .deb for your distribution, directly or from the apt repository, the Windows installer, and the C#, Python and Rust packages from nuget.org, PyPI and crates.io. The NuGet package and the Python wheel need no system installation at all, which covers most of the cases above. If you need the archive itself, ask Optris (see Contact). The rest of this section is for when you have one. Extract it wherever you like.

tar -xzf otcsdk-12.0.29-debian-13-amd64.tar.gz
export OTC_SDK_ROOT="$PWD/otcsdk-12.0.29-debian-13-amd64/usr"

For C++, C, Python and the programs in the archive, there is no LD_LIBRARY_PATH to set. Everything the archive ships as a program or a module finds the SDK library relative to its own location, so the extracted directory works where it stands and keeps working if you move it or copy it to another machine. That covers the command line tools in bin, the pre-built example programs under lib/otcsdk/examples/bin, and both Python bindings:

PYTHONPATH="$OTC_SDK_ROOT/lib/python3/dist-packages" \
  python3 -c "import optris_sdk; print(optris_sdk.library_path)"

C# is the exception, and the third item below says what it needs and why. Our C# guidance elsewhere in this manual that there is no LD_LIBRARY_PATH to set is about the NuGet package, which carries its own copy of the native SDK; it does not carry over to this archive.

Four things to know, because the archive installs nothing and therefore does nothing on your behalf.

  • The archive needs a few libraries from your distribution, and cannot install them itself. The .deb asks for them; the archive cannot, so on a fresh system every program in it stops at once with a message naming the first one missing, such as libusb-1.0.so.0: cannot open shared object file, and import optris_sdk cannot load the library. Install them once, which needs root, or ask your administrator to. The PNG and TLS libraries have different names on the newer distributions: bash # Debian 13 and Ubuntu 24.04 sudo apt-get install libusb-1.0-0 libpng16-16t64 libssl3t64 \ libsdl2-2.0-0 libsdl2-ttf-2.0-0 # Debian 12 and Ubuntu 22.04 sudo apt-get install libusb-1.0-0 libpng16-16 libssl3 \ libsdl2-2.0-0 libsdl2-ttf-2.0-0 The two SDL libraries are for the viewer programs simpleView, playground and showcase. With these installed, everything in the archive starts with no LD_LIBRARY_PATH, wherever you extracted it. To build your own programs against the archive you need, on every distribution, a compiler, CMake, and the development files of two of those libraries, because the SDK's CMake package looks for them when your project calls find_package(otcsdk). Without them CMake stops with Could NOT find LibUdev: bash # To build against the archive, on every distribution sudo apt-get install build-essential cmake libudev-dev libusb-1.0-0-dev
  • The udev rules are in the archive but not in effect. They are shipped at lib/udev/rules.d/, and until they are in place a USB camera enumerates read-only and the SDK cannot open it. Copy both files into /etc/udev/rules.d/ and reload, which is the one step here that does need root: bash sudo cp "$OTC_SDK_ROOT"/lib/udev/rules.d/*.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules && sudo udevadm trigger Then add yourself to the video group as described above, and replug the camera.
  • CMake has to be told where the archive is, since there is no system CMake package directory to find it in. Pass the extracted prefix and the normal find_package(otcsdk) from the C++ section below works unchanged: bash cmake -B build -DCMAKE_PREFIX_PATH="$OTC_SDK_ROOT"
  • C# is the one case where the archive cannot help itself, and it needs a step from you. The archive carries the C# interface as source, at share/otcsdk/csharp/classes/, together with the native lib/libotcsdk_csharp.so that it calls into. .NET looks for that native library beside your built application and along the system library path, and never in the directory the archive put it in, so without one of the two steps below the first call raises DllNotFoundException naming otcsdk_csharp. Either copy the native libraries next to your application, which is what we would suggest because it makes your output self-contained: bash cp "$OTC_SDK_ROOT"/lib/libotcsdk_csharp.so "$OTC_SDK_ROOT"/lib/libotcsdk.so.* bin/Release/net10.0/ cp -r "$OTC_SDK_ROOT"/lib/otcsdk bin/Release/net10.0/ Copy all three: the C# layer calls the SDK library, and the SDK library reads video through the otcsdk directory beside it. Or, if you would rather not copy anything, point the loader at the archive for the run: bash LD_LIBRARY_PATH="$OTC_SDK_ROOT/lib" dotnet run This is about the archive alone. From the NuGet package the native SDK travels inside the package, in the layout the runtime already looks in, and the only thing it needs from the system is libusb; see C# and .NET.

If something in the archive still cannot find the library, name it outright rather than reaching for LD_LIBRARY_PATH:

Variable What it does
OPTRIS_SDK_LIBRARY the full path of the library file to load. An explicit answer always wins
OPTRIS_SDK_DIR the root of an SDK installation to load from
OTC_SDK_DIR the root of an SDK installation, as a list. The installer writes this one itself

All three are read by the optris_sdk Python binding. OTC_SDK_DIR is the one the Windows installer sets to the folder it installed into, so on an installed machine you need set nothing. It holds a list rather than a single folder, because installing a second time adds a second entry and other Optris software can add its own, and entries are separated the way PATH is separated on your system. The SDK reads it for its palettes and norm tables only when the library it loaded has no data of its own beside it or in its installation. OPTRIS_SDK_DIR is read only by the Python binding, so setting it will not move the SDK's own search for its palettes and norm tables.

optris_sdk.library_path reports the file that was actually loaded, which is the quickest way to tell an archive you unpacked apart from a system installation you forgot about.

Referencing the SDK: C++

Two files. CMakeLists.txt:

cmake_minimum_required(VERSION 3.14)
project(hello_thermal LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(otcsdk REQUIRED)

add_executable(hello_thermal src/main.cc)
target_link_libraries(hello_thermal PRIVATE otcsdk::otcsdk)

src/main.cc lists every camera the SDK can see:

#include <iostream>

#include <sdk.h>

int main() {
  auto devices = optris::sdk::EnumerateDevices();
  std::cout << "cameras found: " << devices.size() << "\n";
  for (const auto &dev : devices) {
    std::cout << "  " << dev.serial << "  " << dev.model << "  "
              << dev.width << "x" << dev.height << "\n";
  }
  return 0;
}
cmake -S . -B build
cmake --build build
./build/hello_thermal

With no camera attached it prints cameras found: 0 and exits cleanly, which is the point: it proves the SDK is installed and linking before any hardware is involved.

<sdk.h> is the amalgamated header and pulls in the v12 facade API. <optrissdk.h> beside it is the combined header, the complete API including the rec:: and view:: layers. The individual headers are under optris/sdk/ if you prefer to include only what you use.

C++17 is enough. The headers compile at -std=c++17 and the installed CMake target asks for no more, so a project already on C++17 or later needs to set nothing. The SDK itself is built with C++23, which is not the caller's concern.

Referencing the SDK: C

The same CMake package, with the C language and one header:

find_package(otcsdk REQUIRED)
add_executable(hello src/main.c)
target_link_libraries(hello PRIVATE otcsdk::otcsdk)

optris/sdk_c.h is the whole interface: a flat C99 ABI, no C++ types across the boundary. Without CMake, compile against the installed prefix directly:

cc -std=c99 main.c -lotcsdk -o hello

Referencing the SDK: C# and .NET

Add Optris.Sdk from nuget.org. In your project's directory:

dotnet add package Optris.Sdk

That writes the PackageReference below into the project, and the package restores from nuget.org, the default package source. The package carries the SDK library for 64-bit Windows (win-x64) and Linux (linux-x64, linux-arm64) and the SDK's data files, so a program that uses it needs no SDK installation. The same package also comes with the SDK packages, beside the C# examples; see below.

There is one package, Optris.Sdk, and it carries two interfaces:

Namespace What it is
Optris.Sdk the v12 binding, hand-written over the flat C ABI. Use it for new code
Optris.OtcSdk the version 11 compatible SWIG wrap: IRImagerClient and the observer pattern, for existing code
<PackageReference Include="Optris.Sdk" Version="12.0.*" />

That one reference makes both available, and both load the same native SDK from the package. Earlier releases published the version 11 compatible interface as a separate package, Optris.OtcSdk, which is no longer produced: replace a reference to it with the line above and the code compiles unchanged.

On Linux the managed assembly and its native companion (libotcsdk_csharp.so) are installed by the platform package, with examples in /usr/share/otcsdk/examples/csharp, so a C# program on a machine with the .deb references those directly.

The .deb and the Linux archive also carry Optris.Sdk itself, as the file examples/packages/Optris.Sdk.<version>.nupkg (under /usr/share/otcsdk/ for the .deb, under share/otcsdk/ in the archive), and the NuGet.config in examples/ names that folder as a package source. So the C# examples build where they are installed, or from a copy of the whole examples folder; SimpleViewCS is the exception, because it is built on Windows Forms and builds on Windows only. For a project of your own, add the folder as a source once with dotnet nuget add source /usr/share/otcsdk/examples/packages --name optris-sdk, and the PackageReference above restores from it. The Windows installer carries the same file in examples\packages\, and the copy of the examples it puts in your Documents\Optris\examples folder has a NuGet.config that names that folder in the installation, so the C# examples build from Documents without a second copy of the package.

The NuGet package on Linux

The package carries the native SDK for linux-x64 and linux-arm64 under runtimes/<rid>/native, together with the FFmpeg libraries it uses, and .NET loads them from there without LD_LIBRARY_PATH. One build serves every distribution the SDK supports: Debian 12 and 13, Ubuntu 22.04 and 24.04, or any other distribution with glibc 2.35 or later and OpenSSL 3. The official .NET 10 container images (mcr.microsoft.com/dotnet/sdk:10.0 and runtime:10.0) are among them.

The native SDK takes four libraries from the system rather than carrying its own copy:

Library Debian and Ubuntu package Already present?
libusb-1.0 libusb-1.0-0 No on a minimal system or container, including the official .NET images
libudev libudev1 yes, on every supported distribution
zlib zlib1g yes, on every supported distribution
OpenSSL 3 libssl3 (libssl3t64 on Ubuntu 24.04 and Debian 13) yes wherever .NET runs, which requires it

So on a fresh machine or in a container there is one step:

sudo apt-get install libusb-1.0-0

In a Dockerfile based on a .NET image that is RUN apt-get update && apt-get install -y libusb-1.0-0. Without it the first SDK call raises DllNotFoundException, and its message names this package.

These four stay system libraries on purpose: OpenSSL then receives your distribution's security updates, and libusb and libudev are the ones your kernel and udev rules are maintained with.

For a USB camera, the udev rules have to be installed too. The simulated camera and recordings need nothing more, but a real camera enumerates read-only, and the SDK cannot open it, until the two rules described in What the Linux Package Does are in place. Restoring a NuGet package cannot install them, but the package carries both, with a script that installs them, under tools/udev:

cd ~/.nuget/packages/optris.sdk/<version>/tools/udev
sudo ./install-udev-rules.sh

The Linux archive ships the same two rules at lib/udev/rules.d/ (see The Linux Archive, Without apt), and installing the .deb does the same and installs libusb with it.

Referencing the SDK: Python

Install the binding from PyPI. The package is optris-sdk, and its wheel carries the SDK library inside it, so nothing else needs to be installed:

pip install optris-sdk

Python with pip has the virtual environment, which wheels there are, and the one library Linux needs from your distribution.

Or use the copy the platform package installs. The .deb and the Windows installer put the binding into the system dist-packages beside the installed SDK, so on a computer with the SDK installed import optris_sdk works with nothing further to install.

Either way:

python3 -c "import optris_sdk; print(optris_sdk.sdk_version_string())"

Two Python packages arrive side by side. They share no namespace, so a program picks by import:

Import What it is
optris_sdk the v12 binding, pure Python over the flat C ABI. No compile step and no SWIG
optris.otcsdk the legacy v11 SWIG wrap: IRImagerClient and the observer pattern
python3 -c "import optris.otcsdk as otc; print(hasattr(otc, 'IRImagerClient'))"

NumPy is optional and is not a dependency: without it Frame.data() hands back a memoryview, with it a zero-copy numpy array over the SDK's own memory. Install it the way you install anything else: python3-numpy from your distribution, or pip install numpy into your own virtual environment.

The 27 examples for optris_sdk ship with every package: at /usr/share/otcsdk/examples/python/ from the .deb, at share/otcsdk/examples/python/ in the Linux archive, and in examples\python in the Windows installation folder. Each runs against the simulated camera when started with no arguments, and --help says what else it accepts. The ones beside them in examples/python3/ are written against the legacy v11 interface.

Python with pip

The Python binding is published on PyPI as the package optris-sdk. Its wheels are self-contained: each one carries the native SDK library, the five FFmpeg libraries it uses, the camera format table, palettes and norm tables, and on Windows the Microsoft Visual C++ runtime. A wheel needs no SDK installation, and a Python that has the wheel uses the wheel's package and library even on a computer where the SDK is installed: on Windows the installer's copy gives way to it (see Windows), and on Linux the .deb installs its copy where a virtual environment does not look. The Linux archive is the exception. If you put its binding on PYTHONPATH yourself, as The Linux Archive, Without apt shows, Python searches that folder before any site-packages, a virtual environment's included, so the archive's package and library are used. In a virtual environment with the wheel, leave PYTHONPATH unset.

Wheel For
win_amd64 64-bit Windows 10 and 11
manylinux_2_35_x86_64 64-bit Intel and AMD Linux: Debian 12 and 13, Ubuntu 22.04 and 24.04, or any distribution with glibc 2.35 or later
manylinux_2_35_aarch64 64-bit Arm Linux, the same distributions

Python 3.9 or later. pip picks the wheel for your platform by itself. On Debian and Ubuntu the first line is needed once: python3 -m venv is in the separate python3-venv package there, and stops with an error on a system that does not have it, and libusb-1.0-0 is the one library the SDK needs that a minimal system lacks (see below):

sudo apt-get install python3-venv libusb-1.0-0
python3 -m venv .venv
. .venv/bin/activate
pip install optris-sdk

On Windows the same three steps without the first line, in a command prompt, are py -m venv .venv, .venv\Scripts\activate and pip install optris-sdk.

On Linux, four libraries come from your distribution, the same four the NuGet package takes from it and for the same reasons (see The NuGet package on Linux): libusb-1.0, libudev, zlib and OpenSSL 3. Only libusb is missing from minimal systems and containers, which is why the first line above installs it. Without it, import optris_sdk stops with an error that names libusb-1.0.so.0 and the package to install, libusb-1.0-0.

For a USB camera on Linux, install the udev rules once. pip cannot install them, so the Linux wheels carry them in the package's udev folder:

UDEV=$(python3 -c "import optris_sdk, os; print(os.path.join(os.path.dirname(optris_sdk.__file__), 'udev'))")
sudo cp "$UDEV"/*.rules /etc/udev/rules.d/
sudo udevadm control --reload && sudo udevadm trigger

python3 -c "import optris_sdk; print(optris_sdk.library_path)" names the library the package loaded; from a wheel it is inside the virtual environment. The licence the SDK is sold under is installed with the wheel, in the licenses/eula folder of its .dist-info directory, and the third-party notices are in optris_sdk/licenses/. The 27 examples are not in the wheel; they ship with the SDK packages and the documentation archive.

Referencing the SDK: Rust

Put both crates from crates.io into [dependencies] in your Cargo.toml:

[dependencies]
optris-sdk = "12.0"
optris-sdk-sys = "12.0"

cargo add optris-sdk optris-sdk-sys adds the same two crates. "12.0" takes the newest 12.0 release of each. Your code uses optris-sdk, the safe crate; optris-sdk-sys, the raw FFI layer underneath it, is listed as well so the two versions stay matched and the raw layer is there if you need it. The crate releases do not always follow every SDK release, so the crate version can be lower than the SDK version you have installed; that is expected.

The crates carry the bindings, not the SDK library, so the platform package has to be installed as well, version 12.0.2 or later: the .deb or the apt repository on Debian and Ubuntu, the installer on Windows (see Where the Packages Are). The crates link against the installed otcsdk library when you build, and your program loads it when it runs. This is how they find it:

  • Linux, from the .deb or apt: the library is in /usr/lib, where the linker and the loader look anyway. There is nothing more to do.
  • Windows: set OPTRIS_SDK_LIB_DIR to the installation's lib directory, which holds otcsdk.lib, before building. At run time bin has to be on PATH, which the installer does.
  • Anywhere else the library is not in a system directory: set OPTRIS_SDK_LIB_DIR to the directory that holds libotcsdk.so, and give your application the three-line build script so it loads that copy at run time.

Adding it to a project in the Rust chapter has the details for each platform.

Checking the Installation

The command line tools are installed to /usr/bin on Linux and beside the library on Windows, and they check an installation without writing any code:

Tool What it does
otc_find list connected cameras
otc_version print the SDK version
otc_info detailed device information
otc_snapshot save a frame as PNG, TIFF, CSV, JSON or raw
otc_stream stream frames to stdout
otc_net configure an Ethernet camera's address
otc_config generate, validate and print configuration files
otc_cali where calibration files are kept, which servers they come from, and which are present
otc_rdc inspect and check radial distortion correction
otc_ravi convert PIX Connect .ravi recordings into SDK recordings

otc_find is the first thing to run after installing. If it lists your camera, the SDK, the udev rule and your group membership are all correct.

Most of these can be tried without a camera. --simulated runs otc_find, otc_info, otc_stream, otc_snapshot and otc_config against the SDK's built-in synthetic camera; otc_rdc and otc_ravi open no camera at all. otc_net is the exception; it configures real hardware and has no simulated mode.

Payload goes to stdout and diagnostics to stderr, so otc_stream -f raw > frames.bin and otc_find --json | jq both work. They exit 0 on success, 1 when the camera or the filesystem refused, and 2 when the command line was wrong.

See Command Line Tools for the full reference, including taking a network camera from its box to a running stream.

The examples that ship with the package are the fastest way to see a working program for a given feature:

/usr/share/otcsdk/examples/

They are the same examples that live in the source tree. Copy one somewhere writable and build it exactly as above. Each has its own CMakeLists.txt that calls find_package(otcsdk REQUIRED).

The ready-made programs built from them are in /usr/lib/otcsdk/examples/bin/, and each answers --help. Up to 12.0.10 the examples and these programs were under /usr/share/doc/otcsdk/examples/. That folder is gone; where the system keeps /usr/share/doc, a note in /usr/share/doc/otcsdk/README.examples says where they are now.

If Something Does Not Work

The camera is not found. Check it is on the bus with lsusb; the imagers appear under vendor 0403. If it is listed but the SDK cannot open it, the udev rule has not applied: confirm you are in the video group (id -nG), that you logged out and back in since being added, and replug the camera.

The camera is found and delivers no frames. See If a Camera Is Connected and Silent; this is the HID control interface, and it produces no error message at all.

otc_find reports no devices while another program has the camera. Camera access is exclusive. Close anything else holding it.

Calibration download fails. The SDK fetches calibration data over HTTPS on first use of a camera. Check ca-certificates is installed and that the machine can reach the calibration service.

The GPU backend is not used. It needs a real GPU: a software Vulkan implementation such as lavapipe is refused deliberately, because running the pipeline on it is slower than the CPU path written for that purpose. The SDK falls back on its own and logs the reason. Temperatures are the same either way.

On Windows, import optris_sdk or a C# program says otcsdk-34.dll could not be loaded, although the file is there. The Microsoft Visual C++ runtime files are most likely not beside it, which happens when otcsdk-34.dll was copied somewhere on its own. Copy msvcp140.dll, msvcp140_atomic_wait.dll, vcruntime140.dll and vcruntime140_1.dll from the SDK's bin folder next to it, or install the Microsoft Visual C++ Redistributable (x64); see What You Need. Both bindings say so in their error message.

pip install optris-sdk finds no matching distribution. pip found no wheel for your computer. The wheels are for 64-bit Windows and for 64-bit Linux with glibc 2.35 or later, with Python 3.9 or later; see Python with pip. A pip older than 20.3 does not recognise the Linux wheels, so run python3 -m pip install --upgrade pip first. dotnet add package Optris.Sdk fails with NU1101: Unable to find package. The package is on nuget.org from version 12.0.6 on. Check that nuget.org is one of your package sources with dotnet nuget list source. On a computer without internet access, add the examples/packages folder of an SDK installation as a source instead; see C# and .NET.

If a Camera Is Connected and Silent

Getting the HID rule wrong produces no error message. The camera enumerates, otc_find lists it, the SDK reports it connected, and it delivers no frames, because the control channel that tells it to start streaming was never established.

Check dmesg for repeated hid-generic 0003:0403:DE37.NNNN lines with a climbing index, then check which driver holds interface 2:

for i in /sys/bus/usb/devices/*:*; do
  [ -e "$i/bInterfaceNumber" ] || continue
  [ "$(cat "$i/bInterfaceNumber")" = "02" ] || continue
  d="${i%:*}"
  [ "$(cat "$d/idVendor" 2>/dev/null)" = "0403" ] || continue
  [ "$(cat "$d/idProduct" 2>/dev/null)" = "de37" ] || continue
  echo "S/N $(cat "$d/serial") interface 2 -> \
$(readlink "$i/driver" | sed 's|.*/||')"
done

The question is whether interface 2 is on usbhid, not whether it is on usbfs. On a correctly configured machine that is not streaming, interface 2 has no driver at all and the line ends empty; that is the rule having done its job. usbfs appears only while a libusb process actually holds the claim, so an idle machine never shows it. usbhid is the one answer that means the rule has not applied.

Filter on the vendor and product IDs as above, and key on the serial number in the output. An ordinary desktop has several other USB devices with three HID interfaces each (a keyboard and a mouse will both show an interface 2 bound to usbhid, quite correctly), and reading those as the camera is an easy and convincing mistake.