Compress Video for Email Without Losing Quality
Sending a video by email is one of those tasks that looks trivial until the message bounces, or until you shrink the file and the picture falls apart. The two problems come from the same source: a size limit that is tight for video, and a lack of arithmetic about where the bits will come from.
Here is how I would approach it, with the numbers I measured, and the point at which I would stop compressing and send a link instead.
The limits, and the 18 MB rule
Personal Gmail lets you attach up to 25 MB per message. Outlook.com and Yahoo Mail document 25 MB as well, iCloud Mail 20 MB, and work accounts on Microsoft 365 default to 35 MB for sending, though administrators can change it. Classic Outlook can impose a separate 20 MB client limit. Business mailboxes vary, and the recipient’s server has its own limit, so the smallest limit along the path wins.
There is a catch that trips people up. Attachments travel inside the message in an encoded form that adds roughly a third to their size (guides quote 33 to 37 percent). A file the right side of 25 MB may be rejected by a stricter server further along. For reliable delivery, aim for about 18 MB of raw attachment, and for messages that go to other companies, 15 MB is safer still. If you are not sure what the recipient allows, a smaller file is the cautious choice.
The budget calculation
A video’s size is about its bitrate times its duration. Given a target size, the bitrate you can afford is:
total_kbps = size_MB * 8 * 1000 * 0.95 / seconds
video_kbps = total_kbps - audio_kbps
The 0.95 gives a 5 percent margin. With an 18 MB target and 96 kbps audio, this gives:
| Duration | Total budget | Video budget |
|---|---|---|
| 15 s | about 9.1 Mbps | about 9.0 Mbps |
| 30 s | about 4.6 Mbps | about 4.5 Mbps |
| 1 min | about 2.3 Mbps | about 2.2 Mbps |
| 2 min | about 1.1 Mbps | about 1.0 Mbps |
| 3 min | about 0.76 Mbps | about 0.66 Mbps |
| 5 min | about 0.46 Mbps | about 0.36 Mbps |
For a 15 MB target, scale these numbers by about 0.83.
What do the numbers mean in terms of picture? In my bitrate tests on a 1080p clip, 1 Mbps scored 31.0 dB PSNR, 2 Mbps scored 34.4 dB and 4 Mbps scored 38.3 dB, and at 0.5 Mbps the picture was a smear. A three minute 1080p video squeezed into 18 MB falls in that smear zone, whatever encoder you use. Past roughly two or three minutes, an attachment is the wrong tool.
Step one: shorten it
Cut the clip. Each halving of the duration doubles the bits available for the rest. Trim dead time at both ends, remove pauses, and send only what the recipient needs. Often this alone solves the problem.
Step two: choose the resolution to match the budget
I tested the resolution choice at the two lower budgets, with a 5 second clip, two pass encoding and the slow preset, scaling back to 1080p for the comparison:
| Video bitrate | 1080p | 720p | 540p |
|---|---|---|---|
| 1.1 Mbps | 32.53 dB | 32.76 dB | 32.28 dB |
| 2.35 Mbps | 35.89 dB | 34.84 dB | 33.53 dB |
At about 1 Mbps the three were nearly tied, with 720p slightly ahead. At 2.35 Mbps, 1080p was a clear step ahead. My earlier test sweeping 1 to 8 Mbps agreed: 720p matched 1080p at 1 Mbps and fell well behind at 4 Mbps and above. So the guidance is: below about 1.5 Mbps, use 720p (the picture will be soft either way, but not blocky), and above that, keep 1080p if the screen is large. If the recipient will watch on a phone, 720p is usually enough, and it plays smoothly on any device. The details are in 720p versus 1080p.
Step three: encode properly
Pick a method that hits the size.
Two pass. Reliable and the standard approach. The first pass analyzes the clip, the second distributes the bits. In my test on a 10 second clip with a 2 Mbps target, a single pass landed at 2,470 kB with a PSNR of 34.69 dB, and two pass landed at 2,625 kB, 35.27 dB. The two pass file was a little over the nominal target, so remember that the size is never exact, and short clips overshoot more. In another test, a 5 second clip overshot by 7 to 12 percent. Always check the finished size.
Constant quality with a cap. Choose a CRF (say 24 to 28 for small files) and a maximum bitrate and buffer. Quality is steady, but the size is whatever it is, and you may need to try again.
A two pass command for a one minute clip, 2.1 Mbps video:
ffmpeg -y -i clip.mp4 -vf "scale=-2:720:flags=lanczos" -c:v libx264 \
-preset slow -b:v 2100k -pass 1 -an -f null /dev/null
ffmpeg -i clip.mp4 -vf "scale=-2:720:flags=lanczos" -c:v libx264 \
-preset slow -b:v 2100k -pass 2 -c:a aac -b:a 96k \
-movflags +faststart email.mp4
The -movflags +faststart helps playback start before the whole file has loaded, which is friendly for people opening it from a mail client. Remove the scale filter to keep the original size. Check the output size, and if it is over the target, reduce the bitrate by about 10 percent.
If you prefer an app, HandBrake can do this, and the article on HandBrake settings covers what to watch for.
Step four: do not compress repeatedly
If the first attempt comes out too large, do not compress the compressed file again. Return to the original and encode once with lower settings. In my test, encoding a clip five times in a row at a typical CRF lost about 4 dB, from 41.57 dB after the first pass to 37.50 dB after the fifth. The loss is cumulative. One pass from the original gives the best quality for the size.
What actually makes a file smaller: a measured comparison
When people compress for email they reach for resolution, frame rate, and quality settings in some order. Which one saves the most? I tested on a 10 second 1080p, 60 fps animated clip, all encoded with x264 at CRF 28 and the medium preset, with no audio.
| Version | File size | Change from original |
|---|---|---|
| 1080p, 60 fps | 4,039 kB | baseline |
| 1080p, 30 fps | 3,487 kB | 14 percent smaller |
| 1080p, 24 fps | 3,159 kB | 22 percent smaller |
| 1080p, 15 fps | 3,028 kB | 25 percent smaller |
| 720p, 60 fps | 1,978 kB | 51 percent smaller |
Dropping the frame rate saves less than you might think, because the frames in between are cheap for the encoder: they are predicted from their neighbors. Going from 60 to 30 fps saved 14 percent, and going all the way down to 15 fps saved 25 percent while making motion visibly choppy. Reducing the resolution from 1080p to 720p saved about half. So if you need to shrink a file, resolution is the stronger lever, and frame rate is the weaker one, useful mainly for moving from 60 to 30 where smoothness does not matter.
The caveat is that the sizes here come from a constant quality encode. With a fixed bitrate target, the size is fixed, and what changes is the quality. Lowering the frame rate or the resolution then gives each remaining frame or pixel more bits, which improves the look at the same size. That is the actual benefit: you are not saving size, you are spending the same size on less.
Format problems that look like size problems
iPhone MOV files. Recent iPhones can record in HEVC, saved in a MOV container. They are efficient, but some recipients cannot play them, and some email clients or older computers will show nothing. Converting to H.264 in an MP4 is the more compatible choice, and it makes the file larger rather than smaller at the same quality, so budget for that. The conversion needs a quality setting that does not hurt: a CRF of about 20 for the conversion step is safe, then use a second, separate encode only if you need to shrink it further. Better, do one encode from the original with the right size target.
Odd containers. AVI and MKV files may not play in the recipient’s mail preview or phone. MP4 with H.264 and AAC plays almost everywhere.
Variable frame rate. Phone clips can have variable frame rates, which confuse some players and cause stutter. A constant frame rate conversion, say to 30 fps, makes playback predictable.
Rotation flags. A clip that appears sideways on the recipient’s device has a rotation flag that their player ignores. Re-encoding with the correct orientation fixes it.
Audio: small savings, big impact on perception
For a one minute clip, 128 kbps audio costs about 960 kB, while 64 kbps costs 480 kB. That is a saving of half a megabyte in an 18 MB budget, which is worth taking only if you have to. If the clip has speech only, mono at 64 kbps is clear. If it has music, keep at least 96 kbps stereo. Do not strip audio unless the clip has no useful sound, because a silent video can be confusing.
Splitting a long video into parts
If you must send a long video by email, splitting it into parts that each fit under the limit is an option, but many mail systems count the total message size, so each part should go in its own message. FFmpeg can cut without re-encoding, which keeps quality:
ffmpeg -i long.mp4 -c copy -f segment -segment_time 60 -reset_timestamps 1 part_%03d.mp4
The cuts land on keyframes, so the parts will not be exactly 60 seconds each. Each part still needs to be small enough, which means the original bitrate must already be low. For a typical high bitrate phone clip, a 60 second part is far larger than 18 MB, and you will need to compress anyway. The approach suits files that are already compressed to a low bitrate.
Why zipping does nothing
People sometimes put a video in a zip file hoping to shrink it. It does not work, because video is already compressed, and a zip gains almost nothing, perhaps a fraction of a percent. A zip can help when you attach several small files and want to keep them together, but not to reduce a video’s size.
Checking the result before you send
Before sending, open the compressed file and look at three places: the first seconds, a section with fast motion, and a section with fine detail such as text. Check the audio, and check the file size in the file properties, not the size of the folder. If you can, send the email to yourself or a colleague first, to see that it arrives and plays on a different device and mail client.
Bounce messages can be cryptic. A “message too large” error means the encoded message exceeded a limit somewhere. Reduce the attachment by another 20 percent or send a link. A message that arrives with the attachment replaced by a link means the mail provider converted it, which is fine, and the link keeps the full quality.
When a link is better
There comes a point where compression hurts more than it helps. If the video is longer than two or three minutes, or if quality matters, such as a client review, a portfolio piece or a family video with an important moment, send a link:
- Google Drive, OneDrive, iCloud Mail Drop (up to 5 GB, as documented) and similar services keep the full quality file and avoid size limits.
- Some mail services convert large attachments into links automatically, for example Gmail does so above 25 MB.
- A private video on a video platform lets the recipient watch without downloading.
Set the sharing permissions deliberately. A link anyone can open is convenient, but it may not be right for private video. Choose “specific people” where you can.
A middle path: send a preview and a link
For professional work, one approach is to attach a small preview (30 seconds at 720p, which fits easily) and include a link to the full quality file. The recipient sees something immediately, and gets the real thing if they need it.
Phone tips
If you are sending from a phone, the share sheet may offer a size choice such as small, medium, large or actual size. “Medium” is often a reasonable compromise, but you do not know what bitrate it uses. For a given clip, check the size shown. If you want control, compress on a computer or use an app that lets you set a target.
On iPhone, Mail may offer Mail Drop for large files automatically. It sends a link, which keeps the quality. The recipient has 30 days to download, according to Apple’s documentation.
Screen recordings and text
A screen recording of a few minutes, such as a bug report or a short tutorial, is a common email video. These compress very well when mostly static, so you can often keep the full resolution. If the text becomes unreadable after compression, record a shorter section, crop to the relevant area, or use a constant quality mode. There is more in why screen recordings look blurry.
Fixing a video that is already low quality
If the clip is poor to begin with, compressing it makes it worse, and nothing about email changes that. A cleanup first, such as deblocking and denoising, can make the video easier to compress, because smooth areas cost fewer bits. If you want to see what a cleanup does to a sample, try the free preview. It is not a fix for a clip that is badly damaged, and I would not use it as a way to avoid sending a link.
A repeatable routine
- Find out the limit, and aim for 18 MB or less.
- Trim the clip.
- Compute the bitrate.
- If the video budget is under 1.5 Mbps, pick 720p.
- Encode with two passes from the original.
- Check the file size and watch the hardest part.
- If it is too big or too poor, trim more or use a link.
Summary
To send a video by email, keep to about 18 MB, trim first, compute the bitrate from the size and the length, and choose 720p when the budget falls below about 1.5 Mbps. Use two pass encoding from the original, check the size, and do not compress twice. When the clip is long or the quality matters, a link is the better answer.
Got a pixelated video right now?
Upload it and see a free before and after preview in about a minute.
Fix my videoFrequently asked questions
How big can a video attachment be in Gmail?
Personal Gmail allows 25 MB of attachments per message, and larger files are turned into Google Drive links. Because email encoding adds about a third, a file near 18 MB is the safer ceiling.
How do I compress a video without losing quality?
You cannot compress without any loss, but you can keep it small enough to look clean. Trim the clip, drop to 720p if the budget is low, and use two pass or a capped quality mode.
Is a link better than an attachment?
For anything over about 18 MB, yes. A Drive, OneDrive or similar link keeps the original quality and avoids bounces.
What bitrate fits 18 MB for a one minute clip?
About 2.2 Mbps in total, so roughly 2.1 Mbps for the video plus 96 kbps for the audio.
Why does my compressed video look blocky?
The bitrate was too low for the resolution and the content. Lower the resolution, shorten the clip, or send a link instead.
Keep reading
Discord Video Pixelated? Fit the Size Limit Cleanly
Discord videos look blocky when you squeeze them under the upload limit badly. Do the bitrate math and compress cleanly with real test numbers.
720p vs 1080p: Does the Difference Matter?
A measured comparison of 720p and 1080p at the same bitrates, plus when the extra pixels pay off and when a lower resolution looks better.
CRF Explained: Compress Video Without Losing Quality
What CRF means in x264 and x265, which value to pick, and measured file size and quality for CRF 18 to 33 on a real 1080p clip.
HandBrake Output Pixelated? Settings That Fix It
HandBrake video looks blocky or blurry after conversion? Check quality mode, preset, filters and framerate settings with real CRF numbers.