OptrisOptrisDocumentation

Documentation/OTC SDK/Overviewv12.0

A Running Recording

What a running recording tells you, what it needs from the disk under it, and the one setting that changes the frames going into it. Starting and stopping are Recording; the file itself is Recording File Format.

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.

The recording chapter is seven pages, each answering one question:

Page Question
Recording How do I write a camera to a file?
A Running Recording What is it telling me while it runs?
Recording File Format What is the file, and what may a third party rely on?
Preview Pictures Why does the file open on a picture, and which frame is it?
Snapshots and Interval Capture How do I save one frame, or one every N seconds?
Recording Attachments How do I put my own files inside the recording?
Playback How do I read one back?

Being told what a recording is doing

IsRecording() cannot say that a timed recording reached its end rather than being stopped by somebody, that an alarm rule started one you never asked for, or that a recording died on a full disk: a recording that died and one that finished look identical from outside.

OnRecording() reports all of it. Register it before starting a recording.

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

auto imager = optris::sdk::Imager::Create();

imager->Recorder().OnRecording(
    [](const optris::sdk::rec::RecordingEvent &event) {
      switch (event.phase) {
        case optris::sdk::rec::RecordingPhase::kStarted:
          std::println("recording to {}", event.path);
          break;
        case optris::sdk::rec::RecordingPhase::kStopped:
          std::println("finished {}", event.path);
          break;
        case optris::sdk::rec::RecordingPhase::kFailed:
          std::println("recording failed: {}", event.message);
          break;
        case optris::sdk::rec::RecordingPhase::kSegmentCompleted:
          std::println("segment finished: {}", event.path);
          break;
      }
    });

kFailed is reported once per recording, not once per lost frame: a full disk fails every frame, and one notification per frame at 32 Hz is a flood. The running totals are in the statistics below.

The handler runs on an SDK thread, never the camera's frame thread:

Event Thread
A start you asked for the calling thread
A recording that reached its duration the SDK's own timer thread
kFailed, kSegmentCompleted the thread that writes the recording

Do not destroy the camera from the handler: the thread that would have to be shut down is the one you are on. Calling back in is allowed, Stop() included, but a handler that blocks blocks the recording, so set a flag and act on your own thread.

Stop() waits for a kSegmentCompleted handler that is still running. When Stop() returns and kStopped arrives, every part the recording finished has been reported and its handler has returned, so the parts you were told of and the one kStopped ends are all the files there are. A handler that is still busy with a part holds Stop() up until it returns, for at most 5 seconds, after which the stop goes on and says so in the log. So never let that handler wait for the thread that calls Stop(): in a user interface, hand the event over with BeginInvoke or InvokeAsync, not with Invoke.

camera.OnRecording(e =>
{
    switch (e.Phase)
    {
        case RecordingPhase.Started:
            ui.ShowRecordingChip(e.Path);
            break;
        case RecordingPhase.Stopped:
            ui.Toast($"Saved {e.Path}");
            break;
        case RecordingPhase.Failed:
            ui.Error($"Recording failed: {e.Message}");
            break;
        case RecordingPhase.SegmentCompleted:
            ui.AddToFileSet(e.Path);
            break;
        case RecordingPhase.Discarded:
            // The recording captured nothing, so its file has been
            // deleted; e.Path is the file that is gone. This always
            // arrives before Stopped, which is what lets you drop the
            // take here rather than save it above and remove it after.
            ui.Toast("Nothing was recorded");
            ui.ForgetTake(e.Path);
            break;
    }
});

What a recording did with its frames

IsRecording() stays true while every frame is refused, so a recording that has stopped growing looks healthy. Switch the camera's operating mode while recording and every frame after the switch is the wrong size for the open file.

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

auto imager = optris::sdk::Imager::Create();
imager->Start();
imager->Recorder().Start("/data/run.mkv");

// ... later ...

imager->Recorder().Stop();

