The Complete Video Compression Guide: Shrink 1GB to 100MB with Near-Lossless Quality

前端工程

You Recorded a Video but Can't Send It

A product demo, a kid's recital, a speech at a meeting—recorded and it's 2GB. WeChat says "file too large," email rejects the attachment, the cloud upload bar looks asleep.

Video just eats space. A photo is a few MB; a 30-second clip is easily 100MB+, because it's essentially "hundreds of thousands of images plus audio." In the years we've built the video tools, the most common plea is "make it smaller, but don't blur it." This article explains where video size comes from and how to shrink it—read it and you'll not only compress, but understand why it works.


First: Container and Codec Are Not the Same Thing

Beginners most confuse .mp4, .mov, .mkv with H.264, H.265. Remember:

  • Container: .mp4 / .mov / .mkv is the "box" that decides how video, audio, and subtitles are packaged.
  • Codec: the algorithm that compressed the data inside—H.264, H.265/HEVC, VP9, AV1.

The same .mp4 box can hold H.264 or H.265. Size is mostly about the codec, not the container. iPhone .mov often uses H.265, so same duration is much smaller than Android .mp4(H.264)—that's why many feel "Apple videos take less space."


Where Video Size Really Comes From

Four factors stack up:

  • Resolution: 4K (3840×2160) has 4× the pixels of 1080p, ~9× of 720p. More pixels, fatter data.
  • Bitrate: data per second—the biggest knob on size.
  • Codec: H.264 is the compatibility king; H.265/HEVC ~half the size but some old devices choke; AV1 is smaller but slow to encode.
  • Frame rate & audio bitrate: 60fps is twice the data of 30fps; audio at 320kbps takes more than 128kbps.

Same content, parameters differ by 10×:

Config Approx size (60s clip)
4K + H.264 + high bitrate ~380 MB
1080p + H.264 + mid bitrate ~90 MB
720p + H.265 + mid bitrate ~35 MB
720p + H.264 + low bitrate ~22 MB

Estimates for typical scenes; actual depends on complexity—static frames (a meeting slide) compress hard, fast motion (a match) barely.


The Four Real Levers That Shrink It

1. Lower resolution: fastest effect

1080p → 720p cuts pixel count by more than half, size often drops by more than half too. On a phone screen, barely noticeable. Unless you're projecting to a big TV or doing post-editing, 720p is enough for feed/group chat.

2. Adjust bitrate / CRF: the finest knob

Transcoders show CRF (Constant Rate Factor). Remember: higher CRF = smaller + slightly lower quality. Common range 18–28:

  • 18–20: nearly identical, larger (good for master archive)
  • 23–24: default sweet spot (visually near-identical)
  • 26–28: clearly smaller, slight quality drop, fine on phones

CRF is "set quality, derive bitrate"—a form of VBR: complex frames get more bits, simple frames fewer, most space-efficient at the same quality. The opposite, CBR (constant bitrate), wastes bits on simple frames—not recommended for compression.

3. Switch codec: H.265 ~40%–50% smaller than H.264

Same quality, H.265 is smaller. Cost is compatibility—old TVs, some car head units, some editors won't open it. Use H.264 for universal sharing; H.265 only within your own ecosystem.

Codecs also have "Profiles"; for H.264:

Profile Capability Use
Baseline Simplest, max compatibility Very old devices, real-time comms
Main Medium SD streaming
High Best compression HD, Blu-ray (preferred)

4. Cut junk + lower audio bitrate

10s black intro, 20s idle outro—cutting them is real savings. Audio at 128kbps is plenty for voice; don't pad with 320kbps.


Target Size Reference

Situation Suggested action Approx result
1080p 1GB demo → 720p + CRF 24 ~350 MB
4K phone recording 2GB → 1080p + H.265 ~400 MB
500MB clip for WeChat → 720p + CRF 26 ~120 MB
Email 25MB limit → 480p + cut junk ~20 MB

Actual platform limits (vary): WeChat ~1GB per file (chat), 200MB (moments); email ~20–25MB; most clouds 4GB per file. Decide params by "where it's going."


Compress Locally in the Browser

Video Compress lets you drag sliders for resolution and CRF; the browser transcodes locally via ffmpeg.wasm—no upload, data gone when you close the tab.

Handy companions:

  • Video Convert: MP4/WebM/MKV interconversion
  • Video to MP4: best compatibility (especially iPhone MOV → MP4)
  • Video Trim: cut intro/outro before compressing, twice the result

A real workflow: send a product demo via WeChat

