Passtape.
Menu

Web Backend

passtape-web runs Passtape in a browser. The graph, .videdit compilation, and preparation are the same as on native platforms. What changes is execution: WebCodecs decodes and encodes, WebGPU runs video passes, and audio uses the portable CPU backend.

page                         engine worker
──────────────────────       ─────────────────────────────────────────────
PasstapePlayer ── messages ─> wasm engine: compile, prepare, record frames
canvas (offscreen) <─ draws ─ WebGPU: execute recorded passes
AudioContext <─ shared ring ─ CPU audio blocks
                              Mediabunny + WebCodecs: demux, decode, encode

Playback and export run in one dedicated worker except the AudioContext, which browsers only offer to pages. The page hands its canvas to the worker as an OffscreenCanvas. Audio crosses through a ring buffer in shared memory, so the page must be cross-origin isolated.

A host can inspect a selected local file before uploading it through @general-motion/passtape-web/inspect. inspectMedia(file, signal) reads container metadata and a bounded sample of video packet timing without decoding frames. It returns playable stream facts or a LocalMediaUnavailableError, using the same video restrictions as playback. The host can then pass the original File to setMedia; it does not need a server URL or a cloud proxy.

What the backend accepts

The web profile declares only what this backend implements. Preparation therefore rejects a graph it cannot run exactly, with the same error a native backend gives for an unknown implementation. It never renders a different result.

  • Video surfaces are Bgra8 and Rgba16Float textures, and masks are R16Float. Browsers deliver decoded video as RGB, so the native backends’ YUV surface formats do not exist here.
  • Implemented operations: 2D transform, opacity, blend, mix, alpha-over, every grading operation the .videdit compiler emits (primary grade, HSL qualifier, power window, curve, 3D LUT, channel mixer, apply mask, mask preview, tone map), color adjust (exposure through vignette and sharpen), Gaussian blur, the conversion and resize passes preparation inserts, and effects an application registers (below). Other operations, such as keys, RGB and hue curves, and corner pin, fail preparation.
  • The 2D transform requires straight-alpha input. It leaves pixels outside the moved frame transparent, and preparation labels an operation’s output with its input’s alpha mode, so an opaque input would label that transparent border opaque. A later alpha conversion would then turn it black. Converting first keeps the border transparent. The macOS backend does not declare this requirement yet, so a scaled layer still gets a black surround there.
  • Color conversions between passes cover BT.709, sRGB, and linear transfer, and decode the camera log encodings with the macOS backend’s curves. A video asset with an input color is declared in its camera log and gamut, with its original’s range, rather than as BT.709. Linear Rgba16Float output is left unclamped, as on macOS, so colors a grade moves outside 0–1 survive until the next encoded surface.
  • Video sources must be H.264 in BT.709 limited range, the only codec and color space the import calibration below measures. A file whose track has another codec, declares other primaries, a different YUV matrix or transfer (including PQ and HLG), or full range fails when it loads. A track that leaves its color unspecified is taken as BT.709. Why HEVC, 10-bit, and HDR video cannot be measured is under Phone footage.
  • A track rotated by quarter turns, as phones record portrait video, is shown upright at its display size, as the macOS backend shows it.
  • Audio is mixed in stereo at the sequence’s sample rate. A source at another rate or channel count is converted once, when it is decoded, as the macOS backend converts it: mono feeds both sides, 5.1 and 7.1 fold down with the center and surrounds at -3 dB and no LFE, and a 48-tap Blackman-windowed sinc filter resamples. Other channel counts fail when they load.

Decoded frames are staged before rendering

The engine asks for source frames synchronously, but WebCodecs decodes asynchronously. A worker that blocked waiting for a frame would never receive it. The worker therefore decodes first and stages each VideoFrame with the engine, and rendering only looks up what is staged:

render(t) ── every source frame staged? ── yes ─> record passes
                       │
                       no
                       ▼
     report the missing (source, time) and fail "not ready"
                       │
     worker decodes them, stages them, and renders t again

A missing frame is never substituted with a nearby one. A frame is rendered exactly or not at all. At a source-frame boundary, forward playback selects the following frame and reverse playback selects the preceding frame. Browser microsecond timestamps, staged-range lookup and returned source ranges use the same direction-aware boundary rule, including when a nested composition is retimed. Still images also return a range valid for the requested direction.

