Getting a Video Under an Upload Limit Without Guessing
Published 7/3/2026 · 14 min read · File tools
Daniel Okonkwo — Front-end developer and tech writer at OneKitly
Web performance · File formats
Checked against 6 sources
Stop turning the slider and do one division instead. A video file's size is essentially its bitrate multiplied by its duration, so the limit and the length of the clip together fix the bitrate you are allowed to spend before you have made a single decision about quality. Convert the limit into kilobits and divide by the seconds: 25 megabytes over two minutes is 25 × 8,000 ÷ 120 = 1,667 kbit/s for everything in the file. This tool writes its audio at a fixed 128 kbit/s, so subtract that and 1,539 kbit/s is left for the picture. Now compare that number with what your resolution actually wants — YouTube's own published recommendations are around 8,000 kbit/s for 1080p, 5,000 for 720p and 2,500 for 480p at standard frame rates — and the answer arrives on its own: two minutes of 1080p cannot fit in 25 MB, 720p is a stretch at less than a third of the recommendation, and 480p, at 62 % of it, is the honest choice. That is why resolution is the first decision and the quality slider is the second. The slider is a CRF value, a constant rate factor, and it asks the encoder for a consistent visual quality while letting the bitrate go wherever the footage demands — which is precisely why FFmpeg's own encoding guide states that this mode cannot be told to hit a specific file size. It is still usable as an aiming device, because it is predictable in one respect: adding six points roughly halves the bitrate, and subtracting six roughly doubles it. So aim with the arithmetic, land with the slider, and if the first attempt comes out at twice the limit, add six and run it again.
The quality slider cannot aim at a file size — that is not what it is for. But the limit and the length of your clip already fix the bitrate you are allowed to spend, and one division tells you whether the resolution you are using can possibly fit.
Size is bitrate times duration, and almost nothing else
A video file is a stream of bits played out at a rate. Multiply that rate by how long it plays and you have the file, give or take the container's own bookkeeping, which for a normal MP4 is a fraction of a percent. This is why file size is not really a property you set. It is an outcome. The two things you can genuinely control are how many bits go by each second and how many seconds there are, and everything a compressor does is a way of pushing on the first of those.
The conversion is worth committing to memory because it is the whole method. One megabyte is eight million bits, so one megabyte is 8,000 kilobits. Multiply the limit in megabytes by 8,000, divide by the number of seconds, and the result is the total bitrate in kilobits per second that fits. A 25 MB limit on a 60-second clip allows 3,333 kbit/s. The same limit on a 10-minute clip allows 333 kbit/s. Same limit, twenty times less room, and the difference is entirely the duration.
One trap in that arithmetic is the megabyte itself. Some systems mean 1,000,000 bytes by it and some mean 1,048,576, a gap of 4.9 %, and a service rarely tells you which it uses. Computing with the decimal figure — 8,000 kilobits per megabyte — is the safe direction to be wrong in: if the service actually meant the larger megabyte, your file simply comes in under its limit with room to spare.
CRF asks for a quality, not for a size
The quality slider on this tool sets a constant rate factor. The scale runs from 0 to 51 in the encoder; the slider exposes 18 to 34, which is the part of it anybody sensible uses, and it starts at 28. A lower number means better quality and more bits. FFmpeg's own guide calls 17 or 18 visually lossless or nearly so, and describes 17 to 28 as the subjectively sane range. The crucial property is what the number means: it is an instruction about how much distortion to tolerate in each frame, not an instruction about how many bits to produce.
That is why the same CRF gives wildly different sizes on different clips. Two minutes of a static interview at CRF 23 might land at a few megabytes; two minutes of rain on water, confetti or a shaky handheld walk through a market at the same CRF can be ten times that, because holding the same visual quality across all that movement genuinely costs more bits. The encoder is doing what you asked. You asked for a look, not a weight. FFmpeg's documentation says so in as many words: in this mode you cannot tell it to hit a specific file size or stay under a specific bitrate.
There is one regularity you can lean on, and it is the reason a couple of attempts converge so fast. The CRF scale is exponential: raising it by six points roughly halves the bitrate, lowering it by six roughly doubles it. That single rule turns a blind slider into an aiming device. Over the range this tool exposes, from 18 to 34, that is a factor of about 6.3 between the largest and smallest file the same clip can produce.
Working backwards from the limit, with a real example
Take a three-minute clip you want to email. Gmail states a 25 MB attachment limit on personal accounts, so: 25 × 8,000 = 200,000 kilobits, divided by 180 seconds, is 1,111 kbit/s in total. Subtract the 128 kbit/s this tool gives the audio and 983 kbit/s remain for the picture. YouTube's published recommendation for 1080p at a standard frame rate is 8,000 kbit/s. You are being asked to do it in an eighth of that. The clip will encode, and it will look like it was recorded through a window in the rain.
So change the question. At 720p, YouTube's recommendation is 5,000 kbit/s and you have 983 — still a fifth. At 480p it is 2,500 and you have 983, which is 39 % of it: aggressive, visibly softer, but watchable for a talking head or a screen recording. That comparison is the actual decision, and it took one division to reach. If the clip has to stay at 1080p, the only remaining lever is duration: cut it to 45 seconds and the same 25 MB gives you 4,444 kbit/s in total and 4,316 for the picture — close to the 720p recommendation and a little over half of the 1080p one, which is the point at which raising the CRF stops being cruelty.
When the arithmetic says no
Run the division on a thirty-minute recording against a 25 MB limit and you get 111 kbit/s in total — less than the audio alone needs. The budget for the picture is negative. No compressor setting solves that, and no amount of patience will make one work, because the request is arithmetically impossible before the encoder is even involved. This is the most useful result the method produces, and it is worth reaching before you spend twenty minutes encoding.
The honest answers at that point are all about duration or about the destination. Trim the recording to the part that matters — the video trimmer will do that in seconds without re-encoding anything, at the cost of landing on a keyframe rather than exactly where you asked. Split it into parts. Or change the channel: WhatsApp's own help pages state a default video limit of 100 MB and 720p on a fast connection and 64 MB and 480p on a slow one, while documents sent through the same app go up to 2 GB, so sending a video as a document is a route around both the size limit and the app's own re-compression.
The flag that moves the index to the front
Every MP4 this tool produces is written with +faststart, and it is worth a paragraph because it is the difference between a file that plays and one that appears broken. An MP4 stores its media data in one box and its index — the table saying where every frame lives, called the moov atom — in another. By default the encoder writes the index last, because it cannot know the final layout until the last frame is written. A player reading such a file from a web server has to reach the end of the download before it can start.
The faststart flag makes the encoder do a second pass over the finished file and move that index to the front. FFmpeg's own documentation describes it exactly that way, and notes that it is not on by default because the extra pass takes time. YouTube asks for the same thing in its upload recommendations: the moov atom at the front of the file, which it calls Fast Start. The practical effect is that your video starts playing while it is still arriving, instead of showing a black rectangle until the last byte lands — which is what an upload preview, a chat client or a web page will do with a file that lacks it.
What the tool actually runs, and where
There is no mystery in the pipeline, so here it is in full. The compressor encodes the picture with libx264 at the preset veryfast and the CRF you chose, encodes the sound with AAC at 128 kbit/s, and writes the result as an MP4 with the faststart flag. That is the entire command. The preset is a speed-versus-efficiency dial rather than a quality dial: a slower preset would produce a slightly smaller file at the same CRF, and veryfast is the compromise that keeps a browser-based encode from taking all afternoon.
That encoder is FFmpeg compiled to WebAssembly and it runs inside the page, on your machine. The engine is about 32 MB and it is served from this site's own address rather than a third-party network, so the only thing that travels is the engine coming to you — the video never goes anywhere. The build is single-threaded, which is why it is slower than a desktop encoder that spreads the work across every core you have, and why a long clip is genuinely a long wait. Keep the tab in the foreground while it works: the job lives in the page and nothing on a server is holding your place.
| Clip length | Under 20 MB | Under 25 MB | Under 100 MB | Highest rung the budget fully meets |
|---|---|---|---|---|
| 30 seconds | 5,205 kbit/s | 6,539 kbit/s | 26,539 kbit/s | 720p at 20–25 MB, 1440p at 100 MB |
| 1 minute | 2,539 kbit/s | 3,205 kbit/s | 13,205 kbit/s | 480p at 20–25 MB, 1080p at 100 MB |
| 2 minutes | 1,205 kbit/s | 1,539 kbit/s | 6,539 kbit/s | 360p at 20–25 MB, 720p at 100 MB |
| 5 minutes | 405 kbit/s | 539 kbit/s | 2,539 kbit/s | below 360p at 20–25 MB, 480p at 100 MB |
| 10 minutes | 139 kbit/s | 205 kbit/s | 1,205 kbit/s | trim it — 360p only at 100 MB |
| 30 minutes | impossible — 89 kbit/s total, under the audio alone | impossible — 111 kbit/s total, under the audio alone | 316 kbit/s | none — below 360p even at 100 MB; trim or split |
Frequently asked questions
- Why can I not just type the file size I want?
- Because hitting a size exactly requires the encoder to see the whole clip before deciding how to spend its bits, which means encoding it twice. That is what two-pass mode does: the first pass measures where the difficult moments are, the second spends the budget accordingly. It is the correct answer when a size is a hard requirement, and it costs roughly double the time. This tool runs a single pass at a constant quality, which is the right trade for a browser-based encoder where the second pass would double a wait that is already long. The arithmetic in this article is how you get single-pass CRF to land where two-pass would.
- My compressed file came out bigger than the original. How?
- Because the CRF you asked for was more generous than the quality the file already had. Compression is not a ratchet — the encoder does not know or care what the input weighed, it just produces whatever a given quality level costs. A clip that was already squeezed hard, a download from a messaging app or a screen recording of mostly static content, may need more bits at CRF 23 than it currently occupies. Raise the CRF. The other common cause is an audio track that was originally smaller than 128 kbit/s, since this tool always re-encodes it at that rate.
- Should I lower the resolution or raise the CRF?
- Compare your budget with what the resolution wants and let the gap decide. If the budget is within a factor of two of the recommendation, raise the CRF — the picture will soften but stay sharp-edged. If the budget is a fifth of it or less, lower the resolution instead: an encoder starved that far produces blocking and smearing that are far uglier than the same footage rendered honestly at a smaller size. The rule of thumb is that a picture with too few pixels looks small, while a picture with too few bits looks broken, and viewers forgive the first much more readily.
- Does the audio setting matter at all?
- It matters exactly when the clip is long and the limit is small. At 128 kbit/s the sound costs about 0.96 MB per minute, so a two-minute clip spends under 2 MB on audio and nobody cares, while a twenty-minute recording spends over 19 MB on audio alone — which is why the thirty-minute row of the table is impossible at 25 MB. This tool does not expose an audio control, so when the sound is the problem the answer is to shorten the recording, or to accept that a long piece of talking wants a different container entirely and extract the audio track on its own.
- The upload still failed even though my file is under the stated limit.
- Three things do this regularly. The stated limit may apply to the whole message rather than to each attachment, so your other files count too. The service may measure the encoded upload rather than the file on disk, which adds roughly a third for an email attachment. And published figures go stale: Discord's own File Attachments FAQ, read on 13 August 2026, states that the free upload limit is now 20 MB, raised from 10 MB in August 2026, with Nitro Basic at 50 MB and Nitro up to 500 MB — while an older paragraph on the same page still says 10 MB. When a page contradicts itself, aim under the smaller number.
Articles you may find interesting
All guides →Related tools
Upload limits are what each service published on the date cited and they change without warning — check the current figure before you encode. Bitrate recommendations are starting points, not rules: what a clip really needs depends on how much movement and detail it contains.
Sources
- FFmpeg Wiki — H.264 encoding guide — CRF range 0–51, default 23, ±6 halves or doubles the bitrate, and the statement that CRF cannot target a file size
- FFmpeg — Formats documentation, mov/mp4/ismv muxer — faststart moves the index (moov atom) to the beginning of the file
- YouTube Help — Recommended upload encoding settings — bitrate by resolution, and the moov atom at the front of the file (Fast Start)
- Google — Send attachments with your Gmail message — 25 MB attachment limit on personal accounts (read 13 August 2026)
- Discord — File Attachments FAQ — free upload limit 20 MB as of August 2026, Nitro Basic 50 MB, Nitro up to 500 MB (read 13 August 2026)
- WhatsApp Help Center — How to send media, contacts, or location — 100 MB/720p default video limit on a fast connection, 64 MB/480p on a slow one, documents up to 2 GB (read 13 August 2026)
Spotted a mistake in this article?