RecordingOptions
pub struct RecordingOptions
Everything a recording can be asked for as it starts.
RecordingOptions::default is the SDK's own set of defaults,
read out of optris_sdk_recording_options_init rather than
restated here: the same arrangement, and for the same reason, as
crate::SnapshotOptions.
Every field's zero is the ABI's "no limit", so a
RecordingOptions::default() is exactly the recording
crate::Camera::start_recording makes with no options at all.
RecordingOptions — fields
duration: Duration
Stop by yourself after this long. Duration::ZERO runs until
stopped. The clock starts once the recording is live, after
any pre-roll has been written out, so a file with pre-roll
enabled covers rather more than this.
Ignored on an alarm action. See
crate::Rule::add_recording_action_with.
max_segment_duration: Duration
Close the current file and open the next one after this much
recorded time. Duration::ZERO disables it; anything under a
second is raised to a second by the SDK.
max_segment_bytes: u64
Close the current file and open the next one before it would pass this size, in bytes. Zero disables it.
This is what makes a long recording survive a destination that caps a single file: a lossless recording of a 640x480 sensor passes 4 GiB in well under an hour. Set it to that cap and the recording rolls over instead of dying at the boundary. Any size is accepted; this is not tied to a file system.
A ceiling for the finished file, trailer included. A part that has been rolled over is never larger than this: the recorder projects what the part will hold and rolls over while all of it still fits, so you need no margin of your own. A part can finish somewhat under the limit, because the projection is an upper bound.
all_intra: bool
true makes every frame a seek anchor, so a clip can later be
cut at any frame with no re-encode.
The cost is a per-frame constant of 416 to 460 bytes,
independent of the picture: +0.66 % on a 382x288 sensor and
+0.23 % on 640x480. false keeps the encoder's default, which
makes one frame in twelve an anchor.
quantize_counts: u32
Round each temperature sample to a multiple of this many counts before encoding. Lossy. Opt-in. Zero and one both record exactly, and zero is the default.
One count is 0.1 K, so the error is bounded and known in advance: no sample of any frame moves by more than half a step. On 640x480, a step of 2 costs 0.1 K and 81 % of the size, 4 costs 0.2 K and 62 %, 8 costs 0.4 K and 43 %, 16 costs 0.8 K and 27 %.
Use a power of two: a step of 5 has the same worst case as 4 and makes the file 41 % larger, because the compressor codes prediction residuals and a power-of-two step is exactly "drop the low bits".
visual_jpeg_quality: i32
Quality, 2 (best) to 31 (worst), for encoding a visual track as MJPEG rather than losslessly. Zero, the default, keeps it lossless.
Ignored on a thermal track, with a warning: MJPEG is eight bits
a sample and a 16-bit temperature cannot go through it and still
be a temperature. Use RecordingOptions::quantize_counts
there.
min_free_bytes: u64
Refuse to start at all unless the destination has at least this many bytes free. Zero, the default, does not check.
A floor at the start only: nothing stops a recording that has already begun, and no headroom is added to the comparison. Leave room for an attachment you mean to add afterwards yourself.
Reachable through optris-sdk-sys for longer than through
this struct, which is the same gap once closed for the three
fields above it.
hold_open_across_reconnect: bool
Hold this recording open across a camera outage, instead of stopping it when the SDK re-opens the camera.
false, the default, is what every recording has always
done: a reconnect is a re-open, so the file is finalized
before the teardown and the stop carries
OPTRIS_SDK_RECORDING_STOP_RECONNECT.
true keeps it running, and the first frame after the outage
carries a marker of the gap. Neither is free: an outage has no
known length, so a held-open file can be a recording that
looks live for hours and contains minutes, and
RecordingOptions::duration keeps running through an outage
it cannot capture. The hole is in the file either way; this
decides whether the file boundary is in it too.