Menu

How I built a video editor that never uploads your video (canvas + MediaRecorder)
📰

How I built a video editor that never uploads your video (canvas + MediaRecorder)

DEV Community: webdev·Mark Jhon Pasamon·about 11 hours ago
#jaf56tu7
#devtowebdev#devto#dev#stream#reverse
Long article (593 words) — no AI summary yet.
Reading 0:00
15s threshold

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 .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.