CapsAI

Ai tools

How to Compress a Video Without Losing Quality

Shrink a video without visible quality loss: HandBrake constant quality RF values by resolution, an FFmpeg CRF command, iPhone HEVC, and mistakes to avoid.

How to Compress a Video Without Losing Quality
In this article5 min read

Re-encode the video with a modern codec (H.264 or H.265) in constant quality mode, keep the resolution and frame rate the same, and pick a quality setting just below where you start to see a difference. HandBrake and FFmpeg both do this for free. "Without losing quality" really means without a loss you can see: every re-encode throws away some data, so the goal is to throw away the parts your eye does not notice.

This guide covers why video files get so big, the two free tools that do this well, the settings that matter, and the mistakes that make a compressed video look worse than it needs to.

Why video files are big in the first place

A video's size is mostly its bitrate (how much data it uses per second) multiplied by its length. Phones and cameras record at a high bitrate so there is room to edit later, which is why a two-minute clip can be several hundred megabytes. Compression lowers the bitrate, and a good encoder spends the data where it matters: fast motion and fine detail get more, a still background gets less.

Three things decide how small you can go before it shows:

  • The codec. H.265 (also called HEVC) stores the same picture in less space than H.264, but some older devices and editors play it less smoothly. H.264 plays almost everywhere.
  • The resolution. A 4K file shrunk to 1080p loses a lot of size. If the video will only ever be watched on a phone in a vertical feed, 1080 by 1920 is usually enough.
  • The content. Talking-head videos compress far better than gaming footage, confetti or shaky handheld shots.

Method 1: HandBrake (free, Windows, macOS and Linux)

HandBrake is a free, open-source video converter with a graphical interface, and its documentation is clear about the setting that matters most: "Always use constant quality unless you have a specific reason not to." Constant quality keeps the picture steady and lets the file size follow, rather than forcing a size and letting the picture suffer.

  1. Open HandBrake and drop your video in.
  2. Pick a preset that matches the source, for example a 1080p preset for a 1080p video. Do not pick a higher resolution than the source.
  3. On the Video tab, choose H.264 or H.265 and leave Constant Quality selected.
  4. Set the RF value from HandBrake's recommendations in the table below. For x264 and x265, a lower RF means higher quality and a bigger file.
  5. Choose where to save it and press Start.
ResolutionRecommended RF
480p or 576p18-22
720p19-23
1080p20-24
4K (2160p)22-28

Start in the middle of the range for your resolution, then watch the result full screen on the device your audience uses. If it looks the same as the original, try a slightly higher RF for a smaller file; if you see smearing in dark areas or blocky motion, go lower. HandBrake's own warning is worth keeping in mind: "Drastically lower settings may show significant loss of detail."

Method 2: FFmpeg (free, command line)

FFmpeg is the command-line tool many video apps use under the hood. It is faster to repeat once you know the command, and it is easy to run on a whole folder. Its x264 and x265 encoders have the same idea as HandBrake's RF, called CRF: the documentation describes it as setting "the quality for constant quality mode", and again a lower number is higher quality.

A typical command for a 1080p video:

ffmpeg -i input.mp4 -c:v libx264 -crf 22 -preset slow -c:a aac -b:a 128k output.mp4

  • -c:v libx264 encodes the video as H.264. Use libx265 for H.265.
  • -crf 22 sets the quality. Try values in the same ranges HandBrake recommends for your resolution.
  • -preset slow tells the encoder to take more time to find savings. Slower presets usually give a smaller file at the same quality; medium is quicker.
  • -c:a aac -b:a 128k re-encodes the sound at a size that suits speech and most music.

If you need to hit an exact file size (an upload limit, for example), constant quality cannot promise one. In that case pick a target bitrate instead and use a two-pass encode, which both HandBrake and FFmpeg support.

Record smaller on iPhone in the first place

If you film on an iPhone, check the camera format before you shoot. Apple's support page says HEIF and HEVC "offer better compression than JPEG and H.264", so the same video takes less storage. The setting is in Settings, Camera, Formats: High Efficiency records HEVC, and Most Compatible records H.264. The option only appears on models that can record HEVC. If an editor or website struggles with your files, Most Compatible is the safer choice; otherwise High Efficiency saves space before you compress anything.

Mistakes that make compressed video look worse

  • Compressing a file that was already compressed. Every pass loses a little more. Always start from the original recording or the editor's export, not from a copy you downloaded from a social platform.
  • Scaling up. Turning 720p into 1080p makes the file bigger without adding any detail.
  • Changing the frame rate for no reason. Keep the source frame rate unless it is higher than you need.
  • Judging on a small preview. Check the result full screen, on the kind of screen your viewers use.
  • Squeezing the audio too hard. Speech becomes harsh at very low audio bitrates, which is worse than a slightly bigger file.

Compressing before you add captions

Caption tools and social platforms have upload limits, and a smaller file also uploads faster on a mobile connection. CapsAI, for example, takes MP4 or MOV videos up to 10 minutes long, with files up to 500 MB on the free minutes and up to 10 GB with a pack. A long 4K recording can pass 500 MB, so a 1080p HandBrake encode at RF 20-22 is a simple way to get it under the limit without a visible change.

CapsAI does not compress video itself. It transcribes the speech in 11 spoken languages, including Hinglish, lets you edit every word and style, and exports one MP4 with the captions burned in. You get 3 free minutes to start, and one-time packs start at $2 (₹49 in India). If you want the steps for that part, see how to add subtitles to a video.

If a platform still rejects your upload after compressing, the cause is often something other than size; the Shorts upload issues guide and the Reels upload errors guide cover the usual ones.

Published 1 Jul 2025Updated 9 Nov 2026

Frequently asked questions

Can you compress a video without losing any quality?

Not literally: every lossy re-encode discards some data. What you can do is compress without a loss you can see, by re-encoding in constant quality mode with H.264 or H.265, keeping the resolution and frame rate, and choosing a quality value just below where differences start to show.

What RF value should I use in HandBrake?

HandBrake's documentation recommends RF 18-22 for 480p or 576p, 19-23 for 720p, 20-24 for 1080p and 22-28 for 4K, for the x264 and x265 encoders. A lower RF gives higher quality and a bigger file. Start in the middle of the range and adjust after watching the result full screen.

Is H.265 better than H.264 for smaller files?

H.265 (HEVC) stores the same picture in less space than H.264, which is why Apple uses it for its High Efficiency camera format. H.264 plays on more devices and editors, so it is the safer choice when you are not sure where the file will be played.

How do I make a video file exactly a certain size?

Constant quality cannot promise an exact size. Choose a target bitrate instead and encode in two passes, which HandBrake and FFmpeg both support. Work out the bitrate from the size you need divided by the video's length, leaving room for the audio.

Does CapsAI compress videos?

No. CapsAI adds captions: it takes MP4 or MOV videos up to 10 minutes, with files up to 500 MB on the free minutes or 10 GB with a pack, and exports one MP4 with the captions burned in. If your file is over the limit, compress it first with HandBrake or FFmpeg.

New in CapsAI

Captions that know where your face is

CapsAI now finds the faces in your video while it writes the captions. Captions and GIFs keep clear of the speaker, and three styles follow the speaker around the frame.

Related CapsAI tools

Try CapsAI

Add captions to your videos

Upload a video, review the generated captions, and export. No sign-up needed to try. Free for a video up to 3 minutes.

Caption a video