iPhone MOV (H.265, 1.2GB)
  → /video/to-mp4 to H.264 MP4 (Android/Win compatible)
  → /video/trim cut 8s black intro + idle outro
  → /video/compress to 720p + CRF 26
  → output ~110MB, sends instantly on WeChat

When Local Compression Isn't Enough

The browser is limited by memory and performance. In these cases use desktop ffmpeg:

  • Single file several GB+
  • Batch dozens of files
  • Extreme speed requirement (WASM is much slower than native)

With ffmpeg installed, these commands cover most scenarios.

Basic: downscale + H.265 + audio

# to 720p, H.265, CRF 28, audio 128kbps
ffmpeg -i input.mp4 \
  -vf scale=1280:-2 \
  -c:v libx265 -crf 28 \
  -c:a aac -b:a 128k \
  output.mp4

Breakdown:

  • scale=1280:-2: width 1280, height auto (-2 ensures even number, required by encoder)
  • libx265 -crf 28: H.265, CRF 28
  • -c:a aac -b:a 128k: AAC audio, 128kbps

For max compatibility use -c:v libx264; for more aggressive compression push CRF to ~30 (quality drops more visibly).

Two-pass (target a specific size)

# pass 1: analyze, no output frames
ffmpeg -i input.mp4 -c:v libx265 -b:v 800k -pass 1 -f mp4 /dev/null
# pass 2: precise compress by analysis
ffmpeg -i input.mp4 -c:v libx265 -b:v 800k -pass 2 -c:a aac -b:a 128k output.mp4

Two-pass fits "I have a clear target size," more controllable than single-pass CRF, but twice as slow.

Cut a segment only (no re-encode, super fast)

# from 00:00:10, duration 30s, no re-encode (-c copy)
ffmpeg -i input.mp4 -ss 00:00:10 -t 00:00:30 -c copy clip.mp4

-c copy finishes almost instantly but cut points aren't precise (snaps to keyframes). For precision drop -c copy (re-encodes, slightly slower).

Hardware acceleration (NVIDIA / Intel)

# NVIDIA GPU: NVENC hardcode, much faster
ffmpeg -i input.mp4 -c:v hevc_nvenc -rc vbr -cq 28 -c:a aac -b:a 128k output.mp4

Hardware encode is fast but slightly less efficient than software (CPU) encode—plenty for sharing.


On "Quality": How to Tell If the Compression Was Worth It

Don't trust file size alone. A simple self-check:

  1. Watch key segments fullscreen/large after compressing (motion, text, faces).
  2. Zoom in—check edges for block artifacts (mosaic) and text for fuzz.
  3. Compare to the original; find where quality visibly drops.

If you can't see the difference, the compression was worth it. Once CRF exceeds 30 or resolution drops too much, text and fast motion will show.


Common Mistakes

Mistake Consequence Fix
Re-compress the same file repeatedly Quality drops layer by layer Compress once from the original
CRF 35+ Big mosaic, color blocks Keep 18–28
Send H.265 to old device Recipient can't open H.264 for sharing
Compress but don't trim Intro junk still takes space Trim first /en/video/trim
Leave audio bitrate alone Can't save much Drop to 128kbps
Send MOV directly to Android/Win May not open Convert to MP4 /en/video/to-mp4

FAQ

H.264 or H.265? For others, cross-device, fear of "won't open" → H.264. Only within your Apple/modern devices, want to save space → H.265.

Can I restore original quality after compressing? No. Compression is lossy; the information is gone. Always keep the original; don't delete it.

Can I compress on a phone browser? Yes. Our video tools are web pages; mobile browsers do local transcoding too, just slower than a computer for big files.

Why didn't my size drop much? Likely resolution didn't drop, or CRF too low. Move the resolution knob first—its effect is more直观 than bitrate.

GIF or video? Short clip for a group—GIF is convenient but huge; short video (MP4/H.265) is 10× smaller and clearer. Send video, not GIF.


One-Line Decision

Video too big to send?
├── Quick shrink, keep quality → /video/compress (resolution + CRF)
├── iPhone MOV → /video/to-mp4
├── Only need a segment → /video/trim then compress
├── Switch to H.265 → /video/convert
└── Single file several GB / batch dozens → desktop ffmpeg (see commands above)

Next time you record an un-sendable monster, follow the branch above and get a small, clear version in minutes. To grab a frame as a cover from the compressed MP4, use video frame extractor.

Try these browser-local tools — no sign-up required →

#视频压缩#视频格式转换#H.264#H.265#CRF#本地处理