const auto stats = imager->Recorder().GetStatistics();
std::println("{} frames written, {} lost, {} bytes",
             stats.frames_written,
             stats.frames_dimension_mismatch + stats.frames_write_error +
                 stats.frames_dropped_backlog,
             stats.bytes_written);
if (!stats.last_error.empty()) {
  std::println("last failure: {}", stats.last_error);
}

The counters are reset when a recording starts and kept after it stops, so the totals are readable once the file is closed.

Add all three loss counters, not two. frames_dropped_backlog is the one a target too slow for the stream shows up in, so a sum that leaves it out prints "0 lost" for exactly the case that loses the most frames. .NET's RecordingStatistics.FramesLost and Python's RecordingStats.frames_lost add all three for you; in C++ and C, add all three yourself.

The accounting rule. Every frame the recording was offered is in exactly one of the four counters, or still waiting to be written:

offered == frames_written + frames_dimension_mismatch +
           frames_write_error + frames_dropped_backlog + queue_depth

The last term is what makes it an identity rather than an approximation while a recording runs: a frame is accepted on the camera's thread and accounted for by the thread that writes it. After a stop the queue is empty and the counters account for everything.

frames_written is not "on the disk". It counts a frame once the container has accepted it, which is a moment earlier than the frame's bytes reaching the file: the container holds packets back so that it can interleave the file's streams, and releases them as it goes and finally when the recording is stopped. So the counter answers "did the recording get my frame", which is what it is for, and a program that polls it and then opens the file while the recording is still running can read back fewer frames than the counter says, without anything having gone wrong.

Stopping is the barrier. StopRecording() drains the write queue, finishes the container and closes the file before it returns, so a file opened after that call holds every frame the counter has counted. That is the point at which to read the file, and it is why the counters are documented as exact after a stop.

camera.StopRecording();

RecordingStatistics stats = camera.RecordingStatistics;
Console.WriteLine(
    $"{stats.FramesWritten} frames written, {stats.FramesLost} lost, "
    + $"{stats.BytesWritten} bytes");

And the barrier makes a plain existence check meaningful:

camera.StopRecording();

var file = new FileInfo("run.mkv");
if (!file.Exists || file.Length == 0)
{
    // The recording did not happen.
}

Reading a recording's figures after the next one has started

The statistics above describe the recording that is current when you read them. A start resets them. So a program that hands each recording event to a thread of its own, as the handler's rules ask, and reads the statistics there when it gets to a Stopped, can read the next recording's figures: an alarm rule's recording action that activates again right after its recording ended, or your own code starting the next file at once, makes a complete file read as 0 frames written.

The Stopped event carries the figures of the recording it ends, taken when it ended, and a number that ties it to its Started. Read those instead. In C# and Python they are on the event OnRecording() already delivers (Statistics and RecordingId, statistics and recording_id). In C++, C and Rust they come with a second handler, which you register beside the first or instead of it: OnRecordingDetail(), optris_sdk_imager_set_recording_event_callback() and on_recording_event_detail(). Added in 12.0.15.

#include <optrissdk.h>
#include <chrono>
#include <mutex>
#include <print>
#include <thread>
#include <vector>

// Before the camera, so they outlive the last event it delivers.
std::mutex mutex;
std::vector<optris::sdk::rec::RecordingEventDetail> held;

auto imager = optris::sdk::Imager::Create();
imager->Start();
imager->Recorder().OnRecordingDetail(
    [&](const optris::sdk::rec::RecordingEventDetail &detail) {
      std::lock_guard lock(mutex);
      held.push_back(detail);  // Acted on later, on your own thread.
    });

imager->Recorder().Start("held_first.mkv");
std::this_thread::sleep_for(std::chrono::seconds(1));
imager->Recorder().Stop();
imager->Recorder().Start("held_second.mkv");  // The next one, at once.