A still image (PNG, JPEG, GIF, WebP, BMP, or AVIF) is the exception. It is decoded once with createImageBitmap, premultiplied and without color conversion, and copied once into a texture the engine reserves for it. The texture is declared as the macOS backend declares a decoded image (8-bit BGRA, sRGB, premultiplied alpha) and answers every request for the image, at any time, so showing it costs no decoding or upload per frame. Assets showing one file share its texture, which returns to the texture pool once a load no longer reads the image.

OpenEXR uses a pool of up to eight Workers running the shared native codec as WebAssembly. Workers decode disjoint bands from shared compressed bytes into a shared output frame. Colour layers produce RGBA half floats in the working space. Data reads select full channel names in an explicit order and produce R32, RG32 or RGBA32 floats; three selected channels use RGBA32 with zero in the fourth slot. Their bytes go straight into float textures without colour conversion or premultiplication. This also lets an STMap read R and G of a colour layer as raw coordinates.

The document registers each data source with its layer, channel order, data window and sequence timing. Stills upload once; sequences use the same missing frame handshake as footage. Missing or corrupt EXR sequence frames are cleared: transparent black for colour, zero for data, matching the Mac backend. Reloads reuse staged images only when their source identities still match.

An automatic data view exposes its 1 × 1 range as a separate graph output. Lock renders that output at the playhead and reads back its two float values, without any display transform. A uniform or entirely non-finite frame cannot supply an increasing fixed range. The editor also discards a measurement if the document or playhead changed while it was running.

Text needs no browser. Text set in a font shipped with Passtape (passtape-text, which bundles Inter) is drawn in Rust inside the engine the first time a frame needs it, with the same code and font the macOS backend uses, and a WRITE_TEXTURE command on the next tape copies the pixels into a texture. The texture serves every frame until the text’s content changes, and is released once a load passes without a render using it. Text in any other font, and outlined text, which passtape-text does not draw, is refused, since the browser’s own text would not match other backends.

Staged frames keep their presentation range. Browsers report timestamps as floating-point seconds, so ranges are rounded to whole microseconds, and the lookup treats each boundary as half a microsecond earlier. This keeps every exact frame time on its own frame.

A rotated track’s frames are staged with the track’s rotation set on each VideoFrame. Browsers apply it when importing the frame, so passes read it upright, at the display size the engine declared for the source, without a copy or a rotation pass. A browser whose VideoFrame has no rotation refuses such a file when it loads.

Each source keeps a short window of staged frames. Browsers back decoded frames with a small decoder-owned pool, and holding too many stalls decoding. When the window is full, frames that ended before the latest request are released first, except samples required by the current output frame. Those samples stay protected across decode retries, so a dissolve or nested instance can read the same source at several times without evicting its own inputs. The required samples may exceed the usual read-ahead window. During playback and export, each source decodes a few frames past the time the engine last requested, so the next frame is usually staged before it is rendered. A request close ahead of the decode position reads on. A request behind it, or far ahead, seeks from the preceding key frame, which on long-GOP media costs hundreds of milliseconds at 4K.

Recorded GPU work

The Rust backend never calls WebGPU. For each frame it appends compact commands to a command tape: texture definitions, one draw per pass, and draws into canvases, or clears of canvases when there is nothing to draw. Executing a frame’s pass tape records one draw command per pass. The worker executes the tape in one call as a single command encoder and queue submission. Crossing between wasm and JavaScript therefore happens a handful of times per frame, not once per WebGPU call.

engine render ─> tape: DEFINE_TEXTURE … PASS … EFFECT … PRESENT | CLEAR
                       cleanup: CLOSE_FRAME …
worker ─> encode passes ─> submit ─> close released frames

Texture identities are allocated in Rust and recycled through a pool keyed by size and format. The pool retains the current tape’s working set for reuse. Older idle textures share a 128 MiB, 64-object allowance; the least recently acquired or released ones are destroyed after submission when either limit is exceeded. Textures still held by a decoder, static cache or pending upload are not idle. This allowance is additional to those live surfaces and the current working set, not a total GPU memory cap. Evicted identities are reused only in later tapes. A decoded frame is closed only after the submission that sampled it, because closing it earlier would invalidate the work.

