Skip to content

Open source CapCut alternative.

TypeScript
6.6 KB
Raw Blame

Donkey Cut

Donkey Cut is a free video editor that runs in the browser at donkeycut.com. The page is the whole editor: it decodes, draws, and mixes the cut, runs the assistant, and renders the export. Code and paths use the shorter name cut.

The one rule: the engine's routes run only on the user's Mac. On a hosted deploy every one of them answers 404 before a handler runs, so nothing the engine does can execute off-Mac and the engine never reaches Donkey's production models. Never wrap an engine route in the Donkey auth helper, read Prisma from it, or bill it against credits.

How it works

A project lives in one of three homes, chosen when it is created.

                    the page (the editor)
                             |
        +--------------------+--------------------+
        |                    |                    |
   browser project      Mac project         cloud project
   origin-private      engine in the        Postgres doc,
   storage in the      Donkey Mac app       media in R2
   page                (local disk, ffmpeg,
                       on-device speech)

The user sees two places, Local and Cloud. Local is the Mac's engine once the app has connected and the browser's own storage otherwise, so a fully local project needs nothing installed. A project lives in exactly one home and the surfaces never proxy to each other. Copy and paste crosses homes: a selection or a media card copied in one project pastes into another with its media brought across, and a second paste of the same source finds the copy already there.

AI is hosted whatever the home: image, video, and voiceover generation and the assistant's Gemini models run through Donkey's authenticated inference routes against the user's credits, and the results land in the project like any other file. The cloud's routes are the engine's hosted twin, same shapes with session auth and credit metering.

The preview

The preview shows ready frames immediately and refines them as decoding catches up. Dive paints inside the output frame, so a title's scale and rotation preserve full-frame coverage. The performance guide covers memory and measurement.

Background previews capture a project operation and a render document before asynchronous work starts. The operation carries the project, residency, document version, capabilities, and transport. The preview queue coalesces edits and drains the final edit when the editor closes. Cloud exports requested from a document store that document in the queued job, so a later edit cannot change the export's input.

Project operation + captured document
                ↓
       Render preparation
                ↓
         Residency renderer
                ↓
        Preview artifact
                ↓
         ArtifactVideo

Browser previews use the browser compositor and replace one cached proxy in OPFS. A browser without the required encoders borrows the cloud worker and brings the result back to OPFS. Automatic browser renders run while the page is hidden and stop when editing resumes or the editor closes; the shelf uses the last completed proxy or its source thumbnail. Mac previews use the engine, retain a file per live job, and publish the project card atomically. Cloud preview jobs have immutable object keys; only the newest requested job can publish the project's preview pointer. A job ID resolves to a fresh delivery URL. Retired cloud previews expire after a day, while the current project preview stays available. The shared viewer plays MP4 or HLS with its own media element and releases its resources on source changes and unmount.

Cloud source media, generated media, and retained exports count toward storage. Derived previews, share cards, and HLS ladders are quota-exempt; staging inputs are temporary. An export is weighed twice — the size it is heading for before a frame is drawn, and what actually landed before the account is charged — so one render cannot carry an account past its cap. Transports expose structured storage, credit, and authentication failures. Each host chooses their presentation; the website mounts its storage dialog separately.

A project has three timelines, Main, Second and Third, each with its own frame; a share link plays the one its settings pick.

Timeline and preview share selection: ⌘/Ctrl-click or Shift-click toggles items; dragging moves them with one undo step. Groups persist. Their preview frame scales and rotates the selection; the group panel edits shared fields, showing Mixed where values differ. Text side grips change wrapping width and corners scale proportionally; height follows content across preview, export and chat.

Guides draw over the preview from the button beside the timeline zoom: thirds, center, safe margins, the short-form keep-out zone, and custom lines. They save with the project, snap a dragged element to their edges and never export.

The export

Best uses original resolution, cadence, supported H.264/HEVC codec and audio settings. Whole files and trims in the project’s shape copy compressed streams; compatible sequences copy video and encode joined audio. Interior joins need matching codec configurations and keyframes. Audio joins use FFmpeg on the project’s machine. The local-compute guide covers browser handoff, the color guide HDR delivery.

Sharing

A cloud project can be shared read-only by link, with the owner choosing which surfaces a viewer can open. The server filters the doc and its media to that set before anything leaves; the rail still shows every tab, and a withheld one sits locked with a hover note saying the view is read-only. A viewer can copy the shared project into their own account.

Folders and assets use the project Share dialog for read-only public links or verified-email access; local items first become independent cloud copies. Folder access follows current contents; revocation blocks new requests immediately, while issued media URLs expire within two hours.

The assistant

The chat drives everything the editor can do through typed tools, and every tool's schema and prompt text derive from the same constants the UI uses, so the catalog stays true. The assistant guide covers the harness, the tools, and the evals that hold the line.

Where it lives

The editor, its stores, and the backend seam live under the site's cut folder; the engine and worker share its server code; the Mac app is a menu bar shell that ships the engine and screen recording. Every kind of item the timeline can select is one entry in the item-kind table beside the store, and copy, paste, templates and the media collector read that table, so a new kind is copyable and pasteable by construction.