# How VideoBuff Runs 100% Client-Side — WebCodecs, OPFS, OffscreenCanvas, and Why MCP Works

> VideoBuff never uploads your video files — everything runs inside the browser. This article explains the client-side stack that makes that possible (WebCodecs for GPU decode/encode, OPFS for local storage, OffscreenCanvas and WebGL for export compositing, Web Audio API for sound processing) and why this design is exactly what lets Claude Code / Claude Desktop drive edits through MCP without any cloud round-trip.

_Last updated: 2026-10-10 · First published: 2026-10-10_

## Why we went 100% client-side

VideoBuff is a video editor that never uploads your files — decoding, compositing, and export all run on your local GPU and CPU. No cloud storage, no server-side FFmpeg pipeline, no account signup.

We chose this design because **a developer-grade workflow doesn't work without it**. Three concrete reasons:

1. **Zero upload wait.** A workflow that pushes a 1 GB asset to S3 every time you edit is slow, bound by egress costs, and rate-limited. When the local GPU does the work, file size stops mattering in practice.
2. **Crisp privacy boundary.** Unreleased footage, internal materials, and personal recordings don't belong in a third-party cloud. If the file stays inside the browser sandbox, "what is leaving the machine?" is no longer a debate. Apart from your media and edits, the only things that leave are site analytics (Google Analytics 4 — page views, clicks and the like), anonymous usage statistics when you use the Claude integration (you can turn these off in the editor's settings), and font requests for Claude's animations (the characters used and the font name). The privacy policy has the details.
3. **MCP integration becomes natural.** Because edit state lives as in-memory JavaScript objects in the browser tab, the MCP server is just a thin local bridge that talks to the tab over a WebSocket. No cloud API, no auth/key management, no regions, no round-trip latency. See the Claude integration guide for the full story.

The rest of this article walks through the four Web APIs that make this design work — WebCodecs, OffscreenCanvas, Web Audio API, and OPFS (with localStorage handling project-structure persistence) — and where each one carries its weight.

![A diagram of how VideoBuff works. Inside the browser, media is stored (OPFS), video is read and drawn (WebCodecs and Canvas), audio is processed (Web Audio) and the MP4 is encoded (WebCodecs); the video files themselves never leave the computer. The VideoBuff server only serves the page and settings. When Claude edits, it drives the open editor through an extension on this computer](https://videobuff.app/guides/how-it-works/architecture-en.webp)
_The big picture: why your files never leave your computer_

## WebCodecs API — client GPU instead of server-side FFmpeg

The WebCodecs API is a low-level interface for hardware-accelerated decode and encode of H.264 / H.265 / VP9 / AV1 inside the browser. `VideoDecoder` pulls frames out of source files, `VideoEncoder` compresses edited frames with a chosen codec. Unlike a WASM build of FFmpeg, this talks to the OS's hardware decoder directly, so it is **orders of magnitude faster and more power-efficient** than JS/WASM implementations.

For a developer, the practical implication is: you no longer need to stand up a cloud GPU instance to encode video. The old pipeline — upload to S3, spin up EC2 or Lambda to run FFmpeg, download the result — collapses into a single stage running on the user's M1/M2/integrated GPU. No server cost, no egress.

VideoBuff uses a two-stage architecture. Preview plays through the browser's `<video>` element, with color and blending approximated by CSS / SVG filters. Export pulls frames one by one with `VideoDecoder`, composites them with OffscreenCanvas and WebGL, and compresses them with `VideoEncoder`. Latency during preview, accuracy during export. Encoding tries the hardware encoder first and falls back to software on machines that can't use it.

## OffscreenCanvas

OffscreenCanvas is an API for drawing onto a canvas that is never shown on screen. During export, VideoBuff composites each frame — video, text and images — on an OffscreenCanvas 2D context. Image blend modes and transitions are drawn here too.

Color grading and perspective correction run on the GPU through WebGL2 before being layered in. Handing these per-pixel calculations to the GPU keeps exports fast, even in 4K.

Of the heavy jobs, thumbnails, audio waveforms and auto captions run in Web Workers so editing never stalls. Preview stays lightweight (the `<video>` element plus filters, as described above); only export uses this high-precision compositing.

## Web Audio API

The Web Audio API enables building real-time audio processing graphs within the browser. VideoBuff implements a 3-band EQ using BiquadFilterNode, a compressor using DynamicsCompressorNode, and volume mixing using GainNode.

These nodes are connected in series to form an audio processing chain that processes each clip's audio in real time. Using offline rendering mode (OfflineAudioContext) enables rapid generation of PCM data with the same effect chain applied during export.

When a clip's speed changes, its pitch is kept by the browser's own playback (`preservesPitch`) during preview and by SoundTouchJS (a WSOLA time-stretch that changes length without changing pitch) during export. As the last step of export, overall loudness is normalized for the destination (−14 LUFS by default).

## OPFS and localStorage — the technical guarantee that files never leave

The Origin Private File System (OPFS) is a sandboxed filesystem built into the browser. VideoBuff stores the raw bytes of imported video, audio, and image files in OPFS. OPFS is fully isolated per origin, inaccessible to other sites, and unreadable from outside the browser except through devtools. Files survive tab close, reload, and machine reboot.

Project structure — timeline layout, clip placement, effect parameters, text content — is JSON-serialized into the browser's **localStorage**. The save is debounced at ~1 second; even a browser crash recovers to near the last state. Regenerable data such as thumbnails and waveforms is never included, so only the edit structure is stored (localStorage allows about 5 MB per origin; if a save still doesn't fit, the toolbar shows "Save error"). The OPFS asset manifest (assetId → filename mapping) lives in the same localStorage namespace.

