Optris.Sdk 12.0.26

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Optris.Sdk --version 12.0.26
                    
NuGet\Install-Package Optris.Sdk -Version 12.0.26
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Optris.Sdk" Version="12.0.26" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Optris.Sdk" Version="12.0.26" />
                    
Directory.Packages.props
<PackageReference Include="Optris.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Optris.Sdk --version 12.0.26
                    
#r "nuget: Optris.Sdk, 12.0.26"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Optris.Sdk@12.0.26
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Optris.Sdk&version=12.0.26
                    
Install as a Cake Addin
#tool nuget:?package=Optris.Sdk&version=12.0.26
                    
Install as a Cake Tool

Optris SDK for .NET

Work with Optris thermal cameras from C#.

Documentation: https://docs.optris.com/sdks/otc-sdk/

This one package carries two APIs:

API namespace assembly use it for
v12 Optris.Sdk Optris.Sdk.dll all new code
version 11 compatible Optris.OtcSdk Optris.OtcSdk.dll existing code written against SDK 11

Both are in the package and both are referenced as soon as you add it, so there is nothing else to install. Earlier releases published the version 11 compatible API as a separate package, Optris.OtcSdk; that package is no longer produced. Replace a reference to it with a reference to Optris.Sdk and your code compiles unchanged, with the same namespace and the same types.

New code should use the v12 API. It is written by hand for .NET: frames arrive through await foreach, camera handles are SafeHandles that release correctly even if you forget, frame pixels are spans over the camera's own memory rather than copies, and every failure is an exception rather than a status code you have to remember to check. The version 11 compatible API is there so that existing applications keep working while you move them over, one project or one file at a time.

The package brings the native SDK with it. Both APIs load the same native library from the same folder, so an application can use both at once.

It targets net10.0, so your project needs to be on .NET 10 or later.

Every public type and member of the v12 API carries documentation, so your editor answers most questions through IntelliSense. For the long form, the SDK's own manual has a chapter The Optris SDK from C# (which thread a callback arrives on, how long a frame's pixels stay valid, what the frame buffer does when it fills) and a chapter on migrating from version 11 to version 12.

Getting started

dotnet add package Optris.Sdk

or, in the project file:

<ItemGroup>
  <PackageReference Include="Optris.Sdk" Version="12.0.*" />
</ItemGroup>
using System.Numerics;
using Optris.Sdk;

// A simulated camera needs no hardware. Use ThermalCamera.Open() for a
// real one.
await using var camera = ThermalCamera.OpenSimulated();

// A measuring region, in coordinates normalized to the frame.
using var region = Region.Rect(centre: new Vector2(0.5f, 0.375f),
                               size: new Vector2(0.4f, 0.3f));
region.Name = "middle";
ulong id = camera.AddRegion(region);

camera.Start();

int measured = 0;
using var stopping = new CancellationTokenSource(TimeSpan.FromSeconds(60));
try
{
    await foreach (ThermalFrame frame in camera.FramesAsync(stopping.Token))
    {
        using (frame)
        {
            // A real camera's first frames, about 20 s of them, come
            // before its startup calibration has finished: not
            // measurements.
            if (!frame.Metadata.IsThermalDataReliable)
            {
                continue;
            }
            Console.WriteLine($"{frame.MinTemperature:F1} to " +
                              $"{frame.MaxTemperature:F1} C");
            if (++measured == 30)
            {
                break;
            }
        }
    }
}
catch (OperationCanceledException)
{
    // A minute without 30 measurements. Cancelling the token is how
    // the stream ends, and it ends with this exception.
}

if (measured > 0)
{
    RegionStats stats = camera.GetRegionStats(id);
    Console.WriteLine($"region mean {stats.Mean:F1} C");
}

Three things worth knowing

Dispose every frame. A frame holds memory the garbage collector cannot see the size of, and a camera produces them as fast as it runs. using on every frame is the whole discipline.

Frame pixels are a view, not a copy. frame.Pixels points at the camera's own memory and is valid until that frame is disposed. That is what makes streaming cheap. To keep the data, call frame.ToArray() or frame.CopyTemperaturesTo(buffer).

A slow consumer drops frames rather than growing. The frame buffer is bounded, and when it fills the oldest frame is discarded, so falling behind costs you freshness and not memory. BufferedFrameDropCount tells you when it is happening.

Finding cameras

foreach (DeviceInfo device in Sdk.EnumerateDevices())
{
    Console.WriteLine(device);
}

Existing code: the version 11 compatible API

Code written against SDK 11 keeps its using Optris.OtcSdk; and compiles against this package as it is:

using Optris.OtcSdk;

Sdk.init(Verbosity.Info, Verbosity.Off, "MyApplication");
var version = Sdk.getVersionInfo().getSdkVersion();
Console.WriteLine($"SDK {version.getMajor()}.{version.getMinor()}." +
                  $"{version.getPatch()}");

Both namespaces have a class called Sdk. In a file that uses both APIs, give one of them an alias, for example using V12 = Optris.Sdk; and then V12.Sdk.Version.

Package layout

One package carries the native libraries for linux-x64, linux-arm64 and win-x64 under runtimes/<rid>/native/, and NuGet picks the right one for your application.

