Video
Compress Video From the Terminal on macOS (avconvert and ffmpeg)
The fastest terminal command is the one already on your Mac: avconvert --source in.mov --preset PresetHEVC1920x1080 --output out.mp4. For control over file size, install ffmpeg and use ffmpeg -i in.mov -c:v h264 -crf 26 -c:a aac -b:a 128k out.mp4. Both are below, with sizes we measured.
How do I compress a video with avconvert on a Mac?
avconvert ships with macOS, so there is nothing to install. It uses Apple’s own encoders and the same presets as the Finder “Encode Selected Video Files” action. Pick a preset, a source and an output:
avconvert --source in.mov --preset PresetHEVC1920x1080 --output out.mp4 --progress --replaceRun avconvert --help to list every preset. The useful ones for shrinking files are Preset1920x1080, Preset1280x720, PresetHEVC1920x1080 and PresetMediumQuality. There is no CRF or bitrate flag. You choose a preset and accept what it gives you.
Two flags help. --start and --duration trim the clip while encoding. --multiPass asks for a slower, higher quality pass where the codec supports it. By default avconvert filters privacy-sensitive metadata, and --disableMetadataFilter turns that off.
How do I compress a video with ffmpeg on a Mac?
ffmpeg is not part of macOS. Install it with Homebrew (brew install ffmpeg). Then the quality knob is CRF: lower is bigger and sharper, higher is smaller. For H.264, 23 is the default and 26 to 28 is a common range for sharing.
# H.264, plays everywhere
ffmpeg -i in.mov -c:v h264 -crf 26 -preset medium -c:a aac -b:a 128k out.mp4
# H.265 (HEVC), smaller at the same look, slower to encode
ffmpeg -i in.mov -c:v hevc -crf 28 -tag:v hvc1 -c:a aac -b:a 128k out.mp4
# Shrink the resolution too (keeps aspect ratio, even width)
ffmpeg -i in.mov -vf scale=1280:-2 -c:v h264 -crf 26 -c:a aac -b:a 128k out.mp4The -tag:v hvc1 flag matters for H.265. Without it, QuickTime and iPhones often refuse to play the file. The -preset flag trades time for size: slow makes smaller files than medium, and veryfast makes bigger ones.
Want the reasoning behind the two codecs? See H.265 vs H.264.
How much smaller do these commands make a file?
We encoded one 20 second, 1920 by 1080, 30 fps H.264 clip (33.0 MB, generated with ffmpeg’s testsrc2 pattern plus a sine tone) on an Apple Silicon Mac running macOS 27.0.1 with ffmpeg 8.1.1. A test pattern is not a camera clip, so treat the ratios as an illustration. Real footage compresses differently.
| Command | Output size | Encode time |
|---|---|---|
| Original | 33.0 MB | n/a |
| avconvert Preset1280x720 | 16.9 MB | not timed |
| avconvert PresetHEVC1920x1080 | 21.9 MB | not timed |
| ffmpeg H.264 CRF 26, medium | 10.8 MB | 11 s |
| ffmpeg H.265 CRF 28 | 12.1 MB | 36 s |
Two things to read from this. First, the CRF commands gave us control and the smallest files, but avconvert needed no install and no flag tuning. Second, H.265 was not smaller here. That is a quirk of a synthetic, very sharp test pattern at our chosen CRF values. On real footage H.265 usually wins at equal quality, but check your own clip rather than trusting a rule. Our compress video on Mac guide has results on real footage.
How do I compress a whole folder of videos from the terminal?
A shell loop does it. This one writes a copy next to each original and never overwrites the source:
for f in *.mov; do
ffmpeg -n -i "$f" -c:v h264 -crf 26 -c:a aac -b:a 128k "${f%.mov}_small.mp4"
done-n tells ffmpeg to skip files that already exist. For avconvert, swap the command inside the loop and keep --replace off. Loops run one file at a time, so a long folder takes a long time. For a point-and-click version, read how to batch compress videos on a Mac.
What mistakes make terminal video compression go wrong?
- Forgetting
-c:a aac. ffmpeg then copies or re-picks audio you did not choose. - Using an odd scale width. H.264 needs even dimensions, so use
scale=1280:-2, not-1. - Putting
-ssafter-iwhen you only want a quick trim. Before-iit seeks faster. - Setting CRF too high on text or screen recordings. Sharp edges show blocks first. Screen recordings like a lower number than camera clips.
- Writing the output over the input. Always give a new file name.
When is Smol the wrong tool for this?
If you are comfortable in a terminal and compressing one clip, avconvert and ffmpeg are free and enough. Use them. You also get exact control over every flag, which Smol does not try to match. Smol is not a scripting tool for servers either.
Smol earns its one-time $29 when you would rather not write a loop: drop a mixed folder of videos on it, pick H.265 or H.264 and a quality, and get a copy of each next to the original. It also adds a Finder right-click action, and nothing is uploaded. Details are on the buy page. If you are still comparing options, see the best video compressor for Mac.
How we checked this
We ran each command on a generated 20 s 1080p clip on an Apple Silicon Mac (macOS 27.0.1, ffmpeg 8.1.1) and read avconvert --help for presets and flags. Facts last checked . We make Smol, so treat our claims about it with the same care as any vendor’s, and see our editorial policy.
Terminal video compression: common questions
Is avconvert installed on every Mac?
Yes. avconvert is part of macOS, at /usr/bin/avconvert, so there is nothing to download. Run avconvert --help to see the preset names. It uses Apple encoders, offers presets rather than a CRF setting, and is a good first choice when you just want a smaller, compatible file.
What ffmpeg CRF value should I use to compress a video?
For H.264, start at 26 and move by 2 until the file looks acceptable. 23 is ffmpeg’s default and gives larger, sharper files. For H.265, the same look needs a higher number, so start near 28. Lower CRF means bigger files. Always judge on your own footage.
Why will my H.265 file not play in QuickTime?
ffmpeg tags H.265 video as hev1 by default, which QuickTime and iPhones often reject. Add -tag:v hvc1 to the command and re-encode or remux. The video itself is fine. Only the tag differs. Apple devices expect hvc1 for HEVC inside MP4 and MOV files.
Can I compress a video without losing quality?
Not strictly. Any smaller file from a lossy codec discards some detail. What you can do is choose a CRF or preset where the loss is hard to see, and lower the resolution only if the viewer will not notice. Judge by playing both files side by side.
How do I install ffmpeg on a Mac?
The common route is Homebrew: run brew install ffmpeg in Terminal. Check it worked with ffmpeg -version. The install can take a few minutes because Homebrew may fetch several dependencies. ffmpeg is free and open source, and it is not bundled with macOS.
Keep reading