std::lock_guard lock(mutex);
for (const auto &detail : held) {
  if (detail.event.phase == optris::sdk::rec::RecordingPhase::kStopped &&
      detail.statistics) {
    // GetStatistics() is the second recording's by now; this is not.
    std::println("recording {} kept {} frames in {}",
                 detail.recording_id,
                 detail.statistics->frames_written,
                 detail.event.path);
  }
}

The figures are on Stopped and on Discarded, the two events that end a recording, and absent on every other phase. They are the ones the statistics read gives at the moment of the stop, with one difference: a recording that ended at its segment limit and started the next one (see What happens at the limit) gets the frame and byte counters of its own file, where the statistics read counts on across the files. The number is the same on a recording's Started and its Stopped, different for every other recording of the same camera, and never 0 for a recording's own events.

What a recording needs from its target

A recording is lossless, so what it needs from a disk is the size of a compressed frame times the frame rate, and nothing in the SDK can reduce it. Measure the frame size on the recording itself (bytes_written / frames_written); it depends on the scene as much as on the sensor. A 640x480 frame of a real scene compresses to about 78 KB, which at 32 Hz is 2.5 MB/s for one camera. Three cameras on one stick needed about 2.2 MB/s together, and the stick sustained 1.33.

A USB stick is a reasonable target for a single camera and a poor one for several. The bursts bite before the sustained rate: the Matroska muxer hands a whole Cluster to the operating system at once, 0.77 MB every twelve frames for that camera, and a cheap stick can take a second over one.

When the target is slower, the file gives way, not the camera. Frames are encoded and written on a thread of the SDK's own, so the camera keeps its rate whatever the disk does, and the live picture, the region statistics, the alarms and the PIF fail-safe heartbeat are not behind the drive.

statistic what it says
queue_depth How many frames are waiting to be written now. Near zero is a target with room to spare.
queue_capacity How deep the queue may get: about two seconds of frames, sized from the sensor and the rate, plus whatever the pre-roll handed over at the start.
queue_preroll How many of the waiting frames are that handover. Zero without a pre-roll, and falls to zero as it is written out, so queue_depth - queue_preroll is the live depth.
queue_live_capacity The room for live frames: queue_capacity less the handover. The same two seconds whatever the pre-roll was, and equal to queue_capacity when there was none.
queue_peak The deepest it has been. A stall of a second at 32 Hz fills and empties the queue between two polls a second apart, and this is the only trace it leaves.
queue_preroll_peak The largest the handover ever was, which is its size at the instant it was made. A queue_peak equal to this is fully accounted for by the handover; one well above it had live frames piling up behind one.
frames_dropped_backlog Frames the recording was offered and did not store, because the queue was full. Non-zero means the target cannot sustain this camera.
longest_write_ms The longest a single frame took to encode and put on disk. On a healthy disk this is the encode (about 5 ms for 640x480) and a figure in the hundreds of milliseconds is the drive.

A full queue drops the newest frame, not the oldest, so a gap in the file is always a gap in time and never a re-ordering. Watch the queue fill to warn a user before a frame is lost; read frames_dropped_backlog to report the ones that were.

With a pre-roll, watch the live figures, not queue_depth against queue_capacity

A recording takes the whole pre-roll ring at once, and the capacity holds that handover plus the live queue, so 30 s of pre-roll on a 640x480 camera at 32 Hz opens at 960 of 1024, 94 % full, on a healthy drive: 960 encodes, which takes seconds on a large sensor. Compare queue_depth - queue_preroll against queue_live_capacity instead; those two mean the same thing for every pre-roll length, including none. queue_peak near the capacity is that same handover on a pre-rolled recording and a drive falling behind on any other, so read it with queue_preroll_peak beside it.

The queue is bounded on purpose: one that absorbed a slow disk indefinitely would convert the data loss into an out-of-memory. It is about two seconds of frames, capped by bytes so a large sensor cannot blow the budget, and what will not fit is counted.

What a stop costs