Video passes are WGSL fragment shaders over a full-screen triangle, one .wgsl file per operation, each a port of the Metal kernel of the same operation. Decoded frames are bound directly as external textures, without copying. Each pipeline is generated for its mix of texture and frame inputs: a generated prelude declares the inputs, and the kernel file follows it unchanged. Pipelines are cached, and so are the bind groups of passes that read no decoded frame.

Data images

Data images (depth, lens maps, IDs) live in r32float, rg32float and rgba32float textures, which WebGPU can load and render to without optional features; the device still requests none. add_data_image uploads a tightly packed f32 buffer through a WRITE_TEXTURE command, and a READ_TEXTURE command copies a texture back with copyTextureToBuffer, both bit for bit, denormals and NaN payloads included. media.data.range, media.data.preview, media.data.depth_matte, media.video.depth_mask, media.video.stmap_warp and media.data.lens_map are fragment passes that read texels only with textureLoad, so no sampler filters a value and nothing blends one. The lens map has one pipeline per lens polynomial, as on macOS, and reads an undistort map’s inverse table as a pooled rg32float texture written once per table; an evicted table’s texture returns to the pool, so an animated lens does not leave one behind per frame. Writes run before a tape’s passes, so the recorder keeps every table a recorded pass reads out of the pool until the tape is taken; a table evicted and its texture rewritten within one tape would otherwise change what an earlier pass reads. The range folds 4 × 4 tiles into ever smaller rg32float textures until one pair is left. Chrome on Apple GPUs truncates an f32 stored into a half-float target, so the preview, the depth matte, the depth mask, the warp and the mask application (media.video.apply_mask) round to the nearest half themselves, as the Metal kernels do with explicit half conversions; a plain float write into a half texture on Metal rounds toward zero. The warp writes fma wherever a product is added, as macOS and the Rust reference do. WGSL division is only accurate to 2.5 ULP, so the depth matte computes inverse depth by integer long division, as macOS does, which gives the correctly rounded reciprocal on any GPU. Alongside real EXR document checks, apps/passtape-bench isolates the kernels with graphs built in Rust (the cases in crates/passtape-web/src/data_cases.rs, run alone by conformance.ts data), with color sources uploaded by add_half_float_image, and compares every value with Metal’s: uploads, ranges, depth mattes and ID previews match bit for bit, as do depth masks, which must also equal a depth matte followed by a mask application, and grey and channel previews within one half-float ULP. Ranges and depth mattes must also equal the reference definition. Warps must be within one half-float ULP of Metal and of the reference definition, and nearest and identity warps exactly equal; identity warps of a one-pixel checkerboard must also equal the source itself. Lens maps are compared in pixels of their lens frame: within 0.001 px of Metal and 0.002 px of the reference definition, with every marker in the same place except on the frame’s edge. WGSL leaves it to the implementation whether fma is fused, so this parity is checked on Chrome on Apple GPUs, where it is.

Grading

Grading runs as on macOS: in linear BT.2020 half-float with straight alpha, with the same uniforms, order, and clamping, and with the luminance weights and curve sampling both backends take from passtape-engine. Curve samples, window polygons, and 3D LUTs are graph resources. Each is uploaded once, as a DEFINE_BUFFER or DEFINE_LUT command keyed by its content fingerprint, so loading an edited document reuses every resource whose data did not change. A LUT is a half-float 3D texture sampled with trilinear filtering, as on macOS. Each load starts a resource generation, and a resource no document used during the previous generation is destroyed after the next submission.

A LUT node names a .cube file by path, as an asset names its media. The page passes the file’s text with setLuts, once per file version, and drops it with removeLuts when the file goes offline; the engine parses it with the same parser the native editor uses and keeps it for every later load. A node whose path has no parsed LUT passes its image through, and the load lists it in droppedEffects.

first use ─> DEFINE_BUFFER | DEFINE_LUT (once per fingerprint)
each frame ─> PASS kernel … (BUFFER | LUT) id
second load without it ─> cleanup: DESTROY_RESOURCE id

