Skip to content
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`currentTime` ran ahead of the presented picture.
- `waitForPresentedFrame` no longer treats a presentation timeout (or an rvfc
callback without `mediaTime`) as success — `hardSeekVideo` retries up to three
times instead of recording `currentTime` as the presented frame.
times instead of recording `currentTime` as the presented frame. A callback
that arrives without a `mediaTime` re-arms the request instead of burning the
attempt, and once `seeked` has fired the clock is accepted as a last resort so
a slow `requestVideoFrameCallback` cannot fail the whole export.
- Export no longer re-seeks for a frame the decoder is already showing. Each
presented frame owns the interval until the next one, so 25 fps footage on a
50 fps timeline now holds for both ticks instead of pulling the following
picture a frame early and hard-seeking back — the case that made export crawl.
The source frame duration is measured from consecutive presented frames rather
than assumed from a frame-rate table.
- Fast / WebCodecs export no longer throws “tainted canvases may not be exported”
for animated SVG overlays (rasterized via a same-origin blob instead of a
`data:` URL) or for other-origin footage that sends CORS (reload with
Expand Down
19 changes: 14 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ obvious cuts were missed, raise it if motion is being misread as cuts.
Append `?force=1` to overwrite unconditionally. Writes are atomic (tmp file +
rename), so a crashed write never corrupts the file.
- `GET /api/media` — list files in ./media (name, src, size)
- `GET /api/video-index?src=/media/foo.mp4` — H.264 MP4 sample table used by
direct browser `VideoDecoder` export (codec config, timestamps, durations,
keyframe flags and byte ranges). Sample bytes come from the normal
Range-capable `/media/` URL; unsupported containers/codecs return 415.
- `GET /api/library?dir=sfx|elements|svg|fonts` — list library assets
- `POST /api/upload?name=foo.mp4` — raw body saved into ./media, returns `{src}`.
MP4/MOV/M4V uploads are auto-remuxed with `+faststart` (needs ffmpeg on PATH).
Expand Down Expand Up @@ -607,11 +611,16 @@ Export is user-driven (Export button → dialog). Three engines:
1. **Fast** — browser renders each frame with the normal compositor (SVG, keys,
AI masks), streams JPEGs + an offline WAV mix to the server; a single ffmpeg
pass encodes them via an **encoding profile** into `./exports/`. Quality /
software path; keeps rendering if you switch tabs.
2. **WebCodecs** — same frame-accurate compositor loop, but the browser’s
`VideoEncoder` produces Annex-B H.264 (Main 4:2:0) and the server stream-copies
(`-c:v copy`) while muxing the WAV. Faster uploads, less server CPU. Requires
Chromium-class `VideoEncoder` with `avc: { format: "annexb" }` plus ffmpeg.
software path; keeps rendering if you switch tabs. H.264 MP4 sources decode
through `VideoDecoder` when indexed (same path as WebCodecs); unsupported
media uses synchronized HTML video stepping.
2. **WebCodecs** — source H.264 MP4 samples are demuxed by the server’s
zero-dependency sample index and decoded directly with browser `VideoDecoder`;
the same frame-accurate compositor then feeds `VideoEncoder`, which produces
Annex-B H.264 (Main 4:2:0) for server stream-copy (`-c:v copy`) while muxing
the WAV. This avoids realtime `HTMLVideoElement` play/seek waits and decodes
overlay clips concurrently. Unsupported sources fall back to synchronized
HTML video stepping. Requires Chromium-class WebCodecs plus ffmpeg.
Encoding profiles do not apply (the bitstream is already encoded). No ffmpeg-style
CRF — quality is bitrate + VBR/CBR (export dialog; remembered in localStorage).
Optional `bitrateMode: "quantizer"` (fixed QP) exists in the spec but is rarely
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,15 @@ same time.
encodes **JPEG frames** via an **encoding profile** from
`encoding-profiles.json` (keeps rendering if you switch tabs). Encode and
upload run ahead of the compositor so a fast timeline is not stalled by
`toBlob`. The Export dialog has a profile selector; pin a project default
with `encodeProfile` in `project.json`
- WebCodecs export: the browser HW-encodes Annex-B H.264; the server
stream-copies and muxes audio. Faster uploads; bitrate/VBR-CBR in the
Export dialog. Unavailable while an export frame is set (use Fast)
`toBlob`. H.264 MP4 sources use `VideoDecoder` when indexed. The Export
dialog has a profile selector; pin a project default with `encodeProfile`
in `project.json`
- WebCodecs export: H.264 MP4 sources are demuxed without dependencies and
decoded directly with browser `VideoDecoder`; overlay clips decode
concurrently. The browser then HW-encodes Annex-B H.264 and the server
stream-copies and muxes audio. Unsupported source formats use the synchronized
HTML-video fallback. Bitrate/VBR-CBR are in the Export dialog. Unavailable
while an export frame is set (use Fast)
- Realtime MediaRecorder fallback when ffmpeg or WebCodecs isn't available
- Export **Range** dropdown: Entire timeline or IN–OUT (defaults to IN–OUT when
markers are set). Effective IN/OUT export bounds are clamped to `projDur()`.
Expand Down
Loading
Loading