Stop() writes out what is queued before it finishes the file, so the file holds every frame the recording accepted. On a slow target that costs the queue's depth times what one frame costs the drive, on top of the trailer and the index.

RecordingStatistics queue = camera.RecordingStatistics;
uint live = queue.QueueDepth - queue.QueuePreRoll;
if (queue.QueueLiveCapacity > 0
    && live * 2 > queue.QueueLiveCapacity)
{
    Console.WriteLine($"the drive is falling behind: {live} frames "
                      + $"of {queue.QueueLiveCapacity} waiting");
}

And after a stop, the peak pair says whether the handover or the drive was behind it:

RecordingStatistics done = camera.RecordingStatistics;
if (done.QueuePeak > done.QueuePreRollPeak)
{
    Console.WriteLine($"the queue reached {done.QueuePeak} frames, "
                      + $"{done.QueuePreRollPeak} of them pre-roll");
}

Splitting a long recording

FAT32 refuses any file above 4 GiB, and a lossless recording of a 640x480 sensor reaches that in well under an hour. Splitting it is what makes a long recording to a USB stick survivable as a file. Whether the stick is fast enough to hold the stream is answered in What a recording needs from its target.

You do not have to ask for the FAT32 case, and you cannot switch it off

The recorder asks the destination for its own per-file maximum at the first open and adopts it when you passed no limit; without that, a FAT volume would refuse a write at its ceiling mid-recording and leave the file without its trailer. That number is 4,294,967,295 for any FAT and no limit for ext4, NTFS, exFAT and network mounts, which are byte for byte unaffected. A limit you did set that the volume cannot honour is reduced to the volume's, with a warning.

rec::RecordingOptions carries the duration and both segment limits. Pass either limit, or both; whichever comes first rolls the file over. What you get on disk, for Start("run.mkv"):

You asked for Files written series block in otc-meta.json
A segment limit run_part000.mkv, run_part001.mkv, run_part002.mkv, and so on. Nothing is written at run.mkv itself. yes; series.part is the suffix number
No limit, on ext4, NTFS, exFAT or a network mount run.mkv, one file, your path exactly (none)
No limit, on FAT run.mkv, then run_part001.mkv, run_part002.mkv: the SDK adopts the volume's per-file maximum (see above) and rolls over anyway. The listing is ragged, part 0 keeping your path while the rest are suffixed none, on any part, so rec::OpenSeries() has only the file names and a reader handed run_part002.mkv cannot learn from the document that it belongs to anything

kSegmentCompleted names every finished part, which is why it is the one way to learn the file set that is right whatever you asked for. The last part is not named by one: it is the part after the last kSegmentCompleted, the one kStopped ends, and kStopped itself carries the path you started with.

With a segment limit, the first file is run_part000.mkv, not the path you passed. An application that hands over run.mkv and later opens run.mkv finds nothing there. Do one of three things instead: take the name out of the kSegmentCompleted notification, which reports every finished file including the first; ask rec::OpenSeries() for the whole set; or open run_part000.mkv yourself. Ask for no segment limit and the file keeps your name exactly.

#include <optrissdk.h>
#include <chrono>

auto imager = optris::sdk::Imager::Create();
imager->Start();

optris::sdk::rec::RecordingOptions options;
options.duration = std::chrono::hours(1);
// The ready-made value for a FAT32 stick: 4 GiB less 4 MiB.
options.max_segment_bytes = 4290772992;  // whatever your destination holds
// And a new file every ten minutes as well, whichever comes first.
options.max_segment_duration = std::chrono::minutes(10);

imager->Recorder().Start("/media/usb/run.mkv", options);

Every segment carries the full metadata and every attachment, so each file stands on its own.

What happens at the limit

By default a recording that reaches its limit carries on in the next file as the next part of the same recording, and Player::OpenSeries() plays all the parts back as one recording (see A recording in several files, played as one). That is one of three choices, set on the camera before the recording starts with Recorder().SetSegmentLimitAction():

