Converting PIX Connect recordings (.ravi) to SDK recordings (.mkv)
In Fahrenheit: with the SDK switched to Fahrenheit (SetTemperatureUnit() and its counterparts, see Temperatures in Fahrenheit), every temperature on this page is read and written in Fahrenheit, and every difference in Fahrenheit degrees; the samples are unchanged.
What the conversion does
PIX Connect 3 records to .ravi files. A .ravi does not hold temperatures: it holds the detector's raw energy counts, and PIX Connect works the temperature out again every time it plays the file, from a header stored with each frame.
The conversion does that work once. Every pixel of every frame goes through PIX Connect's own radiometric model, using that frame's own emissivity, transmissivity, ambient temperature and range, and the result is written as an SDK recording. PIX Connect's measuring areas become SDK regions. The only loss in the pixels is rounding to the recording's 0.1 K grid, at most 0.05 K.
Nothing here opens a camera.
What you get
An ordinary SDK recording (.mkv). It opens with Player::Open() in C++, optris_sdk_imager_create_from_file() in C, ThermalCamera.OpenRecording() in .NET, Camera.open_recording() in Python and Camera::from_file() in Rust, exactly like a file the SDK recorded from a camera. Regions, radiation parameters, the temperature range, the camera's serial and, where the file names it, its model all come with it.
The original .ravi is never changed. The recording is written beside the destination under a temporary name and moved into place when it is complete, so a failed or cancelled conversion leaves nothing behind, and a file already at the destination is only replaced by a finished one.
Checking a file first
Inspecting a file reads a few hundred kilobytes of it, whatever its size, and says whether it will convert. It never fails for a bad file: a missing, damaged or foreign file is simply Unreadable, with the reason.
| Verdict | Meaning |
|---|---|
Convertible |
Converts. |
ShortWave |
A PI 1M, 05M or 08M file of a kind the conversion cannot handle. Every such recording seen so far converts; see Short-wave files. |
NoModel |
The file has no radiometric model (header version 1001), so no temperature can be made from it. |
Unreadable |
Not a .ravi, or damaged. |
#include <optrissdk.h> #include <cstdio> namespace rec = optris::sdk::rec; const rec::RaviInfo info = rec::InspectRavi("recording.ravi"); std::printf("%s: %s, %ux%u, %u frames, recorded %s\n", info.path.c_str(), rec::RaviVerdictName(info.verdict), info.width, info.height, info.declared_frames, info.recorded_at_utc.c_str()); if (info.verdict != rec::RaviVerdict::kConvertible) std::printf("why: %s\n", info.detail.c_str());
#include "optris/sdk_c.h" #include <stdio.h> optris_sdk_ravi_info info; optris_sdk_ravi_info_init(&info, sizeof(info)); optris_sdk_ravi_inspect("recording.ravi", NULL, &info); printf("verdict %d, %ux%u, %u frames, recorded %s\n", (int)info.verdict, info.width, info.height, info.declared_frames, info.recorded_at_utc); if (info.verdict != OPTRIS_SDK_RAVI_CONVERTIBLE) printf("why: %s\n", info.detail);
using Optris.Sdk; RaviInfo info = Ravi.Inspect("recording.ravi"); Console.WriteLine($"{info.Verdict}, {info.Width}x{info.Height}, " + $"{info.DeclaredFrames} frames, " + $"recorded {info.RecordedAtUtc}"); if (info.Verdict != RaviVerdict.Convertible) Console.WriteLine($"why: {info.Detail}");
from optris_sdk import ravi info = ravi.inspect('recording.ravi') print(info.verdict.name, f'{info.width}x{info.height}', info.declared_frames, 'frames, recorded', info.recorded_at_utc) if info.verdict != ravi.RaviVerdict.CONVERTIBLE: print('why:', info.detail)
use optris_sdk::ravi::{self, RaviVerdict}; let info = ravi::inspect("recording.ravi", None)?; println!("{:?}, {}x{}, {} frames, recorded {}", info.verdict, info.width, info.height, info.declared_frames, info.recorded_at_utc); if info.verdict != RaviVerdict::Convertible { println!("why: {}", info.detail); }
How many frames a file holds
A .ravi states its length in three places, and PIX Connect does not keep them in step. The main AVI header (avih) counts only the first part of a long recording, and even in a short one it can be dozens of frames off. The OpenDML header (dmlh) and the video stream's header (strh) agree with the frames the file really holds, so the declared frame count is the first of those two the file has.
PIX Connect writes a recording longer than about 1 GiB in several parts (RIFF AVIX, OpenDML). The conversion reads every part, so the number of frames written equals the declared count for a whole file, and a smaller number means the file really is cut off.
Asking for the frame counts says which header the count came from, gives all three, and counts the parts:
#include <optrissdk.h> #include <cstdio> namespace rec = optris::sdk::rec; const rec::RaviFrameCounts counts = rec::InspectRaviFrameCounts("recording.ravi"); std::printf("%u frames, from %s; avih says %u; %u RIFF parts\n", counts.declared_frames, counts.source.c_str(), counts.main_header_frames, counts.riff_parts);
#include "optris/sdk_c.h" #include <stdio.h> optris_sdk_ravi_frame_counts counts; optris_sdk_ravi_frame_counts_init(&counts, sizeof(counts)); optris_sdk_ravi_inspect_frame_counts("recording.ravi", &counts); printf("%u frames, from %s; avih says %u; %u RIFF parts\n", counts.declared_frames, counts.source, counts.main_header_frames, counts.riff_parts);
using Optris.Sdk; RaviFrameCounts counts = Ravi.InspectFrameCounts("recording.ravi"); Console.WriteLine($"{counts.DeclaredFrames} frames, from {counts.Source}; " + $"avih says {counts.MainHeaderFrames}; " + $"{counts.RiffParts} RIFF parts");
from optris_sdk import ravi counts = ravi.inspect_frame_counts('recording.ravi') print(counts.declared_frames, 'frames, from', counts.source, '; avih says', counts.main_header_frames, ';', counts.riff_parts, 'RIFF parts')
use optris_sdk::ravi; let counts = ravi::inspect_frame_counts("recording.ravi")?; println!("{} frames, from {}; avih says {}; {} RIFF parts", counts.declared_frames, counts.source, counts.main_header_frames, counts.riff_parts);
The source is one of dmlh.dwTotalFrames, strh.dwLength or avih.dwTotalFrames. The report of a conversion (report_json) and the attached ravi-origin.json carry the same numbers.
Converting
The conversion reads the file twice: once for the scene's temperature range (pass 1), once to write the frames (pass 2). Progress is reported after every frame of each pass, and the conversion can be cancelled at any point; nothing is then left at the destination.
A file the conversion declines (no radiometric model, or the ShortWave verdict without the option) raises its own error, separate from a failure such as an unreadable source or a destination that cannot be written. RaviDeclinedException in C++ and .NET, RaviDeclinedError in Python, OPTRIS_SDK_ERROR_NOT_SUPPORTED in C and Status::NotSupported in Rust.
#include <optrissdk.h> #include <atomic> #include <cstdio> namespace rec = optris::sdk::rec; // `cancel` may be set from any thread to stop. int Convert(const std::atomic<bool> &cancel) { rec::RaviImportOptions options; options.cancel = &cancel; options.progress = [](const rec::RaviImportProgress &p) { std::printf("pass %d: %llu/%llu\n", p.pass, static_cast<unsigned long long>(p.frames_done), static_cast<unsigned long long>(p.frames_total)); }; try { const rec::RaviImportResult result = rec::ImportRavi("recording.ravi", "recording.mkv", options); if (result.cancelled) return 1; std::printf("%llu frames, %llu regions\n", static_cast<unsigned long long>(result.frames_written), static_cast<unsigned long long>(result.regions_created)); return 0; } catch (const rec::RaviDeclinedException &e) { std::printf("declined: %s\n", e.what()); return 1; } }
#include "optris/sdk_c.h" #include <stdio.h> /* Called after every frame. Return non-zero to cancel. */ static int OTC_SDK_C_CALL on_progress(int32_t pass, uint64_t done, uint64_t total, void *user_data) { (void)user_data; printf("pass %d: %llu/%llu\n", (int)pass, (unsigned long long)done, (unsigned long long)total); return 0; } int convert(void) { optris_sdk_ravi_import_options options; optris_sdk_ravi_import_result result; optris_sdk_ravi_report *report = NULL; optris_sdk_status status; optris_sdk_ravi_import_options_init(&options, sizeof(options)); optris_sdk_ravi_import_result_init(&result, sizeof(result)); options.progress = on_progress; /* The full report, which the import fills; NULL if not wanted. */ optris_sdk_ravi_report_create(&report); status = optris_sdk_ravi_import("recording.ravi", "recording.mkv", &options, &result, report); if (status == OPTRIS_SDK_ERROR_NOT_SUPPORTED) printf("declined: %s\n", optris_sdk_last_error_message()); else if (status == OPTRIS_SDK_OK && !result.cancelled) printf("%llu frames, %llu regions\n", (unsigned long long)result.frames_written, (unsigned long long)result.regions_created); optris_sdk_ravi_report_close(report); return status == OPTRIS_SDK_OK && !result.cancelled ? 0 : 1; }
using Optris.Sdk; using var cts = new CancellationTokenSource(); try { RaviImportResult result = await Ravi.ImportAsync( "recording.ravi", "recording.mkv", new RaviImportOptions(), new Progress<RaviImportProgress>(p => Console.WriteLine($"pass {p.Pass}: {p.FramesDone}/{p.FramesTotal}")), cts.Token); Console.WriteLine($"{result.FramesWritten} frames, " + $"{result.RegionsCreated} regions"); } catch (RaviDeclinedException e) { Console.WriteLine($"declined ({e.Verdict}): {e.Message}"); } catch (OperationCanceledException) { Console.WriteLine("cancelled; nothing was written"); }
import optris_sdk from optris_sdk import ravi def show(progress): print(f'pass {progress.pass_number}: ' f'{progress.frames_done}/{progress.frames_total}') return False # True would cancel try: result = ravi.import_ravi('recording.ravi', 'recording.mkv', progress=show) print(result.frames_written, 'frames,', result.regions_created, 'regions') except optris_sdk.RaviDeclinedError as error: print('declined:', error)
use optris_sdk::ravi::{self, ImportOptions}; let options = ImportOptions::default(); let result = ravi::import_with_progress( "recording.ravi", "recording.mkv", &options, |p| { println!("pass {}: {}/{}", p.pass, p.frames_done, p.frames_total); true // false would cancel })?; println!("{} frames, {} regions", result.frames_written, result.regions_created);
The options are the same in every language: a norm table directory, allow short-wave, clamp to the camera's range (plus 26 K either side, as PIX Connect does when it plays a file), convert only the first N frames, skip the scan pass, and keep the per-frame extras.
The start time and the recording PC's time zone
A .ravi stores when it started as the recording PC's clock showed it, with no time zone. A recording made in Germany at 15:31 in summer says 15:31, and the file does not say that this was 13:31 UTC. The SDK always gives a converted recording a true UTC start and the zone it was read in, so it needs the zone the recording PC was in:
- Give the zone when you convert: an IANA name such as
Europe/Berlin(daylight saving time is applied as that zone had it on the recording's date), or a fixed offset from UTC. The zone data is the computer's own: the system's on Linux, the one Windows 10 version 1903 and later carry on Windows. Nothing is fetched from the network. - Without a zone, the computer doing the conversion is taken to be in the same zone as the recording PC. The recording then says the zone was assumed, the report says so in its notes, and the SDK logs a warning. That is right when you convert on the PC that recorded, or on one in the same zone.
- Correct it afterwards: a recording converted without a zone, or with the wrong one, can be given the right zone, or its true UTC start, later. Every place the recording states its start is rewritten, and the recording says it was corrected. This works on recordings converted by any SDK release. A recording of a camera is refused: it states the zone of the computer that recorded it, which is known.
Inspecting gives the clock reading as the file holds it (recorded_at_local, ISO 8601 without a zone, such as 2025-10-02T15:31:14) beside the UTC start in the zone given or assumed. The report of a conversion, otc-meta.json and ravi-origin.json in the recording carry the same: recorded_at_local, recorded_at_utc, time_zone, utc_offset and time_zone_assumed.
#include <optrissdk.h> #include <cstdio> namespace rec = optris::sdk::rec; rec::RaviTimeZone berlin; berlin.name = "Europe/Berlin"; // or has_utc_offset and utc_offset_minutes const rec::RaviStartTime start = rec::InspectRaviStartTime("recording.ravi", berlin); std::printf("PC clock %s, UTC %s (%+d min)\n", start.recorded_at_local.c_str(), start.recorded_at_utc.c_str(), start.utc_offset_minutes); (void)rec::ImportRaviInZone("recording.ravi", "recording.mkv", {}, berlin); // Later, for a recording converted without a zone or with the wrong one: (void)rec::CorrectRaviStartTime("recording.mkv", berlin);
#include "optris/sdk_c.h" #include <stdio.h> optris_sdk_ravi_time_zone berlin; optris_sdk_ravi_start_time start; optris_sdk_ravi_import_result result; optris_sdk_ravi_time_zone_init(&berlin, sizeof(berlin)); berlin.name = "Europe/Berlin"; /* or has_utc_offset, utc_offset_minutes */ optris_sdk_ravi_start_time_init(&start, sizeof(start)); optris_sdk_ravi_inspect_start_time("recording.ravi", &berlin, &start); printf("PC clock %s, UTC %s (%+d min)\n", start.recorded_at_local, start.recorded_at_utc, (int)start.utc_offset_minutes); optris_sdk_ravi_import_result_init(&result, sizeof(result)); optris_sdk_ravi_import_in_zone("recording.ravi", "recording.mkv", NULL, &berlin, &result, NULL); /* Later, for a recording converted without a zone or with the wrong one: */ optris_sdk_ravi_correct_start_time("recording.mkv", &berlin, NULL);
using Optris.Sdk; RaviTimeZone berlin = RaviTimeZone.FromIanaName("Europe/Berlin"); // or RaviTimeZone.FromUtcOffset(TimeSpan.FromHours(1)), // or RaviTimeZone.FromTimeZoneInfo(TimeZoneInfo.Local) RaviStartTime start = Ravi.InspectStartTime("recording.ravi", berlin); Console.WriteLine($"PC clock {start.RecordedAtLocal}, " + $"UTC {start.RecordedAtUtc} ({start.UtcOffset})"); await Ravi.ImportAsync("recording.ravi", "recording.mkv", new RaviImportOptions { TimeZone = berlin }); // Later, for a recording converted without a zone or with the wrong one: Ravi.CorrectStartTime("recording.mkv", berlin);
from optris_sdk import ravi # A name, a zoneinfo.ZoneInfo, or a fixed offset such as # datetime.timedelta(hours=1). zone = 'Europe/Berlin' start = ravi.inspect_start_time('recording.ravi', zone) print('PC clock', start.recorded_at_local, 'UTC', start.recorded_at_utc, start.utc_offset_minutes, 'min') ravi.import_ravi('recording.ravi', 'recording.mkv', time_zone=zone) # Later, for a recording converted without a zone or with the wrong one, # by zone, or by the true UTC start (an aware datetime) when it is known # from elsewhere: ravi.correct_start_time('recording.mkv', zone) ravi.correct_start_time('recording.mkv', utc=start.started_at)
use optris_sdk::ravi::{self, ImportOptions, RaviTimeZone}; let berlin = RaviTimeZone::Iana("Europe/Berlin".into()); // or RaviTimeZone::UtcOffsetMinutes(60) let start = ravi::inspect_start_time("recording.ravi", Some(&berlin))?; println!("PC clock {}, UTC {} ({} min)", start.recorded_at_local, start.recorded_at_utc, start.utc_offset_minutes); ravi::import("recording.ravi", "recording.mkv", &ImportOptions::new().time_zone(berlin.clone()))?; // Later, for a recording converted without a zone or with the wrong one: ravi::correct_start_time("recording.mkv", &berlin)?;
Replaying, the recording's start is UTC and its zone comes beside it, as for every recording the SDK makes; see Replaying the result.
From the command line
otc_ravi is the same conversion as a program, and it ships with the SDK. info and convert take --json for a report on stdout and nothing else. While converting, progress goes to stderr as pass <n>: <done>/<total> frames, rewritten in place every 200 frames and at the end of each pass.
otc_ravi info recording.ravi --json otc_ravi convert recording.ravi recording.mkv --json
| Exit code | Meaning |
|---|---|
| 0 | Converted, or info found the file convertible. |
| 1 | Failed, or declined: stderr starts with error: or refused: to say which. info returns 1 for any file that is not convertible. |
| 2 | The command line was wrong, or the norm tables could not be found. |
The other subcommands (verify, scan, browse) are described in Command Line Tools.
Replaying the result
The recording says when the original was recorded, not when it was converted: the player's start time is the .ravi's own, in UTC, read in the recording PC's zone, and each frame keeps its captured time. The zone comes beside it (Player::GetStartTimeZone(), optris_sdk_imager_get_playback_time_zone(), PlaybackTimeZone, playback_time_zone, playback_time_zone()), with its name, its offset at the start, and whether it was assumed or corrected; see the start time and the time zone. The camera model is the one the file names, as the SDK names a live camera ("PI 640i", "Xi 80"); a header before version 1009 names no model, and the model is then empty. PIX Connect's measuring areas are the recording's regions, each over the pixels PIX Connect measures it on, and the picture is the way up PIX Connect shows it.
#include <optrissdk.h> #include <cstdio> auto player = optris::sdk::Player::Open("recording.mkv"); std::printf("model %s, serial %s, started %llu us after 1970, %zu regions\n", player->GetDeviceInfo().model.c_str(), player->GetDeviceInfo().serial.c_str(), static_cast<unsigned long long>(player->GetStartTimeUs()), player->Regions().List().size());
#include "optris/sdk_c.h" #include <stdio.h> optris_sdk_imager *replay = NULL; char model[64] = ""; size_t model_size = 0; uint64_t started_us = 0; optris_sdk_imager_create_from_file("recording.mkv", &replay); optris_sdk_imager_get_model(replay, model, sizeof(model), &model_size); optris_sdk_imager_get_playback_start_time_us(replay, &started_us); printf("model '%s', started %llu us after 1970\n", model, (unsigned long long)started_us); optris_sdk_imager_destroy(replay);
using Optris.Sdk; await using ThermalCamera replay = ThermalCamera.OpenRecording("recording.mkv"); Console.WriteLine($"recorded {replay.PlaybackStartedAt}, " + $"model '{replay.Model}'");
import optris_sdk from optris_sdk import ravi ravi.import_ravi('recording.ravi', 'recording.mkv') with optris_sdk.Camera.open_recording('recording.mkv') as replay: print('recorded', replay.playback_started_at, 'model', repr(replay.model))
use optris_sdk::Camera; let replay = Camera::from_file("recording.mkv")?; println!("model '{}', started {} us after 1970", replay.model()?, replay.playback_start_time_us()?);
Norm tables
Some cameras' files describe their temperature curve by naming a normalization table, Norm-<n>.prn, rather than carrying the curve. The SDK ships these tables and finds them by itself, in every package: beside the library in the NuGet package (otcsdk/Norm) and in the Python wheel, in share/otcsdk/norm in a Linux installation, and in norm in the Windows installation.
Pass a directory (norm_directory, NormDirectory) only to use other tables. A file whose table is nowhere to be found is reported as NoModel, and the detail names the missing file.
Short-wave files
The PI 1M, 05M and 08M (and the Xi 1M) do not store energy on the ordinary axis. These cameras calibrate themselves and store their own temperature, and PIX Connect corrects it for emissivity, transmissivity and ambient temperature on a split energy axis of its own, built from the header. The conversion builds the same axis, the same way, so a short-wave recording converts like any other and its temperatures are the ones PIX Connect shows. At emissivity 1 they are the camera's own readings; at 0.8 a reading of 700 C becomes 716.4 C, as in PIX Connect. The report says the split axis was used.
Every short-wave recording seen so far is of this kind. A file of another kind (its model a normalization table, or recorded on the 0.01 K grid) gets the ShortWave verdict, with the reason, and is declined unless you ask for it with "allow short-wave". It is then converted on the ordinary axis, which puts the low end of the scale wrong, and the report says so: do not trust its temperatures without a check against a known source.
Measuring areas
PIX Connect's measuring objects become regions that measure the same pixels:
| In PIX Connect | In the recording |
|---|---|
| Rectangle | An area over the same pixels, placed around its centre as PIX Connect places it. |
| Ellipse | An ellipse over the same box. |
| Polygon | A polygon through the same points. |
| Spot 1x1, 3x3, 5x5 | A spot at the same pixel, with a square aperture of that size. |
| Spot 2x2 | An area over the same four pixels (a spot's aperture is an odd number of pixels across). |
| Spline | A polygon that traces the closed curve PIX Connect fills. |
| Hot spot, cold spot | A hot or cold spot searching the whole picture, minus the excluded areas, with a square aperture the size of PIX Connect's search window. |
| Off | Kept, switched off. |
| Super area, matrix | Not converted. |
PIX Connect searches a hot or cold spot with a window the size of the object, and shows the hottest pixel of the window whose average is the highest. A region's max_c is that number. Where the window is not an odd square (a rectangle, or a 2x2 spot) the region searches with the nearest odd square by pixel count, and the report says so.
What does not carry over
The result lists what the .ravi held that an SDK recording cannot (not_carried_over, NotCarriedOver). Today that can be:
| Item | What happens to it |
|---|---|
| Per-frame extras | PIX Connect's five-state shutter flag, NMEA position and process interface readings are kept in each frame's record, where rec::Player hands them back; the ordinary player does not. |
| Visible-light channel | A recording is thermal only; the visible picture is not converted. |
| 0.01 K grid | A file recorded on PIX Connect's finer grid loses one decimal on the recording's 0.1 K grid. |
| Spot-exclusion areas | Kept in the report when no measuring area is the hot or cold spot they apply to. |
| Unmapped areas | A measuring area with neither a rectangle nor a polygon is not mapped. |
| 2x2 measuring spot | Carried as an area over the same four pixels; the value names the object. |
| Hot or cold spot search window | A window that is not an odd square is searched with the nearest one; the detail names both sizes. |
| Spline measuring area | Carried as a polygon tracing PIX Connect's curve. |
| Super area or matrix | Not converted; the value names the object. |
The original PIX Connect configuration is attached to the recording as pixconnect-config.xml, and the full report as ravi-origin.json.
Converting a whole folder
Inspect first, then convert what will convert. Inspecting costs a few hundred kilobytes a file, so a large archive is sorted in seconds.
#include <optrissdk.h> #include <cstdio> #include <filesystem> #include <string> namespace rec = optris::sdk::rec; // The SDK takes paths as UTF-8. path::string() is the ANSI code page on // Windows, which mangles or refuses a name that is not plain English. std::string Utf8(const std::filesystem::path &path) { const std::u8string text = path.u8string(); return std::string(text.begin(), text.end()); } void ConvertFolder(const std::filesystem::path &folder) { for (const auto &entry : std::filesystem::directory_iterator(folder)) { if (entry.path().extension() != ".ravi") continue; const auto info = rec::InspectRavi(Utf8(entry.path())); if (info.verdict != rec::RaviVerdict::kConvertible) { std::printf("skipped %s: %s\n", info.path.c_str(), info.detail.c_str()); continue; } auto target = entry.path(); target.replace_extension(".mkv"); (void)rec::ImportRavi(info.path, Utf8(target)); } }
#include "optris/sdk_c.h" #include <stdio.h> /* C has no portable folder listing: the names come from the caller. */ void convert_all(const char *const *sources, const char *const *targets, size_t count) { size_t i; for (i = 0; i < count; ++i) { optris_sdk_ravi_info info; optris_sdk_ravi_import_result result; optris_sdk_ravi_info_init(&info, sizeof(info)); optris_sdk_ravi_inspect(sources[i], NULL, &info); if (info.verdict != OPTRIS_SDK_RAVI_CONVERTIBLE) { printf("skipped %s: %s\n", sources[i], info.detail); continue; } optris_sdk_ravi_import_result_init(&result, sizeof(result)); optris_sdk_ravi_import(sources[i], targets[i], NULL, &result, NULL); } }
using Optris.Sdk; foreach (string source in System.IO.Directory.EnumerateFiles("archive", "*.ravi")) { RaviInfo info = Ravi.Inspect(source); if (info.Verdict != RaviVerdict.Convertible) { Console.WriteLine($"skipped {source}: {info.Detail}"); continue; } await Ravi.ImportAsync(source, System.IO.Path.ChangeExtension(source, ".mkv")); }
import pathlib from optris_sdk import ravi for source in sorted(pathlib.Path('archive').glob('*.ravi')): info = ravi.inspect(str(source)) if info.verdict != ravi.RaviVerdict.CONVERTIBLE: print('skipped', source.name, '-', info.detail) continue ravi.import_ravi(str(source), str(source.with_suffix('.mkv')))
use optris_sdk::ravi::{self, ImportOptions, RaviVerdict}; for entry in std::fs::read_dir("archive").expect("the folder") { let source = entry.expect("an entry").path(); if source.extension().map_or(true, |e| e != "ravi") { continue; } let path = source.to_string_lossy().into_owned(); let info = ravi::inspect(&path, None)?; if info.verdict != RaviVerdict::Convertible { println!("skipped {path}: {}", info.detail); continue; } let target = source.with_extension("mkv"); ravi::import(&path, &target.to_string_lossy(), &ImportOptions::default())?; }
Files from before header version 1006
PIX Connect began recording the shutter state with header version 1006. An older file does not say where the shutter was, so every frame of it is converted as an ordinary frame with the shutter open, which is how PIX Connect plays it. A file from version 1006 on keeps the state it recorded, frame by frame.