Skip to content
ع
Web Development

Video Compression for the Web and Social Media: Smaller Files Without Losing Quality

Video is the heaviest thing on your page and in your messages. A few right decisions can shrink it a lot without viewers noticing.

Ahmad Khreiswebmaster5.0(2)
Published Updated 10 min read
Illustration for the article: Video Compression for Websites and Social Media: Formats, Resolution and Bitrate

Video compression means shrinking a file while keeping quality viewers accept. Video is usually the heaviest element on your page, the first cause of slow mobile loading and the main obstacle to sending it by email or WhatsApp. The good news is that a few right decisions cut size a lot without anyone noticing. You can apply them straight away in the Video Compressor.

Key takeaways

  1. 1Resolution is the biggest size decision: don't upload 4K for a phone screen.
  2. 2CRF controls the balance between quality and size; a sensible H.264 range is roughly 17 to 28.
  3. 3MP4 with H.264 video and AAC audio is the most compatible choice.
  4. 4Give platforms a clean upload at their recommended dimensions, since they compress again.

What determines video file size?

File size is roughly bitrate multiplied by duration. Bitrate depends on three things: pixel count (resolution), frames per second and codec efficiency. So a video's journey from camera to page passes through stages, each cutting size:

A video's journey from camera to page

  1. The original footage

    High resolution and bitrate, made for editing

  2. Trim the extras

    Fewer seconds means a smaller file straight away

  3. Lower the resolution

    To the largest size it will actually be shown at

  4. Compress with a sensible CRF

    Constant quality at the smallest size

An illustration of the idea: every step cuts size, and together they're the difference between a slow page and a fast one.

Before compressing, trim the extra start and end with the Video Trimmer and change dimensions with the Video Resizer.

How do you choose a CRF value?

The best compression approach in most cases is "constant quality" via CRF: you set the quality level and the encoder picks the right bitrate for each scene. For H.264 the scale runs from 0 to 51:

The CRF scale in H.264 (x264)

Near-original qualitySensible rangeLow qualityDefault 23
1728
  • Near-original qualityVery large files, for archiving and editing
  • Sensible rangeFor web and social; lower for detailed footage
  • Low qualityArtefacts become clearly visible
Lower values mean higher quality and bigger files. Raising it by about 6 roughly halves the size, with a drop in quality.Source: FFmpeg H.264 encoding guide

Start with the default of 23. If fast scenes show artefacts, lower it slightly; if the file is still too big, raise it a step or two and compare.

Practical settings by use

Every place a video is shown has different needs. These are good starting points:

UseResolutionNotes
Silent background on a website720p or lowerRemove the audio; keep it short and looping
Intro video on a service page1080pMP4 with H.264, plus a light poster image
Stories and Reels1080×1920 verticalUpload a clean version and let the platform compress
Sending by WhatsApp or email720pShorten it first, then compress

For a thumbnail, extract one with the Video Thumbnail tool, and for audio only use the Video to MP3 converter.

Video and page speed

A heavy video at the top of a page delays content and hurts performance metrics. So:

Conclusion

Good video compression comes down to three decisions: a resolution that fits where it's shown, a CRF in the sensible range, and MP4 with H.264 for broad compatibility. Trim first, give platforms a clean upload and delay video loading on your pages. To understand formats and codecs more deeply, read our video formats guide. If you'd like a fast website that shows video without slowing down, see our website development service.

Frequently asked questions

What CRF value should I use?

For H.264 (x264) the scale runs from 0 to 51, the default is 23, and a sensible range is roughly 17 to 28. Lower means higher quality and a bigger file.

What's the best video format for websites?

MP4 with H.264 video and AAC audio is the most compatible; you can add a WebM or AV1 version for modern browsers to cut size further.

Does lowering resolution reduce size much?

Yes, going from 4K to 1080p or from 1080p to 720p cuts the pixel count a lot, and it's often the most effective size decision when the video will be shown on a small screen.

Why do platforms re-compress my video?

They re-encode every upload to standardise streaming. Upload a clean, good-quality version at the platform's recommended dimensions so quality loss doesn't stack up.

Sources & references

  1. web.dev — Video performance
  2. MDN — Web video codec guide
  3. YouTube Help — Recommended upload encoding settings
Ahmad Khreis

About the author

webmaster

I believe technology is useful when it solves a clear problem — not when it's adopted because it's trendy. AI is a powerful tool for speeding up research, writing, analysis and automation, but it needs human expertise to review, guide and verify accuracy. That's why I prefer to start by understanding the business and its goals, then choose the simplest solution that delivers a measurable result, and build audience trust with honest, useful content.

Reader rating
5.0(2)
Published articles
82
  • #video
  • #compression
  • #performance
  • #social media
Share

How would you rate this article?

5.0 / 5 · 1 rating

Comments

No comments yet. Share your thoughts!

Leave a comment

Related articles