Choice Files written for Start("run.mkv") What the recording reports
kContinueSeries, the default run_part000.mkv, run_part001.mkv, ..., the parts of one recording, each carrying the same recording id kSegmentCompleted for each finished part
kStartNewRecording run.mkv, then run_20261116_142233.mkv and so on: each a whole recording of its own, named with the local time it started, with -1, -2 added if two start in the same second kStopped with kSegmentLimit for each finished file, then at once kStarted with the next file's name
kStopRecording (since 12.0.28) run.mkv only kStopped with kSegmentLimit, and nothing after it

With kStartNewRecording the camera never stops recording: IsRecording() stays true and no frame is lost between one file and the next. Each file starts at its own zero and carries no part number, so each one opens and plays as the whole recording it is.

The choice applies to every recording the camera starts afterwards, whether your application starts it or an alarm rule does, and makes no difference to a recording with no limit. No choice depends on where the file is written: a limit is the number you picked.

Ending the recording at the limit

With kStopRecording (since 12.0.28) the limit ends the recording: a recording that must not pass a size or run past a time stops there by itself, without your application watching the bytes or the clock. The file is the path you passed and the only one, with no part number in its name. The last frame in it is the last one that fitted: the frame that reached the limit, and every frame after it, is not recorded. The file is finished exactly as Recorder().Stop() finishes one, so it opens and plays from its first frame to its last like any other recording.