lib/net10.0/Optris.Sdk.dll                    the v12 API
lib/net10.0/Optris.OtcSdk.dll                 the version 11 compatible API
runtimes/win-x64/native/otcsdk-<n>.dll        the SDK library
runtimes/win-x64/native/otcsdk_csharp.dll     used by the version 11 compatible API
runtimes/win-x64/native/av*.dll, sw*.dll      FFmpeg, and the Visual C++ runtime
runtimes/linux-x64/native/libotcsdk.so.<n>    the SDK library
runtimes/linux-x64/native/libotcsdk_csharp.so used by the version 11 compatible API
runtimes/linux-x64/native/libav*, libsw*      FFmpeg
runtimes/linux-arm64/native/...               the same for 64-bit ARM
contentFiles/any/any/otcsdk/                  Formats.def, palettes, Norm
tools/udev/                                   Linux USB rules and their installer
build/Optris.Sdk.targets                      copies the data files to your output
licenses/                                     third-party notices, per runtime
eula.txt                                      the licence agreement

<n> is the version of the SDK's binary interface. The native libraries and the data files (Formats.def, Norm/, palettes/) are copied into your build output automatically.

Linux

Two things are needed from the system:

1. libusb. The SDK takes libusb-1.0 from the distribution, and a minimal system or container usually lacks it. On Debian and Ubuntu:

sudo apt-get install libusb-1.0-0

Without it the first SDK call fails with a message that names this package. Everything else the SDK needs (libudev, zlib, OpenSSL 3) is part of every supported distribution: Debian 12 and 13, Ubuntu 22.04 and 24.04.

2. The udev rules, so USB cameras work without root. There are two, and they ship under tools/udev with a script that installs both:

cd ~/.nuget/packages/optris.sdk/<version>/tools/udev
sudo ./install-udev-rules.sh
sudo usermod -aG video "$USER"     # then log out and back in

89-otcsdk-usb.rules grants the video group access to the camera. 90-otcsdk-hid-libusb.rules keeps the kernel's usbhid driver off the camera's HID control interface, which the SDK claims through libusb. The script also releases that interface on cameras that are already plugged in. Without the second rule the camera connects and delivers no frames, and no error is raised; replug a camera that was in use while the script ran.

Nothing to install for FFmpeg. The recording and playback paths use libavcodec, libavformat, libavutil, libswscale and libswresample, and the package carries them beside the SDK library, on Linux as on Windows. Do not replace them with your distribution's FFmpeg: distributions build it with GPL components, and the bundled build is FFmpeg 7.1.5 under the LGPL v3, built without them. H.264 and HEVC export work through whatever hardware encoder the machine has.

Troubleshooting on Linux

  • A missing symbol at start-up: an older SDK installed under /usr/lib can be found before the copy in your application. The package's own copy is preferred, so this is rare; remove or rename the older library if it happens.
  • Opening a camera hangs: another process holds the USB device, for example a running Optris service or a previous instance that crashed. sudo fuser -v /dev/bus/usb/<bus>/<dev> names it.

Windows

No extra setup. The SDK library, the FFmpeg libraries it uses and Microsoft's Visual C++ runtime are copied into your build output, so nothing has to be installed or put on PATH.

Debug symbols for the native libraries

The package carries the matching debug symbols for the Windows libraries:

symbols/win-x64/otcsdk.pdb
symbols/win-x64/otcsdk_csharp.pdb

They are not copied into your application's output directory. Point your debugger's symbol path at ~/.nuget/packages/optris.sdk/<version>/symbols/win-x64 when you open a crash dump that has frames in either library. The symbols in a package always match the libraries in that same package, so fetch the package whose version the application shipped. The Linux libraries are built without debug information.

Third-party code in this package, and its licences

This package contains code that is not ours: the FFmpeg libraries beside the SDK, the GPU engine and the HTTP, logging, JSON and XML libraries compiled into the SDK library, and on Windows the DirectShow capture base classes. Every one of their licences is in the package:

licenses/THIRD-PARTY-NOTICES.md        what each notice covers
licenses/<rid>/                        the texts, per runtime
runtimes/<rid>/native/                 the FFmpeg licence texts, beside the libraries they cover

The FFmpeg libraries are LGPL v3, and that is three files rather than one. The LGPL v3 is written as additional permissions on top of the GPL v3, so GPL-3.0.txt travels with FFMPEG-LICENSE.txt, and FFMPEG-SOURCE.txt names the exact build, where to download its source, its checksums and how to replace it with your own. The libraries are ordinary shared libraries beside the SDK, and dropping in your own compatible build works. Those three files sit in runtimes/<rid>/native/, which is copied into your application's output, so they stay with the libraries when you redistribute them.

If you redistribute this SDK inside your own product, those files are what you need; you do not have to assemble them yourself.

Licence

Proprietary. (c) Optris GmbH & Co. KG. The licence agreement is eula.txt in this package, with the full set of legal texts under licenses/optris-eula/.

Support

Optris GmbH & Co. KG, direct-sdk@optris.com, https://www.optris.com

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
12.0.39 0 11/30/2026
12.0.38 0 11/30/2026
12.0.37 63 11/28/2026
12.0.36 63 11/28/2026
12.0.35 92 11/28/2026
12.0.34 98 11/27/2026
12.0.33 68 11/27/2026
12.0.32 85 11/26/2026
12.0.31 92 11/26/2026
12.0.30 63 11/25/2026
12.0.29 73 11/25/2026
12.0.28 79 11/24/2026
12.0.27 110 11/24/2026
12.0.26 119 11/23/2026
12.0.25 140 11/23/2026
12.0.24 116 11/23/2026
12.0.23 124 11/22/2026
12.0.22 110 11/22/2026
12.0.21 119 11/22/2026
12.0.20 113 11/21/2026
Loading failed