Autonomous Post-Production Telemetry, Broadcast Quality & Multimodal Vision Intelligence System
Built for the Agentic Cinema: The Blockbuster Hackathon
|
|
|
|
Frame Sense is an autonomous post-production intelligence system that transforms second-by-second test-screening viewer behavior and technical compliance telemetry into scientifically defensible, frame-accurate editorial recommendations.
By combining high-throughput columnar telemetry ingestion (ClickHouse Cloud), sample-aware statistical joint gating, viewer sequence trajectory reasoning, broadcast quality auditing (Dialogue Audio Masking, Pacing Lulls), and multimodal keyframe reasoning (Google ADK & Gemini 3.5 Flash / Gemini 3.5 Flash-Lite), Frame Sense automatically detects audience retention drops, comprehension barriers, and audio/pacing friction — outputting industry-standard NLE timeline exports (Final Cut Pro XML and CMX3600 EDL) for Adobe Premiere Pro, DaVinci Resolve, and Final Cut Pro.
Frame Sense operates a Dual-Engine Technical & Behavioral Intelligence System:
-
Engine 1: Viewer Retention & Cognitive Telemetry Analytics
- Ingests raw second-by-second viewer telemetry (
PLAY,PAUSE,EXIT,REPLAY,SEEK,TAB_HIDDEN). - Evaluates ClickHouse viewer sequence trajectories (
_get_window_trajectories) to distinguish intentional scene rewatches ($R_{\text{continuation}}$ ) from permanent audience exits ($R_{\text{exit}}$ ). - Applies Laplace smoothing (
$\hat{p}_{\text{smoothed}}$ ), Wilson score confidence bounds, and sample-aware gating ($n < 5 \rightarrow \text{INSUFFICIENT DATA}$ ) to eliminate false alarms.
- Ingests raw second-by-second viewer telemetry (
-
Engine 2: Broadcast Quality & Technical Safety Audit Engine
- Dialogue Audio Masking Risk Audit: Analyzes dynamic range compression, background score collision, and speech clarity to identify audio masking friction.
- Pacing Lulls & Narrative Dead Space Audit: Identifies low-engagement visual dead zones and stagnant scene pacing prior to major retention drop-offs.
graph TD
UI["React 18 / Vite Web Workspace<br/>(Screening Room, Findings & Pipeline Simulator)"] -->|HTTP / SSE Stream| API["FastAPI Backend Engine (Port 8001)"]
subgraph Core ["100% ClickHouse Unified Core Architecture"]
API --> CH["ClickHouse Unified Storage Engine<br/>(Telemetry + Studio Metadata + AI Investigations + MCP Protocol)"]
API --> TRAJ["Viewer Sequence Trajectory Engine<br/>(_get_window_trajectories)"]
CH --> GATE["Statistical Joint Gating Engine<br/>(Laplace & Wilson LCB Engine)"]
TRAJ --> GATE
GATE --> DUAL["Dual-Engine Intelligence Framework<br/>(Behavioral Retention + Technical Safety Audit)"]
DUAL --> VIS["Multimodal Vision Engine<br/>(FFmpeg Keyframes + Gemini 3.5 Flash / Gemini 3.5 Flash-Lite)"]
DUAL --> CHAT["Sense AI Interactive Agent<br/>(Google ADK + ClickHouse MCP)"]
end
API --> INSP["ClickHouse Window SQL Inspector<br/>(Live OLAP Query Engine & Latency Profiler)"]
VIS --> NLE["Professional NLE Timeline Export Engine<br/>(Final Cut Pro XML .fcpxml & CMX3600 EDL)"]
CHAT --> NLE
-
Live OLAP Window Engine: Inspect exact production ClickHouse SQL queries executed during real-time telemetry analysis, including windowed Z-score calculations (
stddevPop,avg() OVER (...)). -
Syntax Highlighting & Whitespace Preservation: Custom React Portal modal with zero-blur backdrop, code block indentation preservation, and execution latency benchmarks (
$< 9\text{ms}$ ).
-
4-Stage Interactive Animation: Visualizes the complete telemetry journey from raw playback emission
$\rightarrow$ statistical joint gating$\rightarrow$ multimodal keyframe laser scan$\rightarrow$ timecode-anchored Sense AI chat response. - User Interaction: Clickable timeline pins, live playhead synchronization, and target anomaly locking.
- Seamless Page Navigation: Instant top-of-page scrolling (
scrollTop = 0) on route changes to ensure editorial findings and analytical dashboards open cleanly at the header.
Events are not viewers. Counting raw event occurrences (
Frame Sense runs a ClickHouse SQL window trajectory query evaluating each viewer session's complete lifecycle across a candidate window
-
Exposed Viewers (
$N_{\text{exposed}}$ ): Unique viewers present in$[t_{\text{start}} - 5\text{s}, t_{\text{end}} + 10\text{s}]$ . -
Permanent Exits (
$N_{\text{exit}}$ ): Viewers whose session terminated in$W$ and never returned or emitted events past$t_{\text{end}} + 3\text{s}$ . -
Replayed & Continued (
$N_{\text{replayed-continued}}$ ): Viewers who rewound/replayed in$W$ and continued watching past$t_{\text{end}} + 3\text{s}$ . -
Permanent Exit Rate:
$$R_{\text{exit}} = \frac{N_{\text{exit}}}{\max(1, N_{\text{exposed}})}$$ -
Continuation Rate:
$$R_{\text{continuation}} = \frac{N_{\text{continued}}}{\max(1, N_{\text{exposed}})}$$
To protect filmmakers from acting on tiny viewer samples (e.g. 1 exit out of 1 viewer producing
| Sample Size ( |
Exposure Category | Anomaly Behavior | Confidence Cap | Severity Cap |
|---|---|---|---|---|
INSUFFICIENT_DATA |
Insufficient audience size for statistical inference | LOW |
||
PRELIMINARY_SIGNAL |
Preliminary directional hint | MEDIUM |
||
SUFFICIENT_SIGNAL |
Standard screening sample | Dynamic |
Dynamic calculation | |
STRONG_SIGNAL |
High-confidence statistical evidence | Full confidence calculation | Full severity calculation |
To calculate standardized score
- Local mean
$\mu_{\text{local}}$ and local standard deviation$\sigma_{\text{local}}$ are calculated across time buckets excluding a$\pm 15\text{s}$ local window around$t$ :
| Engine | Trajectory / Technical Signal | Taxonomy Title | Domain | Editorial Action |
|---|---|---|---|---|
| Behavioral | Emotional Scene Replay Hotspot |
EMOTIONAL |
Insert 1.2s B-Roll reaction shot at peak timecode to reward viewer curiosity. | |
| Behavioral | Cognitive Comprehension Barrier |
COGNITIVE |
Boost dialogue audio clarity (+3dB), duck score (-4dB), or hold shot +1.2s — do NOT trim video. | |
| Behavioral | Critical Scene Exit Drop |
RETENTION |
Re-anchor visual perspective. Replace static wide shot with medium close-up. | |
| Behavioral | Dead Zone Pacing Skip |
PACING |
Execute razor cut prior to scene transition to eliminate visual dead space. | |
| Broadcast Safety | High score loudness & dialogue spectral overlap | Dialogue Audio Masking Risk |
AUDIO |
Frequency notch filter ambient audio track (-4dB at 1-3kHz) to improve speech intelligibility. |
-
OBSERVATION: Pure empirical telemetry measurement (event counts, unique viewers,$z$ -scores, Wilson bounds). -
INTERPRETATION: Behavioral meaning of viewer sequence trajectories (comprehension friction vs. abandonment). -
HYPOTHESIS: Multimodal visual/narrative rationale derived from Gemini 3.5 Flash / Gemini 3.5 Flash-Lite keyframe analysis. -
VALIDATION: Proposed editing action, estimated retention recovery percentage, and sample exposure category.
- Dual-Engine Technical & Behavioral Audit: Full coverage over audience behavioral telemetry AND broadcast technical safety standards.
-
Second-by-Second Telemetry Ingestion: Captures
PLAY,PAUSE,PROGRESS,EXIT,SEEK_FORWARD,SEEK_BACKWARD,REPLAY,VOLUME_CHANGE,TAB_HIDDEN,TAB_VISIBLE,COMPLETE. -
ClickHouse Analytical Window SQL Inspector: Real-time modal inspecting ClickHouse window SQL execution (
lagInFrame,stddevPop, Z-scores) with$<9\text{ms}$ query latency. - End-to-End Pipeline Simulator: Interactive 4-stage playback animation showcasing real-time telemetry processing, joint gating, multimodal scanning, and AI chat response.
- Viewer Trajectory Engine: Evaluates viewer journeys to prevent false retention drop alerts during scene replays.
- Multimodal Vision Investigation: FFmpeg keyframe extraction at peak timecodes + Gemini 3.5 Flash / Gemini 3.5 Flash-Lite frame analysis.
- Zero-Latency Sense AI Chatbot: Google ADK agent with ClickHouse MCP, pre-loaded context headers, and SSE token streaming.
-
Professional NLE Export: Export Final Cut Pro XML (
.fcpxml) and Edit Decision List (.edl) files for Adobe Premiere Pro, DaVinci Resolve, and Final Cut Pro. - 100% ClickHouse Unified Engine: Zero SQLite dependencies; atomic storage of telemetry, screenings, comments, findings, and chat sessions.
| Layer | Technology | Key Libraries / Modules |
|---|---|---|
| Frontend UI | React 18, Vite 5, TypeScript 5 | Tailwind CSS, Lucide React, React Router 6, React Portal |
| Backend API | Python 3.11+, FastAPI, Uvicorn | Pydantic v2, asyncio, httpx |
| AI / Agent Framework | Google ADK (Agent Development Kit) | google-adk, google-genai, Gemini 3.5 Flash / Gemini 3.5 Flash-Lite |
| Database & Analytics | ClickHouse Cloud / Local Columnar DB | clickhouse-connect, ClickHouse MCP Server |
| Media & Vision | FFmpeg | Video keyframe extraction engine |
| Monorepo Workspaces | pnpm workspaces |
@frame-sense/types, @frame-sense/config, @frame-sense/ui |
Frame-Sense/
├── apps/
│ ├── web/ # React 18 + Vite + TypeScript Editorial Workspace
│ │ ├── src/
│ │ │ ├── pages/ # Findings, Screenings, ScreeningRoom, Dashboard
│ │ │ ├── components/ # ClickHouse SQL Inspector, Pipeline Simulator, Media Player, Overlays, EDL export
│ │ │ └── services/ # API client & SSE streaming controllers
│ └── api/ # FastAPI + Google ADK Backend API
│ ├── agents/ # ADK agent definitions (Sense AI, Investigator)
│ ├── app/
│ │ ├── api/routes/ # REST & SSE endpoints
│ │ ├── database/ # ClickHouse client & schema initializers
│ │ ├── screening/ # Trajectory analytics, simulator, chat, investigator
│ │ └── media/ # FFmpeg frame extraction & Gemini Vision service
│ └── main.py # Server entry point
├── packages/
│ ├── types/ # Shared TypeScript domain contracts (@frame-sense/types)
│ ├── config/ # Shared workspace configuration
│ └── ui/ # Shared UI primitives
├── docs/ # Deep technical architecture & specifications
├── tests/ # Complete Pytest integration test suite (76 tests)
├── package.json # Monorepo root configuration
└── pnpm-workspace.yaml # pnpm workspace definition
- Node.js (v18 or higher)
- pnpm (v8 or higher)
- Python (3.10 or higher)
- FFmpeg (installed and added to System PATH)
-
Clone the repository:
git clone https://github.com/Supan-Roy/Frame-Sense.git cd Frame-Sense -
Initialize Monorepo Environment:
pnpm run setup
-
Launch Applications Concurrently:
pnpm run dev
- Web App: http://localhost:5173
- Backend API: http://localhost:8001
# Run complete backend integration suite (76 passed)
apps/api/.venv/Scripts/pytest tests/ -v
# Run viewer behavioral sequence trajectory suite specifically (12 passed)
apps/api/.venv/Scripts/pytest tests/test_behavioral_semantics.py -v
# Run frontend production build verification
pnpm run buildThis project is licensed under the MIT License — see the LICENSE file for details.




