RecordingOptions
class optris_sdk.recording.RecordingOptions
Everything a recording can be asked for as it starts.
All three are optional and all three default to "no limit", which
is the same recording
optris_sdk.camera.Camera.start_recording makes with no
options at all.
Both are carried as whole milliseconds: rounded, and never down to zero from a positive value. Zero is a sentinel on both -- run until stopped, and no segmenting -- so a duration under a millisecond records for a millisecond rather than forever, and a rollover asked for in microseconds becomes the SDK's one-second minimum rather than no rollover at all.
**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 -- 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. It compared the position it had
reached against the limit until v12, and parts therefore 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
160x120 noise. You no longer need a margin of your own for the
recording itself; a margin for an attachment you mean to add
afterwards is still yours to leave. A part can finish
somewhat *under* the limit, because the projection is an upper
bound.
Every part carries a suffix, the first one included: the path
you gave is written with _part000, _part001, _part002
and so on before the extension, the number matching
series.part in otc-meta.json. So run.mkv with a
segment limit writes run_part000.mkv and nothing is written
at run.mkv. Every segment carries the full metadata and
every attachment, so each file stands on its own.
That changed in API version 24 and it breaks a caller that
passed a path and then reopened it. The first file used to be
the path exactly as given, so handing over run.mkv and later
opening run.mkv worked; it now finds nothing there. Take the
path out of the RECORDING_SEGMENT_COMPLETED notification
instead, which reports every finished file including the first, or
open run_part000.mkv yourself. With no segment limit the
path is used exactly as given -- one whole file is not a part of
anything -- so only recordings that asked to roll over are
affected.
Neither is free. *Stop* is the honest default: an outage has
no known length, so a held-open file can be a recording that
looks live for hours and contains minutes, and `duration_s`
keeps running through an outage it cannot capture. *Hold
open* is right when one file per shift matters more than each
file being contiguous. The hole is in the file either way;
this decides whether the file boundary is in it too.
The last three were reachable through the generated FFI and absent
from this class, the same reachability gap the .NET binding once
had. min_free_bytes arrived later, and was absent the
same way until BindingFieldGuard named it.
- Parameter
duration_s— stop by yourself after this long, in seconds.Noneruns 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. - Parameter
max_segment_duration_s— close the file and open the next one after this much recorded time.Nonedisables it. Values below one second are raised to one second by the SDK. - Parameter
max_segment_bytes— close the file and open the next one before it would pass this size.Nonedisables it. Any size you like -- this is not tied to a file system. Where the destination caps a single file, pass that cap and a long recording rolls over instead of dying at it; a lossless 640x480 recording passes 4 GiB in well under an hour. - Parameter
all_intra—Truemakes 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.Nonekeeps the encoder's default, which makes one frame in twelve an anchor. - Parameter
quantize_counts— round each temperature sample to a multiple of this many counts before encoding. Lossy. Opt-in.Noneand0both record exactly. 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". A recording stores finished temperatures, so this alters the measurement permanently; the file declares it, andoptris_sdk.player.Player.recorded_lossyis how a reader asks. - Parameter
visual_jpeg_quality— quality, 2 (best) to 31 (worst), for encoding a visual track as MJPEG rather than losslessly.Nonekeeps 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 -- usequantize_countsthere. - Parameter
min_free_bytes— refuse to start unless the destination has at least this much free.Noneand0both mean no floor, which is the previous behaviour. The same name, unit and "zero is off" convention as the continuous recorder's own floor, and like it this is a check 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. - Parameter
hold_open_across_reconnect— keep this recording open across a camera outage, instead of stopping it when the SDK re-opens the camera.NoneandFalseboth mean stop, which is what every recording has always done: a reconnect is a re-open, so the file is finalized before the teardown andRECORDING_STOPPEDarrives carryingRECORDING_STOP_RECONNECT.Truekeeps it running, and the first frame after the outage carries a marker of the gap thatoptris_sdk.camera.Camera.recorded_gapreads back.