Guide
Re-encoding is lossy compression, so shrinking a video with no quality loss doesn't hold up. Instead, this guide lays out where the savings come from (audio, CRF, codec, resolution, frame rate) using this site's measurements and calculations, and leads into the size prediction tools.
A video file’s size is roughly (video bitrate + audio bitrate) × duration. So the only ways to shrink it are to lower the bitrate or shorten the duration, and every method below is a way of lowering the bitrate.
| Method | Effect on quality | How much it saves | Basis |
|---|---|---|---|
| Trim audio | Video quality unchanged (audio may be lossy) | As much as the audio bitrate. Small compared with the video bitrate | Calculation (below) |
| Raise CRF | Goes down. The amount varies a lot by video | Bitrate 58–63% at x264 CRF +4 | Measured: crf-by-content-v1 |
| Switch codec (x264 → SVT-AV1) | Similar at the same VMAF | 41–63% of x264's size at the same VMAF | Measured: crf-sweep-v1 |
| Lower resolution | Sharpness goes down | Pixel count drops proportionally, but file size has to be measured separately | Calculation only, not measured |
| Lower frame rate | Motion looks less smooth | Frame count drops proportionally, but file size has to be measured separately | Calculation only, not measured |
If you copy the video stream as is (-c:v copy), video quality doesn’t change. You shrink the file by re-encoding the audio or by dropping audio and subtitle tracks you don’t need. The effect is limited, though, because video usually takes up far more of the file. For example, the blue_sky x264 CRF 26 video bitrate in this site’s measurements is 3,322.0 kbps, so if the audio is 128 kbps (an example value), it is about 3.7% of the total. Even removing the audio entirely saves only about that much.
ffmpeg -i input.mp4 -c:v copy -c:a aac -b:a 96k output.mp4If the source audio is already at a low bitrate, re-encoding it gains nothing. For the command options, see the FFmpeg cheat sheet.
Raising CRF lowers the encoder’s quality target, which lowers the bitrate. Here are the x264 medium results going from CRF 26 to 30 in this site’s measurements (file size and quality by content type). The bitrate ratios are calculated from the kbps in the table.
| Clip | kbps (CRF 26 → 30) | Bitrate ratio | Mean VMAF (26 → 30) |
|---|---|---|---|
| blue_sky | 3,322.0 → 1,916.7 | about 58% | 99.94 → 98.22 |
| pedestrian_area | 3,142.9 → 1,981.2 | about 63% | 92.48 → 84.21 |
| riverbed | 14,654.1 → 9,188.1 | about 63% | 95.24 → 81.34 |
| rush_hour | 2,954.7 → 1,778.7 | about 60% | 88.42 → 80.57 |
The size reduction was similar across the four clips, but quality dropped by 1.7 points for blue_sky and 13.9 points for riverbed. So how far you can raise CRF is something to check with your own video. Starting points and the order of adjustment are covered in How to Pick a CRF Value. Also, re-encoding a video that has already been compressed once cuts quality one more time relative to the original.
The rule of thumb “raise CRF by 6 and the file halves” was roughly right for x264 and x265, leaving about 40–47% on average across the whole range, but individual steps ranged from 26% to 58%. For SVT-AV1 and VP9, the same +6 cut the size only to about 57–67% (size and VMAF change per CRF step). Also, a faster x264 preset needed more bytes for the same VMAF 90 (veryfast was 106–155% of medium), while slow only got down to 95–98% of medium (x264 preset measurement).
In the crf-sweep measurements, SVT-AV1 (preset 6) came in at 41–63% of x264’s file size at the same VMAF as x264 medium (comparing the nearest measured points, four clips). Conversely, switching to a less efficient codec, such as HEVC to H.264, can make the file bigger at the same VMAF. For how many times larger or smaller your file gets with your own codec combination, the re-encode size predictor reads it from the public measurements. On the other hand, some devices can’t play AV1, so check the recipient’s setup first with codec support check. The selection criteria are in the codec choice guide.
Lowering 1080p (1920×1080) to 720p (1280×720) takes the pixel count from 2,073,600 to 921,600, about 44%. Lowering 30 fps to 24 fps brings the frames per second to 80%. But that doesn’t mean the file size becomes 44% or 80%. Encoders work toward a bitrate target, so file size depends on your settings and the content, and this site did not measure how file size changes with resolution or frame rate. Both methods directly cost you sharpness or smoothness, so it’s safer to use them last, when the CRF and codec methods above aren’t enough.
ffmpeg -i input.mp4 -vf scale=-2:720 -c:v libx264 -preset medium -crf 24 -c:a copy output.mp4The CRF 24 in the example is only a starting point, so check the result by eye. If your video has a variable frame rate (VFR), it’s best to check it first with the VFR detector.
When there’s a size limit such as “under 10 MB”, it makes more sense to calculate a target bitrate than to use CRF. Enter the duration and target size in the video file size and bitrate calculator and it generates the bitrate you need and an FFmpeg command, and it also shows the VMAF at that bitrate from the measured data. If the bitrate comes out too low, consider trimming the duration or lowering the resolution as well.
Re-encoding is lossy compression, so shrinking a video with no quality loss doesn't hold up. The only way to leave the picture untouched is to copy the video as it is (-c:v copy) and tidy up other tracks such as audio and subtitles, and the savings from that are small.
In this site's measurements (four 10-second 1080p clips, 8-bit), raising x264 medium from CRF 26 to 30 cut the bitrate to about 58–63%. The mean VMAF drop, though, varied widely by video, from 1.7 points for blue_sky to 13.9 for riverbed. How far you can raise it has to be checked on your own video.
In the crf-sweep measurement, SVT-AV1 (preset 6) came out at 41–63% of x264's size at the same VMAF as x264 medium (nearest measured points compared, four clips). Some devices can't play AV1, though, so check the receiving side first.
Going from 1080p to 720p leaves about 44% of the pixels, and going from 30 fps to 24 fps leaves 80% of the frames per second, but that is not the same as the file size ratio. This site did not measure how file size changes with resolution or frame rate.
It's better to calculate a target bitrate instead of using CRF. Enter the length and target size into the video size and bitrate calculator and it produces the bitrate you need and an FFmpeg command. If the bitrate comes out too low, also consider trimming the length or lowering the resolution.