ffmpeg Tools Français

Compress a video to send by email

A 25 MB limit (Gmail, Yahoo, Outlook.com) or 20 MB limit (iCloud) applies to the entire message, not just the file: the attachment is encoded to travel by email, which makes it about a third larger. To get under 25 MB, aim for a file of about 18 MB, and even less if the recipient has a lower limit (often 10 to 20 MB at companies). The default value aims for 17 MB: adjust it to your situation.

Updated on · Platform limits checked on

Shown in the file's properties.

Lowering the resolution helps when the target size is very small.

Only used by the first command (analysis).

  

How to use it

  1. Install ffmpeg if you haven't already.
  2. Enter the size you want and the duration of the video: the video bitrate is calculated for you.
  3. Run the two commands one after the other, in the video's folder: the first analyzes, the second encodes.
  4. Check the resulting file size. If it's slightly over, lower the target size by 1 to 2 MB and try again.
  5. Then delete the ffmpeg2pass-0.log files created by the first command.

Working out the size to aim for

Divide the message limit by 1.34 to estimate the usable file size: 25 MB gives about 18 MB, 20 MB about 15 MB, and 10 MB about 7 MB. Subtract another 1 to 2 MB if the message contains text, a signature or other attachments.

Alternatives to an attachment

If the video is still too big or too degraded, a sharing link is often a better choice: Gmail offers to send files that are too large through Google Drive, Outlook.com through OneDrive, and iCloud Mail through Mail Drop. The recipient then downloads the video without any attachment limit.

If your video is already small

This method aims for a size; it doesn't always reduce it: if the original video is already smaller than the target size, re-compressing it can make it larger. In our tests, a 0.96 MB video grew to 2.4 MB with a 20 MB target. In that case, keep the original file, or use the quality-based method (CRF).

Quality-based method (CRF)

Frequently asked questions

Why aim for 18 MB with a 25 MB limit?

Email encodes attachments as text (base64), which adds about 33% to their size. A 20 MB file then weighs nearly 27 MB in the message and exceeds the 25 MB limit.

What if the recipient's limit is lower than mine?

The lower of the two is what counts. If in doubt, aim lower, or send a sharing link instead of a file.

Why two commands?

Two-pass encoding first analyzes the video, then distributes the bitrate to get close to the target size. It's the most reliable method for hitting a specific file size.

Is the final file exactly the size I entered?

No: it's usually a bit smaller. The calculation keeps a 5% margin, and a bitrate cap (the -maxrate and -bufsize options) stops ffmpeg from exceeding the target, which would otherwise happen on low-motion videos. Here, 1 MB equals 1,000,000 bytes.

What is -x264-params mbtree=0 for?

It disables an encoder optimization that can make the second pass fail on some videos (the "Incomplete MB-tree stats file" error). It very slightly increases the file size for a given quality.

The resulting file is much smaller than the target size. Is that normal?

Yes, for a very static video (slideshow, screen recording): it doesn't need all the available bitrate, and ffmpeg may display "2pass curve failed to converge". The result is still valid.

ffmpeg shows "Unrecognized option 'fps_mode'". What should I do?

Your version of ffmpeg is older than 5.1. Update ffmpeg, or replace "-fps_mode passthrough" with "-vsync passthrough" in both commands.

More tools