OptrisOptrisDocumentation

Documentation/OTC SDK/optris_sdk — Python API referencev12.0

Continuous

class optris_sdk.continuous.Continuous

The rolling history on one camera: camera.continuous.

Continuous — properties

active

Whether a rolling history is being written.

Independent of camera.is_recording, which is about a take.

  • Raises ~optris_sdk.errors.NotSupportedError — on a replay or a still. Measured, and worth stating because the C header does not: this is a recorder question, and a source with no recorder refuses it rather than answering False. So branch on camera.is_playback before asking, exactly as for start.

stats

What the history has done, as ContinuousStats.

Continuous — methods

start(options)

Start writing everything this camera sees to disk.

options is a ContinuousOptions; a directory and at least one retention bound are required.

  • Raises ~optris_sdk.errors.InvalidStateError — when a history is already running, or when pre-roll is enabled -- the two answer the same question at two scales and running both would store every frame twice.
  • Raises ~optris_sdk.errors.IoError — when the directory cannot be used, or the volume is already below min_free_bytes plus room for one segment. Refused here rather than on the first frame.
  • Raises ~optris_sdk.errors.NotSupportedError — on a replay or a still. Neither has a recorder.

stop()

Stop writing the history.

The segments stay on disk and stay cuttable, and the next start on the same directory adopts them. Succeeds when nothing is running.

timeline()

The spans of history on disk, oldest first.

The open segment is included, with its to_s at the last frame written, so a transport bar can draw up to the present rather than stopping a segment short. It cannot be cut from until it closes.

save_clip(from_s, to_s, path)

Cut a keepable file out of the history.

from_s and to_s are seconds on the camera's clock -- the domain TimelineSpan.from_s reports -- and to_s must be after from_s. An existing file at path is replaced only once the clip is written and verified.

Returns a ClipResult. Read its incomplete rather than treating a short clip as a failure: the history may have been pruned past the in point, and a clip of what exists is almost always what was wanted.

  • Raises ~optris_sdk.errors.InvalidStateError — when no history is running, or when it holds no frame in the window at all.