How to Compress a Video Without Losing Quality (2026)

To compress a video without visible quality loss, re-encode the original once with a quality-based setting instead of a fixed bitrate: H.264 at CRF 18-22 in FFmpeg (HandBrake suggests RF 20-24 for 1080p), keep the source frame rate, lower the resolution only if the destination doesn't need it, and use AAC audio. "Without losing quality" means visually lossless, not mathematically lossless.
This guide covers settings by goal, HandBrake and FFmpeg steps, and a size-cap formula. For CBR, VBR and platform bitrate tables, read Video Bitrate Explained; for codecs and containers, Video Codecs Explained.
Facts checked October 20, 2026 against HandBrake, FFmpeg, x265 and SVT-AV1 documentation, YouTube Help, Gmail Help and Vimeo Help (see Sources). FFmpeg commands were syntax-checked with FFmpeg 9.0.1. Full disclosure: Loopdesk is our product; it comes up once.
What does "compress without losing quality" actually mean?
It means visually lossless: the smaller file looks the same as the original at normal viewing, even though data was discarded. H.264, H.265 and AV1 are lossy. FFmpeg's H.264 guide says to "Consider 17 or 18 to be visually lossless or nearly so; it should look the same or nearly the same as the input but it isn't technically lossless."
- Compress once, from the best source, never from a file you already compressed.
- You can't add quality back. More bitrate on a compressed file only makes it bigger.
- Judge on the hardest footage: fast motion, dark gradients and foliage break first.
Which settings make a video file smaller?
Six settings decide file size: codec, rate control, encoder preset, resolution, frame rate and audio bitrate. Two-pass encoding doesn't shrink files at the same quality; it lands you on a specific size. The bitrate glossary entry defines the number they all feed into.
| Setting | Effect | Use it when |
|---|---|---|
| Codec | H.265 and AV1 can match H.264's quality at a lower bitrate; savings vary | The viewer's player supports it |
| Rate control (CRF) | You pick a quality; the encoder spends bits where scenes need them | Almost always |
| Encoder preset | x265's docs describe presets as "trading off compression efficiency against encoding speed" | You can wait longer for a smaller file |
| Resolution | 1080p has a quarter of 4K's pixels | The file plays small, as in email or chat |
| Frame rate | 30 fps encodes half the frames of 60 fps | Size-capped sharing only |
| Audio bitrate | A small share of most files | Tight size caps |
| Two-pass | Analyzes the video, then encodes to an average bitrate | You must hit a size |
FFmpeg's guide notes that raising x264's CRF by about 6 roughly halves the bitrate.
Should you use H.264, H.265 or AV1?
Use H.264 in an MP4 for anything people download or play on unknown devices, because it plays almost everywhere. Use H.265 (HEVC) or AV1 when you control playback; both can match H.264's quality at a lower bitrate, but support and encode speed vary.
| Codec | Pick it for | Watch out for |
|---|---|---|
| H.264 (x264) | Downloads, email, uploads | Bigger files than newer codecs |
| H.265 / HEVC (x265) | Apple devices, 4K files, personal libraries | Browser support and licensing vary |
| AV1 (SVT-AV1) | Web players you control, streaming | Safari needs an AV1 hardware decoder; software encoding is slow |
For downloads, ship H.264 and add an AV1 copy only when your player can fall back to H.264. Browser and GPU support is in AV1 for YouTube and the web and the video codec glossary entry.
What settings should you use for YouTube, email and archives?
Uploads should be generous because the platform compresses again; email files need a size target; archives keep the original. Treat these as starting points.
| Goal | Codec | Quality setting | Resolution and fps | Audio |
|---|---|---|---|---|
| YouTube or Vimeo upload | H.264, MP4 | CRF 17-18, or HandBrake RF 18-20 | Same as source | AAC-LC, 48 kHz; YouTube recommends 384 kbps stereo |
| Download from your site | H.264, MP4, fast start | CRF 20-23 or RF 20-22 | 1080p, source fps | AAC, 128-160 kbps |
| Email (Gmail: 25 MB) or chat | H.264, MP4 | Two-pass bitrate from the formula below, or a HandBrake 25 MB preset | 720p or lower, 30 fps | AAC, 96-128 kbps |
| Smaller personal copies | H.265 or AV1, MP4 | x265 CRF 22-24; SVT-AV1 CRF 25-30 | Same as source | Copy, or AAC 160 kbps+ |
| Master or archive | Camera original or export master; ProRes for mastering | Don't compress the only copy | Same as source | Same as source |
For each platform's length and size limits, use the platform spec guide.
How do you compress a video with HandBrake?
HandBrake is a free, open-source converter for macOS, Windows and Linux (version 1.11.2 on its download page on October 20, 2026). It uses the x264, x265 and SVT-AV1 encoders.
- Open the source. Click Open Source and pick the original.
- Pick a preset. HandBrake calls "Fast 1080p30" a good default. For uploads, try "Creator 1080p60"; for size caps, a 25 MB preset such as "Email 25 MB 3 Minutes 720p30".
- Summary tab. Choose MP4. Tick Web Optimized only for files that play from your own site; Vimeo's guide says to leave it unchecked for Vimeo uploads.
- Dimensions tab. Lower the size only for email or chat.
- Video tab. Pick H.264 (x264), H.265 (x265) or SVT-AV1, with the frame rate at "Same as source". For Constant Quality, HandBrake suggests RF 20-24 at 1080p, 19-23 at 720p and 22-28 at 4K (x264 and x265), and 25-35 at 1080p for SVT-AV1. Lower RF means higher quality.
- For a size cap, switch to Avg Bitrate, enter the kbps from the formula below and turn on multi-pass encoding, which HandBrake recommends when you target a bitrate.
- Audio tab. AAC at 160 kbps for most files; 96-128 kbps for email.
- Preview, then Start. Compare a fast-motion section with the original.
Apple VideoToolbox, the Mac hardware encoder, reverses the scale (higher means better, per HandBrake), so don't copy RF values between encoders.
How do you compress a video with FFmpeg?
Each command reads input.mov and writes a new file, leaving the original untouched. On Windows, replace /dev/null with NUL.
Compress with H.264 and constant quality
ffmpeg -i input.mov -c:v libx264 -crf 20 -preset slow -pix_fmt yuv420p -c:a aac -b:a 160k -movflags +faststart output.mp4
| Flag | What it does |
|---|---|
-c:v libx264 | Encodes with x264 (H.264) |
-crf 20 | Constant quality; lower is better. x264's default is 23 |
-preset slow | Slower encode, smaller file at the same CRF; the default is medium |
-pix_fmt yuv420p | 8-bit 4:2:0 color, which YouTube asks for |
-c:a aac -b:a 160k | AAC audio at 160 kbps; -c:a copy keeps the original audio |
-movflags +faststart | Moves the MP4 index ("moov atom") to the front so playback can start sooner |
Make a smaller file with H.265 or AV1
ffmpeg -i input.mov -c:v libx265 -crf 24 -preset medium -tag:v hvc1 -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart output-hevc.mp4
ffmpeg -i input.mov -c:v libsvtav1 -crf 30 -preset 6 -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart output-av1.mp4
x265's default CRF is 28, so 24 aims higher. -tag:v hvc1 labels the HEVC track as Apple's HLS authoring specification recommends. SVT-AV1's documentation calls CRF 30 "a good starting point for 1080p video" and presets 4-6 a reasonable trade-off; lower presets are slower and more efficient.
Lower the resolution and frame rate
ffmpeg -i input.mov -vf "scale=-2:720,fps=30" -c:v libx264 -crf 23 -preset medium -pix_fmt yuv420p -c:a aac -b:a 128k -movflags +faststart output-720p.mp4
scale=-2:720 sets a 720-pixel height and an even width that keeps the aspect ratio; fps=30 halves 60 fps footage. Use it for email, not uploads.
Hit a target file size with two passes
ffmpeg -y -i input.mov -c:v libx264 -b:v 950k -preset medium -pass 1 -an -f null /dev/null
ffmpeg -i input.mov -c:v libx264 -b:v 950k -preset medium -pass 2 -pix_fmt yuv420p -c:a aac -b:a 96k -movflags +faststart output-small.mp4
Pass 1 analyzes the video and writes a log; pass 2 encodes. If you downscale, add the same -vf to both passes.
Check the result
ffprobe -v error -show_entries format=duration,bit_rate:stream=codec_name,width,height,r_frame_rate -of compact output.mp4
ffmpeg -i output.mp4 -i input.mov -lavfi "[0:v][1:v]libvmaf" -f null -
The first line confirms codec, size, frame rate and real bitrate. The second (FFmpeg builds with libvmaf) scores the output against the original with VMAF, which Netflix calls "an Emmy-winning perceptual video quality assessment algorithm." Compare files of the same resolution and frame rate, and still watch the hardest section.
How do you work out the bitrate for a target file size?
Video bitrate in kbps is roughly the target size in MB times 8,000, divided by the duration in seconds, minus the audio bitrate, minus about 5% for container overhead. A 3-minute clip that must fit Gmail's 25 MB limit with 96 kbps audio gets about 950 kbps of video.
The arithmetic: 25 × 8,000 = 200,000 kilobits ÷ 180 seconds = 1,111 kbps; minus 96 = 1,015; minus 5% ≈ 960, rounded to 950k. Gmail's help page says larger attachments are automatically added as a Google Drive link, which is the no-compression alternative.
| Duration | Maximum total bitrate for 25 MB | HandBrake's matching preset |
|---|---|---|
| 30 seconds | 6,667 kbps | Social 25 MB 30 Seconds 1080p60 |
| 1 minute | 3,333 kbps | Social 25 MB 1 Minute 720p60 |
| 3 minutes | 1,111 kbps | Email 25 MB 3 Minutes 720p30 |
| 5 minutes | 667 kbps | Email 25 MB 5 Minutes 480p30 |
To estimate the size a given bitrate produces, use the file-size table in Video Bitrate Explained.
What happens when YouTube or another platform re-encodes your video?
Your upload becomes the source for the platform's own compression. YouTube says an upload "will initially be processed in low quality," with higher resolutions later; a 60-minute 4K video at 30 fps "can take up to 4 hours to finish high-resolution processing." Upload a high-quality file and let the platform compress once.
Vimeo's HandBrake guide shows how generous an upload can be: 10,000-20,000 kbps for 1080p, with 320 kbps audio. YouTube asks for MP4, H.264 High Profile, "Closed GOP," variable bitrate and 4:2:0 chroma.
So keep one master: upload it (or a lightly compressed H.264 copy) and compress a separate copy hard only for email or chat.
In Loopdesk: exports are unlimited and watermark-free at 1080p and 4K on every plan, with output for multiple platforms. Export the master there and compress only the size-capped copy. For browser 4K export, see Online AI Video Editors That Support 4K.
What are the most common compression mistakes?
The most common mistakes are compressing an already-compressed file, using one bitrate for every video, copying CRF values across encoders (x264 defaults to 23, x265 to 28), resizing uploads, and deleting the original.
- Stacked generations. Export, compress, upload and platform re-encode is three lossy passes. Cut one.
- Resizing uploads. YouTube says to upload "in the same frame rate it was recorded"; keep the source resolution too.
- Deleting the original. Keep the master even after the copy checks out.
Sources
Read and verified on October 20, 2026.
- HandBrake documentation: https://handbrake.fr/docs/en/latest/workflow/adjust-quality.html · https://handbrake.fr/docs/en/latest/technical/official-presets.html · https://handbrake.fr/docs/en/latest/technical/video-cq-vs-abr.html · https://handbrake.fr/docs/en/latest/introduction/quick-start.html · https://handbrake.fr/downloads.php
- FFmpeg Wiki, "H.264 Video Encoding Guide": https://trac.ffmpeg.org/wiki/Encode/H.264 · FFmpeg formats documentation (
faststart): https://ffmpeg.org/ffmpeg-formats.html - x265 documentation: https://x265.readthedocs.io/en/master/cli.html · SVT-AV1, "Using SVT-AV1 within ffmpeg": https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/Ffmpeg.md
- Apple, HLS authoring specification: https://developer.apple.com/documentation/http-live-streaming/hls-authoring-specification-for-apple-devices · Netflix VMAF: https://github.com/Netflix/vmaf
- YouTube Help: https://support.google.com/youtube/answer/1722171 · https://support.google.com/youtube/answer/71674
- Gmail Help: https://support.google.com/mail/answer/6584 · Vimeo Help, "How to use HandBrake": https://help.vimeo.com/hc/en-us/articles/12426180666641-How-to-use-HandBrake
Frequently Asked Questions
Can you compress a video without losing any quality?
Not with H.264, H.265 or AV1, because they are lossy. You can make it visually lossless: FFmpeg's guide calls x264 CRF 17 or 18 "visually lossless or nearly so." Truly lossless encoding exists, but the files are far larger.
What is the best CRF value for H.264?
x264's default is CRF 23. For a file that looks like the source, try 17-20; for smaller web files, 20-23. HandBrake suggests RF 20-24 for 1080p. Lower numbers mean higher quality and bigger files.
Is H.265 or AV1 better than H.264 for compression?
Both can match H.264's quality at a lower bitrate, but the saving depends on encoder, settings and footage. H.264 plays on the most devices, so use it for downloads and email; use H.265 or AV1 when the viewer's player supports them.
How do I compress a video to send by email?
Gmail's personal limit is 25 MB. Use a HandBrake "Email 25 MB" or "Social 25 MB" preset, or a two-pass bitrate of target MB × 8,000 ÷ seconds, minus audio, minus about 5%. Or skip compression: Gmail adds larger files as a Google Drive link automatically.
Does YouTube compress my video?
Yes. YouTube processes every upload, first in low quality and then at higher resolutions, which can take up to 4 hours for a 60-minute 4K video at 30 fps. Upload a high-quality file at the source resolution and frame rate.
Editing the video first? Try Loopdesk - cut it in your browser, export a watermark-free 1080p or 4K master, then compress only the copy you need to share.