Three things differ from macOS:

  • macOS fuses adjacent grading operations into one pass and writes the final 8-bit or YUV output from it. Here each operation is its own pass, so values are rounded to half floats between operations.
  • An HSL qualifier draws one pass per demanded output instead of writing both in one dispatch.
  • Both backends use a finite separable Gaussian with sigma = radius / 3, ceil(radius) taps on each side and a half-float intermediate. macOS uses prebuilt MPS convolutions and rounds an animated radius to half a pixel. Here the convolution runs at the exact radius of each frame. Blur samples at pixel centers with filtering so external video uses the same chroma reconstruction as normal display; direct texture loads can change the chroma at sharp video edges.

The conformance check below includes a sequence graded with every grading node kind. Its graded frames differ from Metal’s by about a quarter to a third of a level on average, the same as ungraded ones.

3D scenes

A scene pass runs the same scene.wgsl as macOS, in one render pass per scene with 4× multisampled colour and reverse-Z depth32float depth, transient where the browser offers it, resolved into the output. The page passes .glb files to setMedia as Blobs; the engine parses each once per content under its media file name and drops it with the file. A scene naming a model no file loaded fails rather than drawing without it. Meshes and mipmapped textures upload once, as DEFINE_MESH and DEFINE_MIPMAPPED_TEXTURE commands keyed by the file’s content, and are released through resource generations like LUTs. Each texture keeps its glTF wrap modes in its own sampler. As on macOS, the output is the display window plus the description’s overscan margin, which the camera’s projection continues into.

The conformance check’s three-d cases draw generated models: lit spheres across roughness and metalness, a textured normal-mapped box, alpha mask and blend, a camera push, flat cards, and a scene with a film offset and 2:1 pixels rendered into the margin its 3D group’s redistorting lens reads. At 640 × 360 Chrome’s frames match Metal’s exactly, since both backends draw from the same numbers through the same shader on the same GPU; the cards and the lens warp, which resample pictures, differ by at most one level.

Application-defined WGSL effects

An application registers video effects at runtime, the web counterpart of the macOS backend’s Metal effects. PasstapePlayer.setEffects takes each effect’s operation, parameters, and WGSL compute kernel. The worker compiles every kernel against one binding layout and leaves out, and reports, any that does not compile. The engine checks each remaining effect’s declaration, such as its parameter count and ranges, leaves out and reports any it refuses, and rebuilds its runtime with the rest. The document is then loaded again; extension effects whose authored parameters do not match their declaration are left out of the graph and listed with the loaded sequence.

setEffects(effects) ─> worker: compile each kernel ─> engine: register operations
render ─> tape: EFFECT index output block input ─> compute dispatch, 8×8 groups

Passtape’s built-in effects, passtape.shape.rounded_rect and passtape.composite.draw_image, use the same path. Their WGSL ships with the engine, the worker compiles it when the player starts, and they always hold the first effect indices, ahead of the application’s.

Preparation gives an effect one straight-alpha, linear-light BT.2020 rgba16float input, converting before it as needed. The kernel reads the input at binding 0, writes a texture_storage_2d<rgba16float, write> output at binding 1, and reads 256 vec4<f32> parameters at binding 2. These are its parameters in declaration order, numbers in .x and colors in .xyz, followed by zeros. A built-in effect with a second input, such as the image draw_image draws, reads it at binding 3. Inputs after the first keep their own size; the output takes the first’s. Parameter blocks travel in their own section of the tape, 4 KiB each. Float textures are created with storage usage so an effect can write them; WebGPU cannot store to BGRA8.

Import color correction

Browsers convert a VideoFrame to the canvas color space when importing it as an external texture, and the conversion depends on the decode path. On Chrome for macOS, a hardware-decoded BT.709 frame is linearized with Apple’s 1.961 gamma and re-encoded as sRGB, so code value 128 arrives as 139. A software-decoded frame arrives unchanged within 0–1.

The native backends work with the decoder’s code values, so at startup the web backend measures this conversion and undoes it:

known ramps ─ VideoEncoder ─ VideoDecoder (hardware | software)
            ─ import ─ read back ─ invert ─ correction per decode path