**These two APIs are the technical backing for "never uploads."** Raw media sits in OPFS, edit structure sits in localStorage, and both are confined to the browser sandbox. There is literally no implemented code path that syncs or uploads either one. If you want to verify the claim, open DevTools → Network, edit for a while, and confirm that zero upload requests are sent.

A side benefit: **this architecture is also why MCP integration is serverless.** Edit state is entirely contained within the tab (in-memory JS plus OPFS plus localStorage), so the MCP server just talks to the tab over a local WebSocket — no need to project state to the cloud first. The "expose state to Claude by first putting state in a server" detour is eliminated.

(Implementation note: IndexedDB was considered during early design and is a likely future migration target if the project size or diff-based persistence requirements outgrow localStorage. At the current project scale, localStorage with a ~1 Hz debounced full-JSON write is sufficient.)

## Why this architecture is drivable from Claude Code / MCP

Once you understand the design, it becomes obvious why a browser app can be driven from Claude Code or Claude Desktop. The short answer: all edit state is contained inside the tab.

Concretely, installing the .mcpb starts a local stdio MCP server (a Node.js process) on your machine. This server is a thin bridge that forwards between two channels: stdio with Claude Desktop / Claude Code, and a localhost WebSocket to the VideoBuff tab. When Claude invokes a tool like `add_clip`, the MCP server relays it to the tab, the tab's edit store executes it, and the result flows back. There is no cloud service anywhere in this path.

This architecture works because edit state is fully local: **in-memory JS objects in the tab, plus OPFS, plus localStorage.** If the media lived in S3 and the project lived in an RDBMS, the MCP server would need the AWS SDK with auth, permissions, and regions to do its job. Because everything is client-side, the MCP server is a thin bridge that carries no cloud credentials and no API keys (it checks that the connecting tab really is VideoBuff with a one-time token created at every launch, plus the page's origin).

Note that what Claude reads — the project's structure, clip and asset names, and still frames it looks at to check its work — is sent to Claude (Anthropic) as part of the conversation. Your media files themselves are not. See "What Claude gets to see" in the Claude integration guide.

From the CLI side, the experience is: launch `claude code` in a terminal, send a prompt like "line up every imported image on the timeline at 3 seconds each," and the change shows up in the browser tab seconds later. It feels the same as running `git` or `ffmpeg` from the shell — you've just added a browser video editor to the same tier. See the Claude integration guide for the full flow.

## Browser Compatibility

VideoBuff recommends Chrome or Edge on a computer. Firefox and Safari 26 or later on Mac also support the WebCodecs API and work from import through editing and export, with a few differences:

- In Firefox and Safari you can't choose where exported videos are saved; they go to the browser's downloads
- Auto captions aren't available in Safari (a Safari bug makes the page crash)
- The Claude integration doesn't work in Safari (Safari blocks web pages from talking to the Claude integration extension on your computer)

iPhone and iPad are not supported.

Export formats are checked when you open the export dialog. If your setup can't encode H.265, H.265 is shown as unavailable and can't be selected.

Browser APIs are evolving rapidly, and support across more browsers is expected to continue expanding.

## Looking ahead: video editing in the browser + AI-agent era

Browser video processing capabilities are evolving rapidly. WebCodecs AV1 encoding is landing in some browsers, WebGPU is making direct GPU-based effects and real-time processing realistic, and SharedArrayBuffer / Atomics multi-threading plus WebTransport continue to improve.

VideoBuff's direction rides this trend toward "video editing an AI agent can drive." We get desktop-class processing entirely client-side, then layer natural-language access from Claude Code or Claude Desktop on top — a two-tier architecture.

The combination of local GPU plus natural-language control changes how editing works. Thirty minutes of repetition in Premiere Pro becomes a single request, and animated titles or 3D scenes that once meant learning After Effects are now something you describe and Claude builds onto your timeline. Edit it yourself or let Claude do it — either way the processing runs on your local GPU, in the browser in front of you, today.
