SPB Git

Repository Public

EXPORT_PIPELINE.md 3.3 KB 46 lines markdown

1<!--2SP Lecture Studio3File: docs/EXPORT_PIPELINE.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# Export pipeline89```10RenderSource (manifest, PDF, events, edits, envelope)11   ├─ TimeMap(duration, cuts)                       output time ⇄ source time12   ├─ FrameCompositor                               frame i at i/fps → source time → page + ink + pointer + camera13   │     page raster cache (page, viewport) → base cache (+ completed strokes) → in-progress strokes, pointer, camera on top14   ├─ TimelineAudioReader → EditedAudioRenderer     kept ranges, crossfades, mutes, cleanup, gain, fades15   └─ AVAssetWriter (H.264 High / HEVC, Rec. 709, AAC 48 kHz mono) in a private scratch folder → atomic move → MediaVerifier16```17- **Determinism**: every frame is computed from the event log; the same project and settings give the same pictures. Screen18  recording is never an input. A frame whose `FrameSignature` equals the previous one reuses the rendered pixel buffer (in the19  90-minute test 160 606 of 162 000 frames).20- **Aspect ratio**: the page is letterboxed into the frame; zoom/pan recorded while presenting is replayed (optional).21- **Pauses** have zero length on the timeline. **Cuts** are removed by the time map; slide changes and ink that happened inside a22  cut take effect at the join. **Missing or unreadable audio segments** render as silence and are reported in the result.23- **Crossfade**: at each join an equal-power crossfade (30 ms by default) centred on the cut, using the material on both sides of24  the cut as handles, so the programme duration is exactly the sum of the kept ranges.25- **Loudness** (optional): one measurement pass (ITU-R BS.1770 K-weighting, gated) then a single gain to −16 LUFS, capped at +20 dB26  and at a −1 dBFS peak. **Cleanup** (optional): 80 Hz high-pass and a gentle downward expander (≤ 12 dB) below the noise floor + 8 dB.27- **Drift**: video frame times are exact rationals of the fps; audio is counted in samples; both derive from the same `TimeMap`.28- **Robustness**: free space is checked first; cancellation and failures remove the scratch folder (no partial file is left); the29  destination is replaced only by a complete file. An interrupted export is restarted, not resumed: the app records that an export30  was in progress and offers to run it again. On iOS a background task gives the export extra time; when it expires the export is31  cancelled cleanly.32- **Verification**: before a video is listed as exported it is reopened, its tracks and duration are checked and its first frame is33  decoded (`MediaVerifier`).3435## Other artifacts36Annotated PDF (flattened vector ink, or standard PDF ink annotations on a copy of the original), SRT / WebVTT captions and TXT37transcript mapped to the edited timeline, chapters JSON + plain list, copies of the source assets, project archive.3839## Measured (MacBook Pro, 2026-11-18)40| Case | Result |41|---|---|42| 12 s, 640×360 | ink appears within one frame of its recorded time; clicks at 2 / 5 / 9 s found within 3 ms |43| 90 min synthetic, 640×360, 30 fps | 162 000 frames in 99 s; A/V sync within 3 ms at 7 probes up to 89:59; peak memory 600 MB; file 27.5 MB |44| 16 s real recording, 1920×1080 | exported in 1.0–2.9 s on the simulators, verified by decoding every frame |451080p export of a real 90-minute lecture and 4K export have not been timed.46
Files main
Menu

Theme