惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
H
Help Net Security
Jina AI
Jina AI
V
V2EX
G
Google Developers Blog
B
Blog
GbyAI
GbyAI
U
Unit 42
爱范儿
爱范儿
腾讯CDC
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
小众软件
小众软件
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
博客园 - 聂微东
The Cloudflare Blog
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
大猫的无限游戏
大猫的无限游戏

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Introducing VidCompress: in-browser video compression for...
Terry Shine · 2026-06-04 · via DEV Community

I got tired of the same routine. You want to shrink a video, you search for a "free online compressor," and it makes you upload the whole file to a server, sit in a queue, and then hands it back with a watermark on it. On a slow connection, a 200 MB clip means uploading 200 MB and pulling it back down again, just to make the thing smaller. And now your footage is sitting on somebody else's machine.

So VidCompress does it backwards. If the file is under 300 MB, the compression runs in your browser and the video never gets uploaded anywhere. Here's roughly how that works, and the parts that still give us trouble.

WebCodecs does the heavy lifting

Browsers have shipped a low-level media API called WebCodecs for a while now — VideoEncoder and VideoDecoder. It hands JavaScript the hardware encoder more or less directly, which is the only reason any of this is possible. You decode the source into raw frames, re-encode them at a lower bitrate, and stuff the result back into an MP4. No server in the loop.

Roughly:

  1. Demux and decode the source with VideoDecoder.
  2. Re-encode the frames with VideoEncoder at a bitrate worked out from the size you're aiming for.
  3. Mux the new chunks into an MP4.

When the OS exposes a hardware encoder — most do these days — this is usually quicker than the upload would have been. And it's private for the obvious reason that nothing leaves your machine.

The annoying part is knowing when it won't work

WebCodecs is great until it isn't. Support is uneven across Chrome, Safari and Firefox. Some files just won't decode — older codecs, odd color spaces. And a long 4K video will happily eat all your memory halfway through the encode.

So most of the real work went into failing gracefully, not the happy path. We sort the failures into a few buckets:

  • LOCAL_OOM — ran out of memory mid-encode.
  • UNSUPPORTED_CODEC — the browser can't decode this input.
  • NO_HARDWARE_PATH — no fast local route on this browser at all.

When one of those fires you don't get a cryptic error. The job quietly retries on a server-side FFmpeg path (CRF-based) instead. Anything over 300 MB skips the browser entirely and goes straight there.

That split — local first, cloud only when it has to be — is basically the product. Phone clips, screen recordings, Discord gameplay captures: small enough to stay on your device and finish in seconds. The occasional giant 4K master still works, it just takes the slower road.

You pick a size, not a "quality"

Nobody opening a compressor is thinking in CRF or bitrate ladders. They're thinking "it has to fit Discord" or "it has to go through email." So we work backwards from the target size instead of asking people to guess a quality slider:

target_bitrate ≈ (target_size_bytes * 8) / duration_seconds - audio_bitrate

Enter fullscreen mode Exit fullscreen mode

The presets are just the limits people actually run into:

Destination Limit Preset target
Discord (no Nitro) 10 MB under 10 MB
WhatsApp 16 MB under 16 MB
Email (Gmail / Outlook) 25 MB under 25 MB
Social / Telegram ~50 MB

If you don't care about a specific app, the plain video compressor just lets you type a number of MB. Either way the job is the same: hit the size, and spend whatever bitrate is left where your eyes will actually notice, so you don't lose quality you'd care about.

Where it still falls down

A few things I'd rather just say out loud:

  • Long 4K on a cheaper laptop or a phone will OOM. It's the number-one reason a job ends up on the cloud path.
  • Safari trails Chromium on WebCodecs, so the local route shows up more often in Chrome and Edge.
  • Multiple audio tracks or unusual audio codecs get punted to the server too.

If you want to twist every knob yourself and you're sat at a desk, HandBrake is honestly still the better tool — I wrote down where we differ from HandBrake if you're weighing it. You're trading an install and a learning curve for "drop a file in a tab, get it back smaller."

So why do the browser thing at all

Mostly privacy. A pre-launch demo, something medical, a private clip — it just never goes anywhere. Speed is the other reason: no upload, no queue, so short clips are done almost instantly. And because there's no server bill on the local path, there's nothing to lock behind a signup or stamp a watermark on.

If you've ever bailed on a compressor because it wanted to upload your file, make you wait, then watermark it — give this one a try. Under 300 MB it stays in your browser. No account, no watermark.