OptrisOptrisDocumentation

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

ContinuousConfig

pub struct ContinuousConfig

How a continuous recording keeps its history.

ContinuousConfig::new reads the SDK's own defaults out of optris_sdk_continuous_config_init.

Three bounds, and why one is not enough

The time bound is what an operator thinks in and the only one that can be promised to a user. The byte bound is needed beside it because the same camera writes 3.1 GB/h on a calm scene and 7.4 GB/h on a hot noisy one (a factor of 2.4 on content nobody controls), so a drive sized for eight hours of one holds three of the other. The free-space floor is the one that fires when something else fills the disk, and it is worth setting even when the other two are generous: a history allowed to fill the volume takes the application's logs and the operating system's ability to write a file down with it.

ContinuousConfig — methods

pub fn new() -> Self

The SDK's defaults, with nowhere to write yet.

pub fn directory(mut self, directory: &str) -> Result<Self>

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

The directory is the timeline: segments an earlier run left are adopted rather than deleted, count against the retention policy, and can still be cut from. ContinuousStats::segments_adopted reports how many, because an application that did not expect them is one whose disk budget is being spent by a run it has forgotten about.

Errors

Returns Status::InvalidArgument if the path does not fit the ABI's field or carries an interior NUL byte.

pub fn name_pattern(mut self, pattern: &str) -> Result<Self>

Filename stem for this run's segments.

Empty means history_{timestamp}, and the timestamp matters: without one a second run restarts the numbering and overwrites the first run's history.

Errors

As ContinuousConfig::directory.

pub fn segment_duration(mut self, duration: Duration) -> Result<Self>

Close one segment and open the next after this much recorded time.

The granularity of everything: pruning deletes a segment whole, a crash can lose only the open one, and a clip can only be cut from segments that have closed.

Errors

Returns Status::InvalidArgument if the duration does not fit the ABI's uint32_t of seconds.

pub fn max_segment_bytes(mut self, bytes: u64) -> Self

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

pub fn max_duration(mut self, duration: Duration) -> Result<Self>

Keep at most this much history, oldest frame to newest. Duration::ZERO means time does not bound it.

Errors

As ContinuousConfig::segment_duration.

pub fn max_bytes(mut self, bytes: u64) -> Self

Keep at most this many bytes of segment files. Zero means size does not bound it.

pub fn min_free_bytes(mut self, bytes: u64) -> Self

Never let the volume's free space fall below this. Zero means it is not watched, which is only reasonable on a drive nothing else writes to.

pub fn on_disk_full(mut self, action: DiskFullAction) -> Self

What to do when the volume is short anyway.

pub fn all_intra(mut self, yes: bool) -> Self

Write every frame as a seek anchor, so a clip can be cut at any frame.

On by default here, where it is off for an ordinary recording, because a continuous recording exists to be cut. Switching it off makes ClipResult::snapped_by_us non-zero.

pub fn write_preview(mut self, yes: bool) -> Self

Write a cover image into every segment.

Off by default here: a cover costs one JPEG per file, and this opens a file a minute for as long as the camera runs. A clip gets its own.