If a video will not attach, first check the size limit in the error message. Then trim it, compress it, or send a link instead, depending on what you need to keep.
Compress a video · Trim a video
1. Check the limit and what must remain visible
A personal Gmail account can send up to 25 MB of attachments in total. For work and school accounts, the administrator sets the limit. You can send larger files as a Google Drive link. Gmail help
In Outlook, the limit depends on the app, the account and the organization. Microsoft’s Outlook guidance gives 20 MB per message for internet email accounts and 10 MB by default for Exchange accounts. Do not assume every Outlook setup accepts a 25 MB attachment. Outlook help
| What matters | Try first | Then check |
|---|---|---|
| One short moment | Trim the start and end | The important speech and action are still there |
| A whole short clip | Compress to a target size | Text, faces and sound are still clear |
| The full length and quality | Share a link | The recipient can open it |
Compress and send from your browser
- Keep the original and open a copy in the compressor. The compressor does not upload your file.
- Use quality mode, or pick a target below your email limit. If the compressor cannot read the video’s length, use the size-target tool instead: you can type the length there, and its custom targets work for email too.
- Check the size of the output file. If it is still over the limit, change the settings before you attach it.
- Play the start, middle and end. Check that on-screen text is readable and speech is clear.
- Attach the file or share a link. For a link, check who can open it and when it expires. Do not make private footage public.
How much a file shrinks depends on the video. With one setting, a silent 10-second clip went from 23.28 MB to 1.83 MB. See the measurements, frames and settings
If processing stops on a phone
Memory use depends on the resolution, the length and the device, not only on the file size. Try a shorter video and keep the page open while it works. If it still fails, use a computer, or share a link to the original file.
Is sending without compression better?
If the original already fits and plays for the recipient, you do not need to compress it. Compressing it again can lower the quality. If a small file still fails to send, check the recipient’s limit, the total size of all attachments, your connection and your account settings.
Fine control with desktop FFmpeg
A target size is only a calculation. Check the size of the output, and check that the email actually goes through.
2. Compress by quality (CRF)
This method needs only a single pass. You set a quality level, and FFmpeg picks the bitrate needed to keep it. -crf 28 compresses strongly enough for most short clips.
ffmpeg -i input.mp4 -vcodec libx264 -crf 28 -preset slow -acodec aac -b:a 96k output.mp4
-crf 28— a higher CRF gives a smaller file and lower quality-preset slow— takes longer, but gets more quality out of the same bitrate-b:a 96k— sets the audio to 96 kbps, which is enough for speech and short clips
Check the size of the output. If it is still too large, raise the CRF by a few points or lower the resolution (Section 3).
3. Lower the resolution
Lowering the resolution cuts the size a lot. Going from 1080p to 720p removes more than half the pixels, so much less bitrate is needed for the same visual quality.
ffmpeg -i input.mp4 -vf scale=-2:720 -c:v libx264 -crf 28 -c:a aac output.mp4
-vf scale=-2:720— sets the height to 720 and works out the width from the aspect ratio.-2keeps the width an even number, which H.264 needs in the usual 4:2:0 format.
For an even smaller file, use scale=-2:480 when fine detail does not matter. More on the scale filter: Scale / Resize Video.
4. Two-pass encoding to get close to a target size
When the file must come in just under a fixed limit, set a bitrate and encode in two passes. The first pass analyzes the video and writes a log file. The second pass uses that log to put the bits where they are needed most. Run the two commands one after the other on the same input.mp4.
Pass 1 (analysis only, with no output file and no audio):
ffmpeg -y -i input.mp4 -c:v libx264 -b:v 1000k -pass 1 -an -f null -
Pass 2 (writes the final file using the pass-1 log):
ffmpeg -i input.mp4 -c:v libx264 -b:v 1000k -pass 2 -c:a aac -b:a 96k output.mp4
-pass 1 -an -f null -— the analysis run:-androps the audio and-f null -throws the output away-pass 2— the final encode, held to the target video bitrate-b:v 1000k— the video bitrate, worked out with the formula below
For more on how two-pass encoding works, see Two-Pass Encoding.
5. Pick a bitrate from the size limit
To aim for a size, turn the size limit and the clip length into a video bitrate:
total_bitrate (kbps) = target_size_MB * 8000 / duration_seconds
video_bitrate (kbps) = total_bitrate - audio_bitrate (kbps)
Here 1 MB = 1,000,000 bytes and 1 kbps = 1000 bits/s, which gives the factor of 8000. Then take about 10% off the video bitrate as a margin, because the output can come out a little larger than the calculation.
Example: a 60-second clip with 96k audio and a 15 MB target:
total = 15 * 8000 / 60 = ~2000 kbps
video = 2000 - 96 = ~1904 kbps
with ~10% headroom -> use -b:v 1700k
Use that value for -b:v in both passes in Section 4. If the clip is so long that the result is very low (under about 500 kbps), lower the resolution first (Section 3) so the bits go further.
6. Troubleshooting
File is still over the limit
Cause: The CRF is too low, or the bitrate too high, for the length of the clip.
Fix: Raise the CRF by a few points, lower the resolution, or work out -b:v again with Section 5.
height not divisible by 2 error
Cause: The output width or height is an odd number. H.264 in the common 4:2:0 format needs both to be even.
Fix: Use -2 for the side FFmpeg works out, for example scale=-2:720.
Two-pass leaves ffmpeg2pass-0.log files behind
Cause: Pass 1 writes a log file for pass 2 to read. Fix: You can delete them once pass 2 has finished.
Audio sounds bad after compression
Cause: 96 kbps is fine for speech but sounds thin for music.
Fix: Raise the audio to -b:a 128k. This leaves slightly less of the size budget for the video.
Recipient says the video won’t play
Check: The pixel format, whether their player supports the codec, and whether the whole file arrived. This symptom has more than one possible cause.
Fix: Add -pix_fmt yuv420p to the encode command for the widest compatibility.
FAQ
Q1. Why aim under the limit instead of right at it? A. Email systems can add encoding overhead, and some limits count the whole message, not only the attachment. A margin helps, but even aiming for 80% of the limit can fail. Check the limits of your service and of the recipient’s.
Q2. CRF or two-pass: which should I use? A. Use CRF (Section 2) when you only need a smaller file that still looks good enough. Use two-pass (Section 4) when the file must come in just under a fixed limit.
Q3. The clip is several minutes long. Can I still email it? A. Possibly, but the quality will drop noticeably. For long clips, a cloud storage link usually works better than an attachment.
Q4. Does this re-encode the video? A. Yes. All three methods re-encode the video, which loses some quality. Copying the streams into a new file without re-encoding (remuxing) does not compress the video or audio, so the file stays about the same size. See Compress Video.
Q5. Can I trim instead of compressing? A. If only part of the clip matters, trim first. A shorter clip needs fewer bytes at the same quality. Then compress the shorter clip.