/** * Utsubo Splat Video (USV v1) manifest — the single source of truth a dynamic clip branches * on. One `manifest.json` (or `.usv` zip bundle root), several payload encodings; the runtime * reads `encoding` and routes to the matching player. This module owns only the manifest: * parsing, validation, and normalization. Payload decoding lives in SplatVideoCodec (binary * chunks) and the per-encoding runtimes. * * Encodings: * - `tracks` — the native representation: static base (`static.usc`) + windowed keyframe * tracks or STG records for the dynamic tail (see SPLAT_VIDEO_FORMAT.md). * - `ply-sequence` — the V0 flipbook: a list of baked per-frame PLY/SPLAT sources, played by * `SplatSequence`. Kept as the dev/debug path. * - `video` — synced `.af` attribute tracks decoded through WebCodecs. * * Format specification: packages/core/.ai/SPLAT_VIDEO_FORMAT.md * * @module SplatVideoManifest */ import { VIDEO_MANIFEST_TYPE, VIDEO_MANIFEST_VERSION } from './SplatVideoCodec.cjs'; /** Supported USV payload encodings. */ export declare const SPLAT_VIDEO_ENCODINGS: readonly ["tracks", "ply-sequence", "video"]; /** Track kinds of the `tracks` encoding. */ export declare const SPLAT_VIDEO_TRACK_KINDS: readonly ["keyframes", "stg"]; /** Supported static-base formats (`sog` is reserved for the v2 packer profile). */ export declare const SPLAT_VIDEO_STATIC_FORMATS: readonly ["usc", "sog"]; /** Supported per-asset spatial orderings of `ply-sequence` frames. */ export declare const SPLAT_VIDEO_SPATIAL_ORDERS: readonly ["none", "morton"]; /** Geometry/appearance assignments supported by the `video` encoding. */ export declare const SPLAT_VIDEO_PLANE_LAYOUTS: readonly ["legacy", "shape-lossless", "packed-v3"]; /** Active payload family selected by a USV manifest. */ export type SplatVideoEncoding = (typeof SPLAT_VIDEO_ENCODINGS)[number]; /** Temporal representation used by a native tracks manifest. */ export type SplatVideoTrackKind = (typeof SPLAT_VIDEO_TRACK_KINDS)[number]; /** Binary format of the static base in a native tracks manifest. */ export type SplatVideoStaticFormat = (typeof SPLAT_VIDEO_STATIC_FORMATS)[number]; /** Spatial ordering applied independently to each PLY-sequence frame. */ export type SplatVideoSpatialOrder = (typeof SPLAT_VIDEO_SPATIAL_ORDERS)[number]; /** Geometry record layout and which track owns covariance/opacity attributes. */ export type SplatVideoPlaneLayout = (typeof SPLAT_VIDEO_PLANE_LAYOUTS)[number]; /** Three-component spatial vector used by manifest bounds. */ export type SplatVideoVec3 = [number, number, number]; /** Motion-dilated axis-aligned bounds covering a clip. */ export interface SplatVideoBounds { min: SplatVideoVec3; max: SplatVideoVec3; } /** Normalized file reference used by static, track, and video payloads. */ export interface SplatVideoFile { file: string; byteLength?: number; } /** Ordered byte segments that concatenate into one logical video track. */ export interface SplatVideoSegmentedFile { files: string[]; byteLength?: number; } /** Single-file legacy reference or a repository-safe segmented video payload. */ export type SplatVideoPayloadFile = SplatVideoFile | SplatVideoSegmentedFile; /** Static-base file reference for the native tracks encoding. */ export interface SplatVideoStaticFile extends SplatVideoFile { format: SplatVideoStaticFormat; } /** One normalized source in a PLY-sequence flipbook. Extension fields are preserved. */ export interface SplatVideoFrame { url: string; count?: number; [key: string]: unknown; } /** Windowed keyframe payload references and timeline grid. */ export interface SplatVideoKeyframeTrack { kind: 'keyframes'; clip: SplatVideoFile; windowFrames: number; knotStride: number; rotation: boolean; windows: SplatVideoFile[]; } /** Analytic Spacetime-Gaussian payload reference. */ export interface SplatVideoSTGTrack { kind: 'stg'; clip: SplatVideoFile; } /** Normalized temporal payload selected by `tracks.kind`. */ export type SplatVideoTrack = SplatVideoKeyframeTrack | SplatVideoSTGTrack; /** Two synchronized attribute-video tracks and their per-frame layout metadata. */ export interface SplatVideoPayload { maxSplatCount: number; atlasWidth: number; /** `shape-lossless` uses byte planes; `packed-v3` uses 82-bit geometry records. */ planeLayout: SplatVideoPlaneLayout; /** Exact clip-wide range used to quantize/dequantize position planes. Never culling-padded. */ positionBounds: SplatVideoBounds; scaleRange: [number, number]; counts: number[]; geometry: SplatVideoPayloadFile; appearance: SplatVideoPayloadFile; } interface SplatVideoManifestCommon { readonly version: typeof VIDEO_MANIFEST_VERSION; readonly type: typeof VIDEO_MANIFEST_TYPE; readonly encoding: E; readonly frameCount: number; readonly frameRate: number; readonly shDegree: 0; readonly generator?: string; /** * True when the asset was trained with a Mip-Splatting-COMPENSATED screen filter. Absent or * false means brush-classic training (cov2D + 0.3 px² blur, NO opacity compensation) — the * loader must then render with the same uncompensated filter, or every alpha lands below its * trained value by sqrt(det/det_blurred). */ readonly antialiased?: boolean; } /** Normalized native tracks manifest. */ export interface SplatVideoTracksManifest extends SplatVideoManifestCommon<'tracks'> { readonly count: number; readonly dynamicCount: number; readonly bounds: SplatVideoBounds; readonly static: SplatVideoStaticFile; readonly tracks: SplatVideoTrack; } /** Normalized correspondence-free video manifest. */ export interface SplatVideoVideoManifest extends SplatVideoManifestCommon<'video'> { readonly count: number; readonly bounds: SplatVideoBounds; readonly video: SplatVideoPayload; } /** Normalized per-frame PLY/SPLAT sequence manifest. */ export interface SplatVideoPlySequenceManifest extends SplatVideoManifestCommon<'ply-sequence'> { readonly maxSplatCount: number; readonly spatialOrder: SplatVideoSpatialOrder; readonly bounds: SplatVideoBounds | null; readonly frames: SplatVideoFrame[]; } /** Canonical USV manifest, discriminated by {@link SplatVideoEncoding}. */ export type SplatVideoManifest = SplatVideoTracksManifest | SplatVideoVideoManifest | SplatVideoPlySequenceManifest; /** Read-only playback facts derived from any normalized USV manifest. */ export interface SplatVideoSummary { encoding: SplatVideoEncoding; frameCount: number; frameRate: number; durationSeconds: number; count: number; dynamicCount: number; } /** Owning runtime family returned by {@link sniffSplatManifestType}. */ export type SplatManifestSniffResult = 'video' | 'stream' | null; /** * Parse and normalize a USV manifest, validating the common header and the active encoding's * required shape. Forward-compatible: unknown fields are ignored and unknown encodings fail * loudly rather than silently mis-rendering. Returns a shallow-frozen canonical manifest with * defaults applied. * * @param input The manifest object or its JSON text. * @returns The normalized manifest. */ export declare function parseSplatVideoManifest(input: unknown): SplatVideoManifest; /** * Identify which runtime owns a parsed manifest JSON: `'video'` (USV → `SplatClip`), * `'stream'` (USS → `GaussianSplatsStream`), or `null` (not an Utsubo splat manifest). * Dispatch helper for loaders and drag-drop handlers that receive arbitrary `manifest.json` * / bundle contents. * * @param raw Parsed manifest JSON (NOT a JSON string). * @returns The owning runtime family. */ export declare function sniffSplatManifestType(raw: unknown): SplatManifestSniffResult; /** * Derive read-only playback facts from a normalized manifest. * * @param manifest A manifest from {@link parseSplatVideoManifest}. * @returns `count` uses `maxSplatCount` for `ply-sequence`; `dynamicCount` is zero outside * the `tracks` encoding. */ export declare function summarizeSplatVideoManifest(manifest: SplatVideoManifest): SplatVideoSummary; export {};