Frames are matched to a correction by the pixel format their decode path reports. A frame from a decode path that was not measured is rejected with an error rather than rendered uncorrected.

YUV reaches RGB code values outside 0–1, from −1.13 to 2.14 for 8-bit BT.709, and macOS converts decoded YUV to linear float without clamping, so a saturated or super-white color keeps its value through blends and grades. Chrome’s hardware path imports such values unclamped, through the same curve extended to them (mirrored below 0). The calibration therefore measures that whole range: besides the gray ramp over every 8-bit luma code, it decodes the ramp with the blue-difference chroma at either extreme, whose blue channel reaches both ends. The correction table spans the imported values measured, so out-of-range colors come back as the decoder’s code values at no extra cost per pixel. Chrome’s software path clamps to 0–1 on import; its frames lose those values, and the table maps 0 and 1 to code values 0 and 1.

After correction, web and Metal frames differ by under half a level on average. The remaining differences sit at sharp color edges, where browsers upsample 4:2:0 chroma with their own filter.

apps/passtape-bench/scripts/conformance.ts checks this against the Metal backend on one, three, and six layers, with scaled overlays, with translucent ones, and with a graded base layer. Scaled and translucent are tested separately: through a translucent scaled overlay, the edges of the layer below are too faint to locate, yet their chroma still differs. It also renders a portrait phone clip, stored landscape with a quarter-turn rotation, alone in a portrait sequence and stretched over a landscape one. Both backends turn the clip by its track rotation, so the Metal reference renders the same file. The web frames differ from it by about 0.4 of a level on average upright and stretched. A camera-log case reads the base layer as S-Log3 in S-Gamut3.Cine in a project that tone maps, so the log decode, the camera gamut and the highlight roll-off are compared too; it differs by 0.4 of a level on average, and its budget for larger differences away from edges is wider, because the curve’s slope magnifies the browsers’ chroma upsampling. A second camera-log case shows the same through the ACES 2.0 output transform; it differs by 0.5 to 0.65 of a level on average, and its mean budget is 0.75, because ACES’s contrast and gamut compression raise those differences again. Last, it checks that the HEVC phone clips described next are refused. The one-model mode renders the combined Vela acceptance fixture: three linked shots with half-frame sound offsets, a dissolve, grading, track blur, and three animated lower-third instances. It checks eight frames, including both sides and the midpoint of the dissolve, against the same error bounds. These are frame comparisons, not encoded export or audio comparisons.

Phone footage

Phones record H.264 or HEVC, and recent iPhones record HEVC Main 10 in BT.2020 with HLG by default. The macOS backend decodes such video to 10-bit YUV surfaces and converts it with Passtape’s own transfer functions, so matching it needs the decoder’s code values. Chrome 155 for macOS cannot give them for HEVC, as measured with lossless test frames of known values:

  • HEVC decodes in hardware only; asking for software decoding is refused.
  • Hardware-decoded HEVC, 8-bit or 10-bit, is converted to RGB with the BT.601 matrix whatever the stream declares, and the result is clamped to 0–1. A colorSpace given to the decoder changes nothing. Saturated colors are clipped, so no correction recovers them.
  • A 10-bit frame has no pixel format, so copyTo refuses it, and importing it, as an external texture or into WebGL, gives 8-bit values.
  • HLG and PQ frames import with their transfer ignored (equal code values give equal results) and a gamut conversion that is not separable per channel. A calibration from a 17×17×17 grid of known colors predicts it only to 5–9 levels on average, ten times the conformance tolerance.

HEVC is therefore refused when it loads, with the reason: an asset reading it is offline, and an editor plays its H.264 proxy instead. H.264 phone footage, rotated or not, renders.

Loading and reloading

The page adds media files once with setMedia, keyed by the asset paths documents use. A file is a Blob or a URL (an image must be a Blob); a URL is read with range requests as decoding needs it, so its server must allow them across origins. Each file is opened and probed then. Adding a path again with a new URL, such as a fresh signed one, replaces the file from the next load. A file the backend cannot render is kept with its reason, and an asset reading it is offline (below).

