OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C++ API referencev12.0

optris::sdk::rec::ContinuousConfig

Everything a continuous recording is opened with.

Public attributes

directory

std::string directory

Where the segments go. Created if it does not exist.

The directory is the timeline. Segments left in it by an earlier run are adopted rather than deleted, which is what makes the history survive a crash or a power cut -- see ContinuousRecorder::Create(), which reports how many it found.

name_pattern

std::string name_pattern = "history_{timestamp}"

Filename stem for this run's segments, inside directory.

The placeholders of File name patterns are expanded, and {timestamp} is expanded once, at Create(), not per segment: the segments of one run are <stem>_part000.mkv, <stem>_part001.mkv and so on, which is what Recorder's own segmentation produces. Every part carries a suffix, the first one included -- a continuous history is always segmented, so nothing is ever written at <stem>.mkv. That changed in API version 24; it used to be <stem>.mkv for the first.

The suffix is _part001 rather than _001. The two schemes are not independent: continuous recording predicts the name the recorder is about to write, so that its catalogue can record a path before the file exists. Changing one without the other makes the catalogue point at files that are not there.

It carries a timestamp by default for one reason: without it a second run restarts the numbering at _001 and overwrites the history the first run left, which is the opposite of the point.

segment_duration

std::chrono::seconds segment_duration {60}

How long one segment covers. Whichever of this and max_segment_bytes comes first rolls the file over.

This is the granularity of everything: of pruning, since a segment is deleted whole; of what a crash can lose, since the open segment is the one without a trailer; and of how much of the volume is held by footage already outside the retention window. One minute is a compromise -- short enough that pruning tracks the policy closely, long enough that a day of history is 1440 files rather than 86400.

max_segment_bytes

uint64_t max_segment_bytes = 0

Roll over before a segment would pass this size. Zero leaves it to segment_duration alone.

Worth setting wherever a single file is capped. A duration limit cannot stand in for it, because how many bytes a minute costs depends on the scene.

retention

RetentionPolicy retention

How much history to keep. An all-zero policy keeps everything, which on a long enough run fills the volume -- so Create() refuses it rather than letting it be the accident it would otherwise be.

on_disk_full

DiskFullAction on_disk_full = DiskFullAction::kPruneBelowRetention

What to do when the volume is short anyway. See DiskFullAction.

all_intra

bool all_intra = true

Write every frame as a seek anchor, so a clip can be cut at any frame. See StreamConfig::all_intra, which this sets on every stream added.

On here, where it is off for a plain Recorder, because a continuous recording exists to be cut and the measured cost is under 3 % of the file. Turning it off saves those bytes and makes every cut land on the nearest earlier anchor instead -- ClipResult::snapped_by_us then says how far back that was, by up to eleven frames.

write_preview

bool write_preview = false

Write a cover image into every segment. See GlobalConfig::write_preview.

Off here, where it is on for an ordinary recording, and the difference is the point: a cover costs one JPEG encode per file, and a continuous recording opens a file a minute for as long as the camera runs rather than one per take. The segments are working storage that a clip is cut from, not files a person double-clicks. A clip gets its own cover.