Most free online video tools upload your file to a server, process it, and send it back — with a watermark or a length limit on the free plan. I wanted crop, blur, loop, reverse and split for ToolsKo without any upload, so everything had to run in the browser. Here's the approach, what worked, and the trade-offs.
The idea: play it, draw it, record it
The browser already has everything needed:
a hidden <video> element plays the file,
each frame is drawn onto a <canvas> with the change applied (crop, colour filter, blur box…),
canvas.captureStream() turns the canvas into a live video stream, and
MediaRecorder records that stream into a file.
const stream = canvas . captureStream ( 30 ) ; // add the (optional) audio track from Web Audio for ( const t of audioDest . stream . getAudioTracks ( ) ) stream . addTrack ( t ) ; const rec = new MediaRecorder ( stream , { mimeType , videoBitsPerSecond : 5_000_000 } ) ; rec . ondataavailable = ( e ) => e . data . size && chunks . push ( e . data ) ; rec .…