The recording reports kStopped with kSegmentLimit (RecordingStopReason.SegmentLimit in C#, RECORDING_STOP_SEGMENT_LIMIT in Python, OPTRIS_SDK_RECORDING_STOP_SEGMENT_LIMIT in C), so your application can tell it from a stop it asked for. IsRecording() is false from then on, nothing else starts, and the next Start() records as usual. A size limit stops the recording before the file passes max_segment_bytes; a time limit stops it once the next frame would be max_segment_duration past the first.

#include <optrissdk.h>
#include <chrono>

auto imager = optris::sdk::Imager::Create();
imager->Recorder().OnRecording([](const optris::sdk::rec::RecordingEvent &e) {
  if (e.phase == optris::sdk::rec::RecordingPhase::kStopped &&
      e.stop_reason == optris::sdk::rec::RecordingStopReason::kSegmentLimit) {
    std::println("{} reached its limit and is finished", e.path);
  }
});
imager->Start();

// One recording of at most ten minutes, ended by the SDK.
imager->Recorder().SetSegmentLimitAction(
    optris::sdk::rec::SegmentLimitAction::kStopRecording);
optris::sdk::rec::RecordingOptions options;
options.max_segment_duration = std::chrono::minutes(10);
imager->Recorder().Start("/data/run.mkv", options);

Starting a new recording at the limit

With kStartNewRecording each file ends with kStopped carrying the same kSegmentLimit, and the next recording starts at once:

#include <optrissdk.h>
#include <chrono>

auto imager = optris::sdk::Imager::Create();
imager->Recorder().OnRecording([](const optris::sdk::rec::RecordingEvent &e) {
  if (e.phase == optris::sdk::rec::RecordingPhase::kStopped &&
      e.stop_reason == optris::sdk::rec::RecordingStopReason::kSegmentLimit) {
    std::println("{} is finished, the next one has started", e.path);
  }
});
imager->Start();

// A new recording, with its own name and its own start, every hour.
imager->Recorder().SetSegmentLimitAction(
    optris::sdk::rec::SegmentLimitAction::kStartNewRecording);
optris::sdk::rec::RecordingOptions options;
options.max_segment_duration = std::chrono::hours(1);
imager->Recorder().Start("/data/run.mkv", options);

The size limit is a ceiling for the finished file, trailer included

A rolled-over part is never larger than the limit you set: the recorder projects what the part will hold (the open Matroska Cluster, the muxer's interleaving queue, the frame about to be written, and the Cues the trailer puts down) and rolls over while all of it still fits. Until v12 it compared the muxer's position against the limit, so parts ended past it by everything written after the last check: 1.6 MB past a 4 GiB limit on a PI 640i, and 31 % past a 1 MiB limit on 160×120 noise. No margin of your own is needed, and no fixed one would have worked: the Cues grow at about 24 B a frame. Leave a margin for what you write afterwards: attaching a file to a finished part rewrites it.

Turning the flag off while recording

The camera's shutter closes every so often to re-reference the detector (that closure is the non-uniformity correction, there is no other kind on this hardware), at a cost of a gap of a second or two in which no frame arrives. In a recording of a part going past on a line, that gap is in the file for good and the part that went past during it was not measured.

So the shutter can be held back for as long as a recording runs:

#include <optrissdk.h>

auto imager = optris::sdk::Imager::Create();

auto nuc = imager->Detector().GetAuto();
nuc.while_recording = optris::sdk::FlagWhileRecording::kAvoid;
imager->Detector().SetAuto(nuc);

imager->Start();
imager->Recorder().Start("/data/run_041.mkv");
AutoNucConfig::while_recording What happens while a recording runs
kUse The shutter closes on its own schedule, as it does the rest of the time. The default, so a camera nobody configures behaves exactly as it always has.
kAvoid No scheduled closure happens at all. The stream has no gap and the detector is never re-referenced.
kAvoidUnlessDrift No scheduled closure happens unless the detector has actually drifted past recording_override_drift_c.

kAvoidUnlessDrift exists because the SDK measures something PIX Connect does not: how far the camera's three internal temperature probes have moved since the last correction. The drift is compared against recording_override_drift_c and not against temp_drift_threshold_c, which defaults to 0.1 °C and is a hair trigger by design; comparing against that would let every closure through and make the mode indistinguishable from kUse.

There is deliberately no default for recording_override_drift_c, and zero is refused. How much drift a measurement can bear is a property of what you are measuring, not of the camera. Zero would behave as kUse, because every drift is more than zero, so the override would fire every time. SetAuto() throws ConfigException for that pair instead of accepting it and quietly doing something else.

A manual closure still works. Detector::TriggerShutter() is an instruction, not a schedule, and none of these affect it. The startup calibration, a temperature-range change and an optics change also still close the shutter, because none of those is the automatic schedule.

What it costs, and why the file says so

A recording stores finished temperatures. Every number in the file was computed before it was written, so drift the camera did not correct is in those pixels permanently. Opening the file later and reprocessing it does not take the drift out; nothing does.

A suppressed recording is therefore indistinguishable from a good one by inspection: no gap in the stream, a normal-looking picture, and temperatures that look like temperatures. They are simply wrong, by an amount that grows over the take.

The file therefore says what was done to it, in two places. An ordinary recording carries neither, so a file that carries one is a file something was done to.

In the header, in otc-meta.json, written as the file opens:

"flag_policy": { "while_recording": "avoid_unless_drift", "override_drift_c": 2.0 }

That is what was configured. It sits in the first few kilobytes, before any video, so "was this recording made with the shutter held back" is answered without decoding a frame, the same promise every other marker in the format contract makes. The key is absent for a recording made at kUse, and absent in every recording written before this existed; for those files the absence is also the truth, because nothing could be suppressed then.

On the per-frame telemetry track, on each frame where a correction was actually refused:

"flag_policy": { "while_recording": "avoid", "held": true, "drift_c": 0.73 }

That is what happened. drift_c is the worst of the three internal probes' drift since the last correction, roughly how wrong that frame is. It is present only on the degraded frames, so a reader sees which stretch to distrust and by how much, and the largest drift_c is the worst the take ever got. drift_c is omitted rather than written as zero before the camera's minimum flag interval has elapsed, because the probes are not read until then: a missing value is "not measured yet", never "no drift".

Reading it back:

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

auto player = optris::sdk::Player::Open("/data/run_041.mkv");
if (const auto policy = player->GetRecordedFlagPolicy()) {
  std::println("made with the shutter policy '{}'", policy->while_recording);
  if (policy->held.value_or(false)) {
    std::println("this frame is degraded by about {} C",
                 policy->drift_c.value_or(0.0f));
  }
} else {
  std::println("the shutter was not held back while this was recorded");
}

GetRecordedFlagPolicy() merges the two halves, so one call answers both questions: the policy and its override come from the header, held and drift_c from the frame now on screen. An empty answer means nothing was suppressed.

Watching it live

Detector::GetShutterDeferral() is the same facts while the recording is still running:

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

void ShowShutterState(optris::sdk::Imager& imager) {
  const auto held = imager.Detector().GetShutterDeferral();
  if (!held.policy_in_force) {
    return;  // nothing is being suppressed
  }
  std::println("flag suppressed; drift {} C, worst so far {} C, "
               "{} frames uncorrected",
               held.drift_c, held.peak_drift_c, held.deferred_frames);
}

Read policy_in_force first, and drive any "flag suppressed" indicator from it rather than from the configured mode. It is false when no recording is running, when the policy is kUse, when the automatic shutter is switched off, and, the case that matters, while a process-interface input owns the flag. The SDK runs no shutter cycle of its own then (see Shutter Control and Detector::IsShutterExternallyControlled()), so there is no closure to hold and the setting does nothing. The setting is still stored and still read back: moot rather than working, and policy_in_force is how to find that out.

peak_drift_c and deferred_frames are reset when a recording starts and kept after it stops, so the summary is readable once the file is closed, the same contract GetStatistics() has. They are the two fields policy_in_force does not gate. drift_c and deferring_now are zero and false whenever the policy is not in force, so a camera running the default cannot hand back a live drift reading that looks like a suppression. The SDK also writes one log line as each suppressed recording ends, naming the policy, the count and the worst drift.

deferred_frames counts frames, not corrections. A refused cycle stays due (the interval goes on elapsing and the drift goes on growing), so every frame from the refusal onwards is one that went out uncorrected. Under kAvoid a ten-minute recording at 27 Hz reports some sixteen thousand. Read it against the recording's own frame count: "16 000 of 16 200 frames uncorrected" says how much of the file is degraded, and peak_drift_c says what that cost in kelvin.

From C, .NET, Python and Rust

Set it Watch it live Read it off a file
C++ Detector::SetAuto() with AutoNucConfig::while_recording Detector::GetShutterDeferral() Player::GetRecordedFlagPolicy()
C optris_sdk_imager_set_flag_while_recording() optris_sdk_imager_get_shutter_deferral() optris_sdk_imager_get_recorded_flag_policy()
.NET ThermalCamera.SetFlagWhileRecording() ThermalCamera.ShutterDeferral ThermalCamera.RecordedFlagPolicy
Python camera.detector.set_flag_while_recording() camera.detector.shutter_deferral camera.detector.recorded_flag_policy
Rust Camera::set_flag_while_recording() Camera::shutter_deferral() Camera::recorded_flag_policy()
#include "optris/sdk_c.h"
#include <stdio.h>

void watch_the_shutter(optris_sdk_imager *imager) {
  optris_sdk_shutter_deferral held;
  optris_sdk_shutter_deferral_init(&held, sizeof(held));
  if (optris_sdk_imager_get_shutter_deferral(imager, &held) != OPTRIS_SDK_OK) {
    return;
  }
  if (held.policy_in_force && held.deferring_now) {
    printf("flag suppressed, drift %.2f C\n", (double)held.drift_c);
  }
}

The C reader reports OPTRIS_SDK_ERROR_NOT_FOUND for a recording that declares no policy. Unlike most NOT_FOUND answers that is an answer rather than an absence: the block is omitted entirely at the default policy, so a file without it is a file whose shutter was never held. .NET, Python and Rust project it as null / None.