Browser support
Splice needs WebCodecs, OffscreenCanvas and a secure context: current Chrome, Edge, Safari and Firefox.
Encoders
Clips are always MP4 with H.264 video and AAC audio, so those are the two encoders that matter.
| Encoder | Chromium | WebKit | Firefox |
|---|---|---|---|
| H.264 at 1080x1920 | yes | yes | yes |
| AAC | yes | yes | no |
canSplice checks the H.264 encoder at the clip's size, and its plan.audio says what happens to the sound.
Output by engine
| Source | Chromium | WebKit | Firefox |
|---|---|---|---|
| AAC audio (most MP4s, HLS) | MP4, AAC copied | MP4, AAC copied | MP4, AAC copied (no encoder needed) |
| Opus or other audio | MP4, AAC encoded | MP4, AAC encoded | MP4, silent, with a warning |
| Rotated phone video | upright | upright | upright |
AAC is copied packet for packet, which is what keeps sound in Firefox clips of AAC sources.
HLS
Splice reads HLS itself in every engine, through Mediabunny: the master playlist, then only the variant and segments it needs. Variants are described by their playlist entries, so checking a stream reads playlists only, and a variant this browser can't decode is ruled out by its playlist codec before anything is downloaded.
| Job | Variant read |
|---|---|
canSplice | None: playlists only |
createThumbnails | The smallest at least as big as a thumbnail |
createSplice | The smallest that covers the output after the crop |
Playback in the editor is the player's: native in Safari, through hls.js elsewhere.
Workarounds
WebKit crop. drawImage(VideoFrame, sx, sy, sw, sh, …) ignores the source rectangle in WebKit and draws the whole frame, so a crop done that way comes out uncropped and squashed. Splice draws the whole frame offset and scaled instead, which is correct everywhere.
Firefox AAC. No AAC encoder, so AAC sources are copied rather than re-encoded, and other sources are clipped without sound.
A stalled encoder. Some H.264 encoders take frames and never output or error: macOS's hardware encoder when it's busy, and Safari in the iOS Simulator, which does that for every clip in H.264's High profile but encodes Baseline fine. If the encoder holds frames without producing anything for 15 seconds while splice waits on it, the encoder is closed and the clip is made again in the Baseline profile. Only if that stalls too does the clip reject with a clear error, and trying again usually works.