# Wayback Reel — Full Technical & Agent Specification ## Overview Wayback Reel (`wayback-to-reel`) turns any website's Internet Archive history into a smooth H.264 `.mp4` time-lapse video inside the browser. ## Endpoints ### 1. `GET /fun/wayback-to-reel/api/timeline?url={domain_or_url}` Returns one verified `200 OK` `text/html` Wayback Machine snapshot per archived year (`1995`–present). Example response: ```json { "domain": "info.cern.ch", "lookupKey": "info.cern.ch", "count": 27, "snapshots": [ { "year": 1997, "timestamp": "19970404065412", "dateLabel": "04 APR 1997", "isoDate": "1997-04-04", "originalUrl": "http://info.cern.ch:80/", "archiveUrl": "https://web.archive.org/web/19970404065412/http://info.cern.ch:80/", "iframeUrl": "https://web.archive.org/web/19970404065412if_/http://info.cern.ch:80/" } ] } ``` ### 2. `GET /fun/wayback-to-reel/api/snapshot?timestamp={timestamp}&url={originalUrl}` Returns a `1280x800` JPEG/PNG visual capture of `https://web.archive.org/web/{timestamp}if_/{originalUrl}` with CORS headers (`Access-Control-Allow-Origin: *`, `Cross-Origin-Resource-Policy: cross-origin`) suitable for HTML5 `` and `ffmpeg.wasm` compositing. ## In-Browser Video Pipeline (`app.js`) 1. Pre-warms single-threaded `@ffmpeg/core` (`0.12.10`) in a same-origin module worker (no `SharedArrayBuffer` or `COEP: require-corp` lock-in). 2. Composites sequential `1280x720` JPEG frames (`f_%04d.jpg`) at `15 fps` with warm paper framing, browser chrome header, date stamp, hairline progress bar, and cubic-eased cross-dissolves. 3. Executes: `ffmpeg -framerate 15 -i f_%04d.jpg -c:v libx264 -preset ultrafast -crf 20 -pix_fmt yuv420p -movflags +faststart wayback_out.mp4` 4. Cleans up WebAssembly MEMFS files after each encode to avoid 32-bit heap exhaustion. ## WebMCP Tools (`navigator.modelContext`) - `get_wayback_timeline({ url })`: Returns the JSON timeline of yearly Wayback snapshots without starting video encoding. - `create_wayback_video({ url, secondsPerYear })`: Runs the full UI pipeline and returns `{ domain, years, durationSeconds, bytes, downloadUrl }`.