OptrisOptrisDocumentation

Documentation/OTC SDK/Overviewv12.0

Troubleshooting

In Fahrenheit: with the SDK switched to Fahrenheit (SetTemperatureUnit() and its counterparts, see Temperatures in Fahrenheit), every temperature on this page is read and written in Fahrenheit, and every difference in Fahrenheit degrees; the samples are unchanged.

A symptom that is about one binding rather than about the SDK is on that binding's own page: Troubleshooting for DllNotFoundException and EntryPointNotFoundException, The Optris SDK from Python and The Optris SDK from Rust for theirs.

Compiling Your Own Application

Which C++ standard your application needs

C++17 or later. The public headers compile at -std=c++17 and the installed CMake target asks for cxx_std_17, which is a floor rather than a cap. Until API version 29 they needed C++23 and the target asked for it, so linking the SDK dragged the whole project up to C++23; if you are reading an older copy of this page, that is the change.

The compilers Optris builds and tests with:

  • GCC 13 or later
  • Clang 17 or later
  • MSVC 2022 (v17.6+) or later

That is the tested set, not the language floor, and the oldest compiler that can take these headers at C++17 has not been measured. Nothing checks a version for you either (CMake states a standard and lets the compiler fail), so a compiler that cannot cope shows up as a compile error in a header rather than as a clear message.

If you build the shipped C++ examples, they need a little more: several of them include <print>, which libstdc++ only ships from GCC 14. The SDK's own headers do not use it, so this affects the examples and not your application.

error: 'std::print' was not declared in this scope

On Ubuntu:

sudo apt install gcc-14 g++-14
cmake -B build -DCMAKE_C_COMPILER=gcc-14 \
               -DCMAKE_CXX_COMPILER=g++-14

Nothing else here is about your build

The SDK ships pre-built; you do not compile it. If you are seeing a CMake failure that names FFmpeg, wgpu-native, libusb, libudev or a licence check, that is a failure of a source build of the SDK itself and is not something an installed package can produce. Check that you are pointing your project at the installed SDK rather than at a source tree, see Start Developing.

Runtime Issues

"No camera found"

