OptrisOptrisDocumentation

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

VideoExportConfig

pub struct VideoExportConfig

How to write the video.

VideoExportConfig::default is the SDK's own set of defaults, read out of optris_sdk_video_export_config_init rather than restated here. That matters for more than tidiness: a config zero-initialised its way to a default would ask for VideoCodec::H264, which is absent from the Windows build this SDK ships, and an mjpeg_quality of 0, which is not even in the encoder's 2..=31 range.

VideoExportConfig — fields

width: u32

Frame width in pixels.

For VideoContent::Colorized this is the size of your picture, which need not be the camera's: an application that draws its regions, labels and readings into a larger buffer sets that buffer's size here and those are in the video too.

height: u32

Frame height in pixels. See VideoExportConfig::width.

frame_rate: f32

Declared output frame rate in Hz. Sets the stream's time base as well as the rate the file announces.

codec: VideoCodec

Which encoder to use. VideoCodec::Mjpeg by default, because it is the only one certain to be present; a zero-configuration export then works everywhere instead of failing only on the delivered platform.

content: VideoContent

What the frames handed over will be. VideoContent::Radiometric by default.

preset: VideoPreset

Encoding speed preset. VideoPreset::Medium by default, and read only by VideoCodec::H264 and VideoCodec::H265.

bitrate_kbps: i32

Target bitrate in kbit/s. 0 selects the encoder's quality mode.

mjpeg_quality: i32

MJPEG quality, 2 (best) to 31 (worst). 2 by default, and ignored by every other codec.

temp_min_c: f32

Reserved for a future colorization range, and not read today: colorizing is the caller's, which is what VideoContent::Colorized means.

In the SDK's temperature unit (Celsius unless crate::set_temperature_unit chose Fahrenheit), as is its default from VideoExportConfig::default: 20 to 40 °C, read as 68 to 104 in Fahrenheit.

temp_max_c: f32

See VideoExportConfig::temp_min_c.

pace_by_arrival: bool

Time each frame by when it arrives rather than by how many came before.

false by default, which is right for an export: a converter feeds a file's frames as fast as it can read them and they belong frame_rate apart however quickly they were handed over.

true for a live take, where frames are passed through from a camera as they come. Without it the file's timeline is the frame count, so it declares itself at frame_rate however fast the frames really arrived: a camera delivering 9 pictures a second into a file that says 32 replays three and a half times too fast, and nothing about the file looks wrong: the pictures are all there, in order.

Overridden per frame by VideoPicture::timestamp_us, which is the right answer for exporting a recording and is neither of these two.

output_path: String

Where to write. Required.

VideoExportConfig — methods

pub fn new(output_path: &str, width: u32, height: u32, frame_rate: f32) -> Result<Self>

The library's defaults with the four fields an export cannot guess filled in.

Errors

Returns Status::InvalidArgument only if the library refuses its own initialiser, which means this crate and the library disagree about the struct.