SPB Git

Repository Public

PROJECT_FORMAT.md 4.0 KB 57 lines markdown

1<!--2SP Lecture Studio3File: docs/PROJECT_FORMAT.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# Project format — `.slecture` (schema 2)89A lecture is a package directory (UTI `ai.spboucher.slecture`). All paths in the manifest are relative to the package root.10```11Title.slecture/12  manifest.json          metadata, PDF reference, recording sessions, media segments with SHA-256, export history13  events.jsonl           append-only event stream, one JSON object per line14  edits.json             EditHistory: current edit decision list + undo and redo stacks15  transcript.json        optional transcript (source timeline)16  pdf/source.pdf         immutable copy of the imported PDF (the original file is never touched)17  media/audio-<session8>-<index5>.caf     16-bit PCM mono CAF, one bounded segment each18  media/camera-<session8>-<index5>.mov    optional camera segments (fragmented QuickTime, video only)19  cache/waveform.json    loudness envelope (10 ms hop); can be rebuilt20  cache/thumbnails/      reserved21  exports/               reserved22```23## Timebase24`MediaTime` = signed 64-bit **nanoseconds** on the project timeline (JSON: an integer). Conversions: frames = round(ns × rate / 1e9);25CMTime uses timescale 1 000 000 000. Video frame i is at i/fps exactly (`CMTime(value: i, timescale: fps)`); audio sample n at n/48000.2627## manifest.json28`schemaVersion`, `id` (UUID), `title`, `courseCode`, `sessionNumber`, `lectureDate`, `createdAt`, `modifiedAt`, `archived`,29`coverPage`, `publishingDestination`, `notes` (page index → presenter note), `pdf` {path, originalName, sha256, byteCount, pageCount},30`sessions[]` {id, startedAt, endedAt, timelineStart, duration, recovered, segments[]}, `duration`, `lastPage`, `exports[]`.31A segment: {id, kind audio|camera, path, index, start, duration, sampleRate, channels, frames, sha256, finalized, recovered}.32The manifest is replaced atomically (write to a temporary file, then rename). `endedAt == null` marks a session that did not end cleanly.3334Migrations run on the raw JSON (`ManifestMigrator`): schema 1 → 2 renames `course` to `courseCode` and adds the newer fields.35A package with a newer schema than the app supports is refused with an explicit error and is not modified.3637## events.jsonl38Each line: `{"seq": n, "t": ns, "wall": ms-since-1970, "e": {<kind>: {…}}}`. `seq` increases strictly; `t` is timeline time; `wall` is39for audit only. Kinds: `sessionStart{id}`, `sessionEnd{id}`, `page{index}`, `strokeAdded{_0: Stroke}`, `strokesRemoved{ids}`,40`strokesRestored{ids}`, `viewport{_0:{zoom,cx,cy}}`, `pointer{x,y}`, `pointerHidden`, `marker{_0:{id,kind,label}}`, `pause{reason}`,41`resume{gapSeconds}`, `camera{enabled,placement}`, `segment{kind,file,index}`, `auto{_0:{policy,action,detail}}`, `note{_0}`.42A line that cannot be decoded (truncated tail after a crash, kind from a newer version) is skipped, counted and left in the file.4344**Stroke**: `{id, page, tool, color "#RRGGBBAA", width, begin, p:[x, y, dtMilliseconds, w, …]}`. `x`,`y` are normalized to the page crop45box, origin top-left, y down. `width` is normalized to the page width. `dt` is the time since `begin`; `w` multiplies the width46(pressure). Shapes keep their anchor as the first point and the dragged corner as the following points.47A stroke drawn while nothing is being recorded is stamped at the end of the timeline with `dt = 0` (it appears at once).4849## edits.json50`{current, undoStack[], redoStack[]}` of `EditDecisionList`: `cuts[]` (applied), `suggestions[]` (pending, never applied until approved),51`splits[]`, `muted[]`, `fadeIn`, `fadeOut`, `crossfade`, `gainDB`, `normalizeLoudness`, `noiseReduction`, `chapters[]`,52`ink {offsets, hidden}`, `cameraPlacement`, `cameraHidden`. All times are **source** timeline times.5354## Portability55The package can be copied as is (Finder, Files, AirDrop). "Archive du projet" writes `Title.slecture.zip` (stored entries, ZIP64 when56needed, caches excluded); importing a package or archive always makes a copy, and gives it a new id when that id already exists.57
Files main
Menu

Theme