The camera is not detected. Check:

  1. USB connection. Is the camera plugged in and powered? Try a different USB port.

  2. USB permissions (Linux). Cameras exposed as video devices need your user to be in the video group: bash groups # Check current groups. sudo usermod -a -G video $USER # Add yourself. # Log out and back in for the change to take effect.

  3. udev rule (Linux). The SDK package installs 89-otcsdk-usb.rules, which gives the PI cameras' USB interface (FTDI 0403:de37) write access. If you use the Python package from PyPI or the C# package from nuget.org without the platform package, the rules come inside those packages and have to be installed once by hand: Python with pip and The NuGet package on Linux show how. The Linux archive carries them in lib/udev/rules.d/.

  4. Ethernet cameras. Pass include_network = true in EnumerationOptions: cpp optris::sdk::EnumerationOptions opts; opts.include_network = true; auto devices = optris::sdk::EnumerateDevices(opts); c optris_sdk_enumeration_options opts; optris_sdk_device_list *devices = NULL; optris_sdk_enumeration_options_init(&opts, sizeof(opts)); opts.include_network = 1; optris_sdk_enumerate_devices(&opts, &devices); cs IReadOnlyList<DeviceInfo> devices = Sdk.EnumerateDevices( new Optris.Sdk.EnumerationOptions { IncludeNetwork = true }); py devices = optris_sdk.enumerate_devices( optris_sdk.EnumerationOptions(include_network=True)) rust let devices = enumerate_with( &EnumerationOptions::new().include_network(true))?;

  5. Simulated cameras. For testing without hardware, use SimulatedConfig or include_simulated = true in enumeration options.

  6. OTC_SDK_NO_HARDWARE in the environment. With it set, the SDK deliberately reaches no real camera: enumeration reads no local bus and sends no discovery broadcast, and opening a camera fails with a message naming the variable. It exists so a test run cannot touch cameras it does not own (the SDK's own managed test stages set it), and simulated cameras are unaffected. If enumeration returns an empty list on a machine with a camera plugged in, check this first; OTC_SDK_ALLOW_HARDWARE overrides it.

  7. Check with the tools. otc_find lists what the SDK can see without writing any code; add --connection ethernet for network cameras only.

Calibration download fails

When a camera is opened on a machine that does not yet have its calibration files, the SDK obtains them from ImagerConfig::calibration_path, from the camera itself on models that store them, or from the Optris calibration servers (https://calibration.optris.com/api, then https://calibration.optris-ir.cn/api). If opening fails with CalibrationException, its message names which source fell short. otc_cali status shows the calibration directory, the servers in the order they are tried, and (with -s <serial>) the files already present.

  1. Check network access. The machine must reach the calibration servers over HTTPS (port 443). The SDK uses its own statically built libcurl (through cpr), not the operating system's HTTP stack.
  2. Local calibration. If the machine is offline, copy the calibration files into the directory GetCalibrationDir() returns (by default ~/.config/optris/Cali/ on Linux and APPDATA%\Imager\Cali\ on Windows), or point ImagerConfig::calibration_path at a directory holding them. The simplest way to get the files is to open the camera once on a machine that is online.
  3. Forbid the network explicitly. On a machine that must not reach out, set ImagerConfig::allow_calibration_download = false; the camera and calibration_path are then the only sources, and a failure says so.
  4. Temperatures look wrong but the camera opened. A camera can open and stream without its calibration. Imager::GetCalibrationStatus() returns kMissing in that case and GetCalibrationDiagnosis() says why.
  5. Cameras that carry their own calibration. The Xi 80, Xi 320 MT and Xi 410 keep theirs in on-device memory and the SDK reads it out of the camera's frames, which is the first source it tries. When that cannot be done the log says which of three things happened: no block ever arrived, the transfer stopped part-way, or the video format in use carries no frame telemetry to read the block address from.

An Ethernet camera opens but never delivers a frame (Stalled)

The camera is found, the control connection succeeds, the model and video format are read correctly, and then nothing arrives. Imager::GetConnectionStatus() goes Connected and then Stalled, and the log says "No frame data from ... for more than 10000 ms". The control channel and the frame stream are different directions on different protocols, so all of this is consistent with the frames being dropped before they reach the SDK.

  1. The Windows firewall, first. Inbound UDP is blocked by default, and this is by far the most common cause. See Ethernet Cameras for the rule; write it for the program, not for a port, because a port rule stops matching as soon as a camera is moved to a different port. The Xi 640 ETH needs 9999 and 9998 rather than the configured destination port.
  2. Two cameras on one port. Every camera ships streaming to 50101, so two of them pointed at one host collide. Opening the second is refused by name when both are in the same process; across two processes it shows up as a bind failure during the open. The first camera can be the one that stops working. Give each camera its own port (Ethernet Cameras).
  3. A camera still streaming from a program that exited. There is no handshake and no timeout, so a crashed or killed application leaves its camera sending datagrams at this host indefinitely. The next program to run, even one opening a different camera, is the one that looks broken. Power-cycle the camera, or re-open it and close it properly.
  4. The subnet mask in the camera. The mask stored in the camera has to cover the host it streams to, because the camera cannot route. See Ethernet Cameras for the addressing rules.
  5. Ask the camera where it is sending. otc_net show -s <serial> reads the camera's own network configuration, including the destination address and port it is actually streaming to, over the control channel, which works even when no frame does. otc_net list shows every camera on the network and the port each one uses, which is how two cameras on one port become visible.

Camera runs on the CPU pipeline instead of the GPU

Which pipeline a camera uses is decided per camera while it opens, and a CPU pipeline is not necessarily a fault. The CPU pipeline is chosen for cameras with sample-point calibration, when OTC_FORCE_CPU is set, when the caller asked for it, when the SDK's table of measured camera modes says so, for small frames (below 65536 pixels, or OTC_GPU_MIN_PIXELS), and when no usable GPU is found. A camera whose GPU pipeline was created but then failed to initialize is also moved to the CPU pipeline rather than left without a picture; the SDK logs this at error level with the camera's serial and the reason. No exception is thrown in any of these cases, and the two pipelines are held to the same results.

To see what was chosen and why, read imager->Processing().Info() after the camera has opened: kind is the pipeline, reason the rule that decided it, and explanation the same sentence the log carries. PipelineReason::kGpuInitFailed is the one to treat as a fault. optris::sdk::GetGpuInfo() reports whether the process found a usable GPU at all.

Recording file won't open

If Player::Open() throws IoException:

  1. File exists. Verify the path is correct and the file is readable.
  2. Codec support. Thermal recordings use FFV1, which is native to ffmpeg and present in every build, and the SDK ships the ffmpeg it links rather than using the machine's. So a missing codec is not a likely cause here, and nothing needs installing to read a recording.
  3. Incomplete recording. If the application crashed during recording, the MKV file may not be finalized. MKV is designed to be recoverable, but some metadata may be missing.

A process interface closes the shutter but no Closing or Opening is reported

The transitional shutter states come from the camera, not from the SDK: each frame's telemetry carries the flag's position, and the SDK publishes what it finds. What a camera can distinguish is a property of its firmware, and one that reports only "open" and "closed" produces no Closing and no Opening, and no stuck-shutter Error either, because nothing was announced that could then fail to arrive. The Closed/Open pair is unaffected.

To find out which your camera sends, set OTC_LOG_SHUTTER_BYTE before starting your application. =all logs every frame, =N the first N, and each line goes to stderr:

SHUTTERBYTE serial=22042036 frame=412 backend=gpu byte11=3 (closing) flag_open=1 owner=process-interface published=Closing

serial is the camera the line is about, so a host running several of them produces one readable log rather than one interleaved one. byte11 is the camera's own value (0 open, 1 closed, 2 opening, 3 closing), backend is which pipeline decoded it, and owner says whether an input held the flag at that moment. If a closure you made never shows a 2 or a 3, the firmware does not report them. Off unless set; read once at startup. See the Process Interface page for the whole picture.

The shutter state, the export marker or the frame counter looks wrong: OTC_LOG_HKD_ROW

Every one of those three comes out of the same few bytes of every frame: the housekeeping row the camera appends to the picture. If one of them is wrong, the useful question is not "which field is broken" but "is the row where the SDK is looking for it", and the three answers above cannot distinguish the two cases: a row read from the wrong place still produces a shutter state, a marker and a counter, all of them confident and all of them nonsense.

OTC_LOG_HKD_ROW=N prints the row for the first N frames, in hex, next to the verdict the SDK reached on every field it governs. Two lines per frame, to stderr:

HKDROW format=v11 bytes=64 valid=1 flag=40.6875/1 box=40.6875/1 optics=0.0000/1 chip_raw=953(max 4095)/1 byte11=0 flag_state=0 counter=5198 fwcyp=0x0b05(gate 1) handling=0x0030(fullrate 0x0020 -> 1) export=2 corroborated=1
HKDROW hex=00 00 03 b9 14 58 00 14 58 ff ff 00 00 ff ff 05 0b 00 00 30 00 00 00 14 4e 96 3f f1 f8 ...

Read fwcyp first

The one field to read first is fwcyp, because it checks the layout rather than reporting a measurement. It is the camera's own firmware revision, sitting in the middle of the row, and you already know what it should be. otc_info --serial <serial> prints it, and so does DeviceInfo::firmware_revision. On the camera above that is 0x0b05, which is 2821, and the control channel independently reported 2821. If fwcyp does not match the firmware revision you know the camera has, the row is not being read from the right place, and nothing else on either line means anything. That is worth more than any of the temperatures, because a temperature can look plausible by accident and a firmware revision cannot.

The rest of the line

Each field sits beside the test it had to pass, so a refusal is visible as a refusal rather than as a missing value:

  • flag, box and optics are followed by /1 or /0: whether the SDK will use that probe. A /0 means the value fell outside −50 °C to 200 °C.
  • chip_raw is the detector's raw count with the converter's limit beside it; a count above the limit is reported as /0 rather than converted, because finishing that conversion needs the camera's own calibration.
  • byte11 is the raw shutter byte and flag_state what the SDK made of it.
  • handling is the word carrying the export-restriction marker, with the bit it is tested against and the result. Read the polarity carefully: the bit is set for permission. fullrate 0x0020 -> 1 means this unit may run at its full frame rate; -> 0 means it is restricted to 9 Hz, so -> 0 and export=1 agree rather than contradicting each other. The marker is also required to be corroborated (fwcyp non-zero and all three probes in band) because the restricted reading is the state of a bit that two shipping firmwares never write, and corroborated=0 is why a marker can come back as "not stated" on a row that otherwise decoded.
  • export is the conclusion: 0 not stated, 1 restricted, 2 full rate. (This legend had the last two the wrong way round until 2026-11-10, which is the same polarity mistake as the bit/fullrate label above it and in the same paragraph. The values are hal::ExportMarker's own: kUnknown 0, kRestricted 1, kFullRate 2.)

Bounded deliberately, and it will tell you so: the row is read before any frame-rate limit applies, so this cannot be left on as a permanent per-frame channel. =N above the maximum is reduced and a line on stderr says what it was reduced to. Off unless set.

This works on every camera and both pipelines, and it is the thing to attach to a report about a wrong shutter state, a wrong frame rate or a camera that never finishes its start-up calibration.

Frame freeze during shutter (NUC)

This is normal behavior. When the camera performs a flat-field correction (NUC), the internal shutter closes briefly and no new thermal data arrives. The duration depends on the camera model (typically 0.5-2 seconds).

Register SetShutterCallback() (C++), optris_sdk_imager_set_shutter_callback() (C) or OnShutterState() (.NET) to be told when it starts and ends, so the application can say so on screen rather than looking frozen. Each transition carries a timestamp, which is what a "this cycle is taking too long" warning needs.

You can also see it in the frames. Frames keep arriving through the closed window (the SDK holds the last frame taken with the shutter open and delivers that), so ThermalFrame::flag_open is false on those frames, on every source, and they carry is_repeated_frame. A watchdog, or anything inferring a cycle from frames stopping, reads flag_open, is_repeated_frame or the notification instead. The notification remains the only way to tell a shutter on its way from one that has arrived, since a camera reports Closing and Opening as well.

"No device found" after abrupt shutdown (Xi series, Linux)

If an SDK application is killed (SIGKILL, Ctrl+C without graceful shutdown) while connected to a Xi 80, Xi 320 MT, Xi 410, or Xi 1M via USB, the kernel may not release the device. The camera will not appear in subsequent enumerations.

Fix: Unplug and replug the camera.

Prevention: Ensure Imager::Stop() is called or the Imager object is destroyed before the application exits. Use signal handlers to clean up on SIGINT/SIGTERM.

Linux-Specific Issues

UVC driver compatibility

On some host systems, cameras with higher resolutions (PI 640, Xi 640) may have USB compatibility issues. The UVC kernel driver provides workaround options:

# Unload the module (close all camera applications first).
sudo rmmod uvcvideo

# Reload with workarounds.
sudo modprobe uvcvideo nodrop=1 quirks=2

# Make permanent:
echo "options uvcvideo nodrop=1 quirks=0x2" | \
    sudo tee /etc/modprobe.d/uvcvideo.conf

Linux kernel 6.11-6.12.22 frame drop bug

A Linux kernel bug in versions 6.11 through 6.12.22 causes all received frames to be discarded for cameras using isochronous USB transfer (all models except Xi 80, Xi 320 MT, Xi 410, Xi 1M). Upgrade to kernel 6.12.23 or later.

Windows-Specific Issues

Examples don't start

The ready-to-run programs shipped with the SDK (simpleView, the showcase, the playground, the c_ examples and the otc_ command line tools) need nothing installed first. Everything they load is in their own folder: the programs in examples\bin load the copy of otcsdk-34.dll and of the C++ runtime that sits beside them, and the command line tools in bin load the files in bin. If one of them does not start, a file is missing from the installation; reinstall the SDK. If you copy one of them somewhere else, copy the .dll files from its folder with it.

A program you built yourself against the SDK uses the dynamic C++ runtime, like otcsdk-34.dll itself and like the shipped examples. The SDK ships that runtime in its bin folder, beside otcsdk-34.dll: msvcp140.dll, msvcp140_atomic_wait.dll, vcruntime140.dll and vcruntime140_1.dll. When you deploy your program to another machine with otcsdk-34.dll beside it, put those four files there too, or install the Visual C++ Redistributable for x64 on that machine.

A program says otcsdk.dll was not found

The program was built against SDK 12.0.1 or earlier. Since 12.0.2 the SDK library on Windows is called otcsdk-34.dll, named after the version of the connection between a program and the library, so a program built against an older SDK looks for the old name and Windows stops it before it starts. This is on purpose: the alternative is a program that runs against a library it was not built for. Rebuild the program against this SDK; you still link otcsdk.lib, so nothing in your project changes. Then ship it with otcsdk-34.dll beside it, or with the SDK's bin folder on PATH.

Direct temperature mode (Xi cameras)

Xi cameras support an autonomous "Direct temperature mode" where the camera itself calculates temperatures. If this mode is active, the SDK will apply the temperature calculation a second time, producing incorrect results. Disable it in PixConnect: Configuration > External Communication > uncheck "Direct temperature mode".

Thermal Data Issues

Unexpected temperature values

  • Emissivity. Verify the correct emissivity is set for your target surface. Default is 1.0 (blackbody). Most real surfaces have lower emissivity.
  • Temperature range. Ensure the active temperature range covers the expected temperatures. GetTemperatureRange() returns the active one and GetDeviceInfo().available_ranges lists the supported ones.
  • Calibration. Check GetCalibrationStatus() first: kMissing means the camera is streaming without its calibration and every temperature is wrong. To refresh the files, delete them from the calibration directory (GetCalibrationDir()) and let the SDK obtain them again on the next open.
  • Radiation parameters. Check ambient temperature and transmissivity settings with Radiometry().Get(). If a PIF channel is configured to supply emissivity or ambient temperature, it overwrites values set through Radiometry() on every PIF sample. Radiometry().Sources() reports which of the two is driving each parameter: it follows the PIF channel table, so an input configured as emissivity or ambient temperature reads back as kPif from the moment it is configured, before any reading has arrived for it. A PIF ambient channel also clears RadiationConfig::estimate_ambient as a side effect.

False color looks wrong

If the RGBA output does not show the expected colors:

  • Verify the correct palette is set with GetPalette().
  • Check the color range. If set to manual with SetColorRange(), ensure the range covers the temperatures in the scene. Use SetColorRange(std::nullopt, std::nullopt) to return to auto-scaling; GetEffectiveColorRange() reports the range actually in use.

Error Handling Pattern

Use this pattern to handle all SDK errors gracefully:

#include <optrissdk.h>
#include <iostream>
#include <print>
#include <string>

int main() {
  try {
    auto imager = optris::sdk::Imager::Create();

    // Register error callback for non-fatal errors
    // on the processing thread.
    imager->SetErrorCallback(
        [](const std::string& msg) {
      std::println(stderr, "[SDK] {}", msg);
    });

    imager->SetThermalCallback(
        [](const optris::sdk::ThermalFrame& f) {
      // Frames from before the startup calibration has finished
      // arrive too, and are not measurements.
      if (!f.GetMetadata().thermal_data_reliable) return;
      std::print("Max: {:.1f} C\r",
                 f.GetMaxTemperature());
    });

    imager->Start();
    std::println("Press Enter to quit...");
    std::cin.get();
    imager->Stop();

  } catch (const optris::sdk::DeviceException& e) {
    std::println(stderr, "Device: {}", e.what());
    return 1;
  } catch (const optris::sdk::CalibrationException& e) {
    std::println(stderr, "Calibration: {}", e.what());
    return 1;
  } catch (const optris::sdk::SdkException& e) {
    std::println(stderr, "SDK: {}", e.what());
    return 1;
  }
}