setMedia can also take a preferred file for some paths, such as an original whose path’s own file is a proxy. The preferred file is used only when the backend renders it exactly, decodes all its tracks, and has stereo audio already at the sequence’s sample rate; otherwise the path’s own file is used. The result says, for each preferred file, whether it was used and why not.

refreshUrls points URL-backed files at fresh URLs of the same files without reopening them, so a long export can outlive signed URLs. It acts at once, even while an export holds the request queue. A fetch the server refuses (HTTP 401 or 403), a server error (5xx), or a fetch with no response the page may read is retried after 1, 2, 4, 8, 16, 16, and 16 seconds, about a minute (63 seconds) in all; after that the read fails. A refused or unreadable fetch also sends the page an onUrlRefused(path) event, once per URL, so it can sign a fresh URL before the retry. Browsers report a network failure and a response without CORS headers alike, and R2 answers an expired presigned URL with a 403 that carries no CORS headers, so an unreadable fetch may be an expired URL. Only four in a row while the browser is online (about 7 seconds) fail the read early, as the media server refusing cross-origin access: a URL signed again in that time reads normally, while a server without CORS headers never does.

load(document) only recompiles and prepares the document, so an editor can call it after every edit. The engine keeps staged frames, decoders, and decoded audio for every source the new sequence still reads:

load(edited document)
  wait for read-ahead in flight
  compile, prepare                      about a millisecond
  sources still read     keep decoder, staged frames, decoded audio
  ... read as new color  keep decoder, release staged frames
  sources no longer read release staged frames, close decoder
  new sources            start a decoder; decode audio once

Redrawing the current frame after an edit therefore needs no decoding. A video source is one asset reading one file, so each asset decodes on its own even when assets share a file: a decoder reads forward from one position. Audio is decoded whole, so assets sharing a file share it. Replacing the file at a path gives it a new name, which starts its sources over at the next load. A source that a document drops and a later one brings back decodes again from its key frame. So does an asset read as another color profile: its frames were staged tagged with the old profile, which would still convert them. An asset whose path was never added fails the load before the engine sees the document, so the previous document stays loaded.

An asset can be offline: the page names it in load(document, offline) with its reason, because it has no media the browser can render, or the file at its path cannot be rendered. The engine compiles every clip of an offline asset as a disabled clip, to nothing, so it shows as a gap, or as the layers below it, and the rest of the sequence plays and exports. The result lists each offline asset and why, for the page to say so. A path that was neither added nor named offline fails the load.

load(document, offline)
  each asset with a path ── added and renderable ─> declared to the engine
                         ├─ named offline, or file refused ─> offline, with reason
                         └─ neither ─> load fails
  engine: clips of undeclared assets disabled ─> compile ─> result lists offline

The native editor has no such state: a clip whose media is offline fails its compile, so its viewer shows only the reason and its export refuses. An editor matching it, as Vela’s web editor does, refuses to export a sequence with offline media itself.

Playback, seeking, and export

Seeking renders the requested frame and resolves when the GPU has finished it. Playback follows the audio clock: the worklet counts the samples it has played, and each display refresh draws the frame due at that position. When there is no audio, playback follows elapsed time. Once the worklet has played the sequence’s last sample, the last frame is drawn and playback ends: the audio clock trails the speakers by the output latency, so it alone would stop short of the last frame’s end.

The preview canvas’s size is the preview resolution. resizePreview changes it and prepares the loaded sequence for the new size; the canvas stays blank until the next seek.

The worklet also records the loudest sample of each channel it plays. meterLevels takes those peaks and starts over, so a meter calling it every display frame shows the audio actually heard, not the audio rendered ahead, and reads silence once playback pauses.

A sequence with no video output, such as a new one with no clips, is a normal state, not an error: it loads, and every frame it draws is opaque black, as a gap between clips shows. Its audio, if any, still plays and drives the clock.

Export renders every frame at the sequence size, or at a requested even size, into an OffscreenCanvas and wraps it in a VideoFrame for VideoEncoder, with no copy of its own. It interleaves the sequence’s audio and writes, through Mediabunny, a MOV or MP4 of H.264 or 8-bit HEVC video with AAC or 32-bit float linear PCM audio. Decoding runs ahead of rendering, so it overlaps the GPU work and encoding of earlier frames. It reports progress about ten times a second. Exporting a sequence with no frames is refused.

