Getting Started

Introduction

In-browser clip making. Trim a video, crop it to 9:16, burn in captions, add an end card and export an MP4, all on the device.
Experimental. Splice is not published to npm yet and the API will change. It lives on the feat/splice branch.

@munsonlabs/splice turns the video someone is watching into a short clip they can share, without a server. It trims a range, crops it to 9:16 (or any aspect), burns the captions into the picture, stamps your logo in a corner, adds an end card that sends viewers back to the article, and writes an MP4, all with WebCodecs on the viewer's device. Mediabunny reads and writes the containers; splice adds the cropping, captions, overlays and output planning.

import { canSplice, createSplice } from '@munsonlabs/splice'

const check = await canSplice(src)
if (check.ok) {
  const clip = await createSplice({
    source: src,
    start: 42,
    end: 52,
    crop: { aspect: '9:16' },
    captions: '/video/interview.en.vtt',
    origin: {
      url: location.href,
      title: document.title,
      publisher: 'Example News',
    },
    endCard: {},
  })
}

Try it

Press the scissors in the player, pick a range, drag the crop window over the picture to reframe, then export and play or download the clip. Nothing leaves your browser. The player has deep-link on, so the clip's link reopens this page at that moment, looping the range.

Loading…

What you get

EntryWhat it is
@munsonlabs/splicecreateSplice, canSplice, createThumbnails, createClipLink and planOutput
@munsonlabs/splice/vueSpliceEditor, a ready-made inline "clip this" editor in Vue, on the page's video-player
@munsonlabs/splice/element<ml-splice-editor>, the same editor as a custom element, for pages without Vue
@munsonlabs/splice/styleThe editor's stylesheet

Mediabunny is about 157 KB gzipped, so splice is built to load late: the editor imports the core when it first opens. The core is framework-free; the editor needs Vue and @munsonlabs/video-player, which most pages that clip already have.

Where to start

Getting started

Install, check a source, make a first clip.

createSplice

Every option, and what the output looks like.

The editor

SpliceEditor and <ml-splice-editor>: a whole "clip this" editor, inline on the page's video-player.

Browser support

What Chromium, WebKit and Firefox can encode, and the workarounds.
munsonlabs · MIT licensed · © 2026