OptrisOptrisDocumentation

Documentation/OTC SDK/Overviewv12.0

Command Line Tools

Overview

Eleven programs that drive a camera, or work on its recordings, without writing any code. They are built when BUILD_APPS=ON (the default). They are installed to /usr/bin on Linux and to C:\Program Files\Optris\otcsdk\bin on Windows.

They exist for two jobs: checking that an installation works, and giving support something concrete to ask for. otc_find and otc_info --json are the two worth attaching to a support request.

Tool What it does
otc_version print the SDK version
otc_find list the cameras the SDK can see
otc_info everything known about one camera
otc_stream stream frames or per-frame statistics to stdout
otc_snapshot save a single frame as PNG, TIFF, CSV, JSON or raw
otc_net configure an Ethernet camera's address
otc_config generate, validate and print camera 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; opens no camera
otc_ravi convert PIX Connect .ravi recordings into SDK recordings; opens no camera
otc_virtual run a virtual camera through the real processing pipeline; opens no camera

Conventions

The tools agree on the following, so knowing one means knowing all of them.

Choosing a camera. Tools that open a camera accept --serial (or -s), with one exception: otc_config validate and otc_config show take only --simulated, so they use the first camera found or the synthetic one. With no serial the first available camera is opened. --simulated wins over --serial (a serial given with it becomes the synthetic camera's serial) and uses the SDK's built-in synthetic camera, which needs no hardware and is the way to try most of these without a device attached. otc_net has no simulated mode (it configures real hardware), and otc_rdc and otc_ravi open no camera at all.

If the serial does not match anything, the tool says so and lists the serials it did find:

$ otc_snapshot --serial 12345678 -o out.png
error: no camera with serial 12345678. Cameras found:
  21074191  Xi 400
  16030066  PI 4x0

Streams. Payload goes to stdout; everything else (progress, warnings, errors, SDK log output) goes to stderr. That is what makes this safe:

otc_stream -f raw > frames.bin
otc_find --json | jq '.[].serial'

Exit codes.

Code Meaning
0 it worked
1 it did not work: the camera or the filesystem refused, or the tool's own check failed
2 the command line was wrong; nothing was attempted

Code 1 is "no" in the widest sense, not only a refusal by the camera or the disk: otc_rdc check returns it when the measured bow exceeds its threshold, and otc_ravi returns it for a refused conversion or a verify mismatch. Each says which on stderr.

A camera that opens and then sends no frame is also code 1, from the two tools that wait for frames, otc_stream and otc_snapshot. A camera can start without any error and still send nothing, so a check that only asks whether the tool succeeded needs this to tell a working camera from a silent one. Both tools write one line naming the camera:

$ otc_stream -d 10s -q
error: no frame arrived from camera 21074191 (Xi 400) in 10.0 s after it started
$ echo $?
1

otc_info opens and starts the camera too, but it reports what the camera says about itself and needs no frame for that, so a camera that sends nothing does not change its exit code.

Units. Temperatures are printed in degrees Celsius unless you ask otherwise. otc_stream and otc_snapshot, the two tools that print readings, take --fahrenheit for their CSV and JSON output: the numbers are converted and rounded the way the SDK rounds everything it shows, and the names say so (min_f instead of min_c). Their binary output (-f raw, and the PNG and TIFF files) keeps the SDK's own units, so --fahrenheit with one of those is refused rather than ignored. The other tools stay in Celsius because what they print is a setting or a calibration value, which you type back in Celsius: otc_info's temperature ranges, otc_config, otc_virtual, otc_ravi's file details, otc_cali and otc_rdc. Error messages and log lines are in Celsius too.

--json. otc_find, otc_info and otc_version accept it directly. On the tools with subcommands it belongs to the subcommand: otc_net list and otc_net show, and otc_ravi convert, verify, info and scan. The JSON is the only thing on stdout, so it can be piped straight into a parser.

otc_version

Everything needed to identify a build, in one command. The product version alone does not identify an installation: it says nothing about which API the library speaks or which commit it came from, and both have been asked for by hand before. Attach this to a support request.

The transcript below is illustrative. The commit, the branch, the dates and the platform are whatever your own installation reports; only the shape of the output and the two version numbers are being shown. Run the command rather than reading values off this page, and please do not "correct" the sample to the output of any particular build.

$ otc_version
otc-sdk 12.0.1 (Release)
  API version    34
  C ABI version  34  (the same number, read through the C ABI)
  Commit         3f9c4ad21  2026-10-14T09:41:52 +0200  release/v12.x
  Built          2026-10-14T08:02:16 +0000  Linux amd64

$ otc_version --json
{"version":"12.0.1","major":12,"minor":0,"patch":1,"build":"Release","commit":"3f9c4ad21","api_version":34,"c_abi_version":34,"commit_date":"2026-10-14T09:41:52 +0200","branch":"release/v12.x","build_date":"2026-10-14T08:02:16 +0000","os":"Linux","platform":"amd64"}

The API version and the C ABI version are one number read through two entry points, so they always agree; printing both is how you see that the C ABI is present and exporting it. The line reads not built (BUILD_C_API=OFF) in a build configured without the C ABI. What changed in each release is in the changelog, and Migration Guide: v11 to v12 is the page to read if you are moving an application from SDK 11.

otc_find

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

otc_find                        # table of everything attached
otc_find --json                 # the same, for scripts
otc_find --simulated            # include the built-in synthetic camera
otc_find --type xi              # only Xi cameras
otc_find --connection ethernet  # only network cameras
otc_find --watch                # live table, updating on plug and unplug

--type selects a family (pi or xi), not one model. --watch names the camera that arrived or left as it happens; it cannot be combined with --json.

An empty list is not an error: otc_find exits 0 having successfully determined that nothing is attached.

otc_info

Everything the SDK knows about one camera: sensor geometry, firmware and hardware revision, capabilities, temperature ranges, operation modes and radiation parameters. Unlike otc_find it opens the camera, so it reports the things that can only be read from a running device.

otc_info                  # the first camera found
otc_info -s 21074191      # a specific one
otc_info --json           # for a support request

otc_stream

otc_stream                             # CSV statistics, one row per frame
otc_stream -f json -n 100              # 100 frames of JSON
otc_stream -f raw -d 10s > frames.bin  # ten seconds of raw float32 Celsius
otc_stream -v                          # live frame rate on stderr
otc_stream --simulated -n 10          # ten frames from the synthetic camera
otc_stream --fahrenheit                # the statistics in degrees Fahrenheit

-f raw writes width * height little-endian float values per frame, in Celsius, with nothing between frames. -n stops after a frame count, -d after a duration (10s, 5m, 1h). Ctrl+C stops it cleanly at any point.

Exit status. A run that received frames exits 0 however it ended: at its -n count, at its -d duration (even before the count was reached), or at Ctrl+C. A run that received no frame at all exits 1 however it ended, and says so on stderr, naming the camera by serial. One more way for such a run to end: when no frame has arrived 30 seconds after the camera started, the tool gives up rather than waiting for ever. --first-frame-timeout changes that wait, in the same form as -d:

otc_stream -n 1 -q --first-frame-timeout 10s > /dev/null || echo "camera sent nothing"

To try a script's handling of this without a camera that misbehaves, set OTC_SIM_WITHHELD_FRAMES to a number of frames and stream from the simulated camera. It then opens and starts as usual and sends nothing until that many frames would have been sent, so a large number such as 1000000 is a camera that never sends one:

OTC_SIM_WITHHELD_FRAMES=1000000 otc_stream --simulated -d 2s; echo $?   # 1
OTC_SIM_WITHHELD_FRAMES=15 otc_stream --simulated -n 5; echo $?         # 0, half a second late

-q suppresses the banner, -v prints a running frame rate to stderr. They cannot be combined. -f accepts csv (the default), json and raw.

--fahrenheit writes the CSV and JSON statistics in degrees Fahrenheit, as min_f, max_f and mean_f, and the -v line in °F. Raw stays float32 Celsius, so --fahrenheit with -f raw is refused.

otc_snapshot

otc_snapshot -o capture.png     # 16-bit PNG, radiometry preserved
otc_snapshot -o capture.tiff    # 16-bit TIFF
otc_snapshot -o capture.csv     # Celsius, one row per scanline
otc_snapshot -f csv             # one-line summary on stdout
otc_snapshot -f raw > frame.bin # float32 Celsius
otc_snapshot --fahrenheit -o capture.csv   # the CSV in degrees Fahrenheit

The format comes from the output file's extension (tif and tiff both work). --format overrides it, and if the two disagree the tool says so rather than writing PNG data into a file called .csv.

png and tiff are real images with the full 16-bit radiometric data and the camera's model and serial embedded; both require --output because they cannot sensibly go to a terminal.

--fahrenheit applies to csv and json. A CSV file is then written by the SDK in Fahrenheit and says # Unit: degF in its header; the one-line summary names its columns min_f, max_f and mean_f; the JSON gains "unit":"degF". With png, tiff or raw it is refused.

The frame saved is the first one that is a measurement, so the tool skips the frames a camera sends during its startup calibration, for up to 40 seconds. A camera that sends no frame at all fails sooner: after 30 seconds by default, or after --first-frame-timeout (for example --first-frame-timeout 10s). Either way the tool exits 1 and says which of the two it was, and nothing is written.

otc_net

Configures the Ethernet models (Xi 80, Xi 410, Xi 410 MT, Xi 320 MT, Xi 1M). Running it against a USB-only camera reports that the camera has no network configuration.

otc_net list                    # network cameras, with serials
otc_net show -s 26074397        # current settings
otc_net show -s 26074397 --json
otc_net show -s 26074397 -a 192.168.0.20   # a camera discovery cannot see

otc_net set -s 26074397 \
    --ip 10.0.0.20 \
    --netmask 255.255.255.0 \
    --dest-ip 10.0.0.1 \
    --port 50000

Only the values you name are changed; the rest are left as they are.

"Destination" is not a gateway. --dest-ip is the host the camera sends its frames to, normally the machine running the SDK. It must differ from the camera's own address. These cameras have no gateway setting; --gateway and --stream-to are accepted as other spellings of --dest-ip, and --subnet of --netmask. The older otc_net set-ip still works as a deprecated alias for otc_net set --ip.

There is no DHCP. The cameras are addressed statically and the SDK implements no DHCP at any layer. --dhcp is rejected rather than accepted-and-ignored.

The camera must be reachable to be reconfigured. otc_net changes the address over the camera's control channel, so the host has to be able to reach the camera at its current address first. A camera whose subnet mask does not match the host's cannot answer the discovery broadcast; --address (-a) on show and set reaches it at a known address instead, and requires --serial, which the camera that answers is checked against. A camera on a network your host cannot route to at all has to be put on a machine or VLAN that can reach it before its address can be changed.

Changing the address or the subnet ends the connection that was used to change it; the camera comes back at its new address. otc_net show confirms it returned.

otc_config

otc_config generate -s 21074191 -o camera.json  # write a config
otc_config generate -s 21074191                 # to stdout
otc_config validate camera.json                 # load it
otc_config show camera.json                     # print it readably

The file is the JSON that Imager::SaveConfig() writes, whatever its extension. validate and show load the file by opening a camera and applying the file to it with Imager::LoadConfig(): the first camera found, or the synthetic one with --simulated. Use --simulated to check a file without touching a real camera.

otc_cali

otc_cali status                 # calibration directory and servers, in the order they are tried
otc_cali status -s 21074191     # and the files present for that serial

status lists what is present, not whether it is complete: which files a camera needs depends on the video formats it reports, so that can only be answered with the camera attached. With -s it exits 1 when no file for that serial is present.

download always exits 1 and explains why: calibration is acquired while a camera is opened, not for a serial number on its own. To prepare an offline machine, open the camera once on a machine that is online and copy the calibration directory across, or point ImagerConfig::calibration_path at a directory holding the files.

otc_rdc

Inspects and exercises radial distortion correction. None of its subcommands opens a camera.

otc_rdc coeffs -d ~/.config/optris/Cali            # distortion coefficients in the Cali-*.xml files there
otc_rdc check --width 640 --height 480 -c k1=-3.3e-06   # correct a synthetic straight edge and report the bow
otc_rdc check --wide                                # keep the full field with an invalid border
otc_rdc sizes -c k1=-3.3e-06                        # the same correction at several frame sizes

check and sizes run the SDK's own remap over synthetic frames, so what they measure is the shipping code path.

otc_ravi

Converts a PIX Connect .ravi recording into an SDK recording, and checks that the temperatures survived the trip. Opens no camera.

otc_ravi convert kiln-run.ravi kiln-run.mkv

The result opens with optris::sdk::Player like any other SDK recording. The same conversion is SDK API in every language, so an application can convert in process; see Converting PIX Connect recordings.

Why this is not a copy

A .ravi file stores signed 16-bit energy counts (the detector's raw signal) together with the camera's calibration, and works the temperature out again on every playback. An SDK recording stores finished temperatures, on a 0.1 K grid. So every pixel goes through PIX Connect's own radiometric model before it is written, per frame, using that frame's own header: emissivity, transmissivity, ambient temperature and the measurement range can all be driven from the process interface while recording, and a converter that read the first frame and assumed it held would be quietly wrong for the rest of the file.

The only loss in the pixel path is rounding to the 0.1 K grid, which is at most 0.05 K.

Subcommands

Subcommand What it does
convert IN.ravi OUT.mkv convert one recording
verify IN.ravi OUT.mkv compare a converted recording against its source, pixel for pixel
info IN.ravi what the file holds, and whether it converts
scan PATHS... classify every .ravi under a directory or in a list
browse PATHS... a full-screen interface over an archive

--json on convert, verify, info and scan prints the report as JSON on stdout and nothing else, so they script.

Refusals

Two kinds of file are refused rather than converted, because converting them would produce readings that look right and are not.

No radiometric model. Header version v1001, and one v1003 file with Lambda = 0, predate the calibration fields. Nothing in the file can turn its counts into degrees:

$ otc_ravi convert Shutter_1000_short.ravi out.mkv
refused: Shutter_1000_short.ravi: header v1001 carries neither a
Planck curve nor a normalization table index; temperature is not
recoverable from this file

Short-wave cameras. The PI 1M, 05M and 08M set an option bit that tells PIX Connect to build a gain-split ADU axis. This tool implements the linear path only, so the low end of the scale would be wrong. --allow-shortwave converts anyway and writes a "do not trust this" note into the file and into the report.

Both exit 1 and say which it was, so a batch run can tell a refusal from a failure.

Checking a conversion

otc_ravi verify kiln-run.ravi kiln-run.mkv --json

This opens the converted file with the SDK's own Player and recomputes every compared pixel straight from the .ravi. It reports pixels_compared, raw_int16_mismatches, max_abs_celsius_error and the worst pixel, and exits non-zero on any mismatch.

What it covers is stated in its own output, under covers: frame orientation, framing, geometry, the per-frame radiometric state, quantization and the container round trip. It does not cover the radiometric model itself; it shares that with the converter, so it would agree with itself however wrong the model was. The model is pinned separately, against the reference implementation it was ported from, by the OtcRaviModel.* cases in tests/tools/test_otc_ravi.cc.

--probe-csv FILE writes frame,index,raw,celsius rows so an independent implementation can check this one.

Options that change the numbers

--clamp-to-range clamps every reading to the declared measurement range ± 26 K, which is what PIX Connect displays. Off by default, because throwing an extrapolated reading away cannot be undone; either way the count is reported as pixels_outside_declared_range. This is not academic: a 150–900 °C kiln scanner pointed at a mostly cold scene puts 41 % of its pixels outside the band.

--limit N converts only the first N frames. --norm-dir DIR points at the normalization tables when they are not beside the binary.

--time-zone ZONE on convert and info names the time zone the PC that recorded the file was in: an IANA name such as Europe/Berlin, or a fixed offset such as +01:00. A .ravi stores its start as that PC's clock showed it, with no zone, so this decides the start in UTC. Without it, this computer's zone is assumed, and the recording and the report say so. info prints the PC's clock reading beside the UTC start. See the start time and the time zone.

Other options

On convert: --verify reads the result back and compares it against the source as soon as it is written, --quiet drops the progress output, --no-scan skips the statistics pass so the file carries no scene block, and --no-per-frame-extras leaves out the flag state, NMEA and PIF readings.

On verify: --limit N and --pixel-step N trade coverage for time; the default compares every pixel of every frame, which on a long recording is not quick. --clamp-to-range tells it the recording was written with that option, so the two sides are compared on the same terms.

What travels with the file

The picture and its temperatures; the camera's serial, optic, hardware and firmware revisions; emissivity, transmissivity, ambient and the range; the frame rate; per-frame shutter, housing and detector temperatures; and the operator's measuring areas (rectangles, polygons, names, colours and alarm limits) as SDK regions, so player->Regions().List() returns them.

Everything that has no home in the SDK recording format is attached to the converted file rather than dropped: ravi-origin.json carries the complete source header, the conversion's own counts and an api_gaps list naming what could not be carried and why, and pixconnect-config.xml carries PIX Connect's configuration verbatim.

Four things genuinely do not survive, and the file says so:

  • the palette: an SDK recording stores none;
  • the visible-light channel some cameras multiplex into every thermal frame: an SDK recording has one thermal track;
  • the original recording date: the recorder stamps the file with the host clock when it is written and offers no way to set it, so the true date is kept in the attachments instead;
  • the second decimal of a recording held on PIX Connect's 0.01 K grid: the SDK grid is 0.1 K.

A whole archive

scan classifies without converting, reading a few hundred kilobytes per file whatever its size:

otc_ravi scan /mnt/archive --recursive --json | jq '.tally'

--from-list FILE takes paths from a text or CSV file, one per line, and --base MOUNT rewrites a Windows path in that list against a mount point, so an existing inventory of a share can be used without walking it.

browse opens the same information as a full-screen interface: the list on the left with each recording's header version, size, resolution and calibration; the selected file's detail on the right; and a running tally along the bottom.

Key Action
↑ ↓ j k move
PgUp PgDn Home End move further
/ filter; Enter or Esc leaves the box
c or Enter convert the selected recording
a convert everything the filter is showing
v toggle checking each conversion after it is written
q or Esc quit

The filter matches the path, the verdict, the resolution, the serial and the header version, so no-model, 640x480 and a serial number are all usable as queries. Converted files land in --out-dir (the working directory by default), and the decoder's own chatter goes to a log file there rather than onto the screen.

otc_virtual

Runs a virtual camera through the real processing pipeline. otc_rdc above checks the distortion correction on its own; this checks it, and everything around it, on the pass a camera actually takes. No camera is opened by any of it.

otc_virtual optics -z "PI640i O60 IRG distortion.txt"          # what the coefficients should be for that optic
otc_virtual zemax  -z "PI640i O60 IRG distortion.txt" --terms 4 --schema rdc
otc_virtual zemax  -z "..." --terms 1 --schema single --wide   # the schema real calibration files use
otc_virtual run --pattern 9 --frames 4 --rdc --sos             # a scene through the pipeline

optics reads a Zemax field-curvature listing and reports what the SDK's distortion coefficients should be for that optic in each of the three XML spellings Cali-<serial>.xml may carry, with the residual each one leaves. It runs nothing.

zemax validates that answer rather than repeating it. A perfect rectilinear target (point sources at f * tan(theta)) is displaced to where the listing says the optic puts them, interpolated from the table and never through a polynomial, so what the pipeline receives carries the real lens rather than a model of it. The correction then runs with the coefficients optics derived, and the tool measures how far the corrected frame put each point back from where it started. Because the input did not come from the same fit as the coefficients, the residual is evidence rather than a tautology.

Three numbers per point, and they answer different questions:

What it is
raw The displacement as it stands. It includes the correction's own zoom-to-fit, which is a magnification and not an error, because a corrected frame has a different effective focal length by design.
iso The same with one magnification removed: the geometric error you actually get. Residual distortion plus the two axes being scaled by different amounts.
xy Both axis scales removed: residual distortion alone, which is the part the coefficients decide.

iso minus xy is what the anisotropy costs. The tool also reads the two scales straight out of the remap table as a cross-check on its own measurement.

run pushes a composed scene through the pipeline and reports the radiometric round trip.

Both zemax and run print a pass ledger: for each stage, what it did to this frame. The counts are measured, not asserted: the frame is run again with the stage switched off and the pixels that move are counted, so a stage that did nothing reports a zero.

Setting up a network camera

From a camera out of its box to a running stream:

  1. Put it on a network your host can reach. Discovery is a UDP broadcast, so the camera answers otc_net list from anywhere on the same segment, but reconfiguring it needs the host to reach its current address. If it ships on 192.168.0.x, start on that subnet. bash otc_net list
  2. Read what it currently has, so you can put it back: bash otc_net show -s 26074397
  3. Give it its address, and tell it where to send frames. The destination is this host: bash otc_net set -s 26074397 --ip 10.0.0.20 --netmask 255.255.255.0 \ --dest-ip 10.0.0.1 --port 50000 otc_net warns if the destination is not on the camera's subnet, which is the usual reason a correctly addressed camera never streams.
  4. Move the host to that subnet if it is not there already, and confirm the camera came back: bash otc_net show -s 26074397 otc_find --connection ethernet
  5. Stream: bash otc_stream -s 26074397 -n 10