An export may ask for another frame rate. The export canvas is then prepared at that cadence (prepare_video_at_rate), and output frame n samples the timeline at n of its frame durations, as the native export does: each clip shows its source at that time, so 60 fps footage in a 24 fps sequence keeps its motion in a 60 fps export. The export has every output frame that starts before the sequence ends (exportFrameCount), so its last frame may run past the sequence’s end; the audio still stops there.

Audio is encoded at the loaded sequence’s sample rate. To export at another, the page loads the document with that sampleRate: each source is then decoded and converted to it once with the native resampler port, as the native export converts sources to its output rate rather than resampling the mix. A player made with playback: false only exports, so it loads documents at any sample rate; one that plays refuses a rate other than the speakers’.

Browser encoders convert the canvas into limited-range BT.709 YUV but signal the canvas’s sRGB transfer. The engine’s output holds BT.709 code values, so the export corrects the container’s colr description to Rec. 709 (BT.709 primaries, transfer, and matrix, limited range), as the native export tags SDR. The transfer the encoder wrote into the bitstream’s VUI stays sRGB.

exportVideoProblem and exportAudioProblem say whether this browser can encode a codec at a size and bitrate, or at a sample rate and channel count, before an export starts, through VideoEncoder and AudioEncoder isConfigSupported. H.264 frames larger than level 5.2 allows (the area of 4096×2304) are refused, because browser encoders can accept such a configuration and then fail mid-encode. Linear PCM needs no encoder. cancelExports stops every export requested so far: the running one stops before its next frame and releases its encoders, and queued ones never start.

capture(frame) renders one frame at the sequence size and reads its pixels back as BGRA. It is the web counterpart of the CPU-buffer output destination.

gradingPreviews(request) draws grading nodes of one clip for an editor’s Color workspace, as the native editor does. The engine compiles that clip alone from the given document, so overlaps and transitions cannot split it, and prepares each node’s preview output in turn for a canvas of its own at the requested width. Each picture is read back as RGBA, and its waveform, RGB parade, vectorscope, and histogram are computed in wasm by videdit-scopes, the native editor’s own scope code. The preview canvas, playback, and export are untouched, and decoding is shared, so the document may read only sources the loaded one reads. It is refused during playback. Only the newest request counts: the worker notes each one as it arrives, and an older one answers null before it starts or between two nodes. Qualifier and window nodes show their mask in gray, as natively.

OpenEXR sequence export

Foxberry’s EXR export reads back scene-linear half-float frames and encodes them with the shared codec in the engine Worker. It bypasses the display transform, canvas movie encoding and audio. The host writes each compressed frame to a new local folder before requesting the next. This is separate from the decode Worker pool. See OpenEXR sources and export for supported formats, sequence caching, window handling and native/web verification coverage.

Not yet built

  • The operations beyond those listed above, including keys, mask combination and refinement, RGB and hue curves, scopes as a graph operation, corner pin, and temporal operations.
  • Decoded colors outside 0–1 on Chrome’s software decode path, which clamps them on import, where macOS keeps them in linear float until a grade or output conversion.
  • Pitch-preserving retiming, and audio channel counts other than 1, 2, 6, and 8.
  • HDR and non-BT.709 sources, and YUV and 10-bit surfaces. On Chrome for macOS they need decoded values the browser does not provide (see Phone footage); a browser that can copy a decoded 10-bit frame’s planes would allow converting them with the macOS backend’s matrices and transfer functions. Export is 8-bit SDR only, so HEVC Main 10, HDR10, and ProRes need the native backend.
  • Decoding codecs other than H.264 is refused. HEVC cannot render exactly on Chrome for macOS; AV1 and VP9 are unmeasured.
  • Exact rational timestamps from the container’s time base, in place of the half-microsecond boundary rule.
  • One asset shown at two different times in the same frame, for example in a transition between two cuts of one clip, shares one decoder, which then restarts from a key frame every frame.
  • Removing media: files added with setMedia stay open until replaced.