sudo apt update && sudo apt install ffmpeg
ffmpeg -i input.mp4 -vf scale=-2:480 -c:v libx264 -crf 23 -c:a copy output.mp4
ffmpeg -i input.mp4 -vf scale=-2:480 -c:v libx264 -crf 23 -threads 2 -c:a copy output.mp4
Even gentler on the CPU
ffmpeg -i input.mp4 -vf scale=-2:480 -c:v libx264 -crf 23 -preset slower -threads 2 -c:a copy output.mp4
| Option | Meaning |
|---|---|
| -vf scale=-2:480 | Resize to 480p height, auto-width (keeps aspect ratio) |
| -c:v libx264 | H.264 video codec (widely compatible) |
| -crf 23 | Quality level — lower = better quality, larger file (range: 0–51) |
| -preset slower | Slower encoding = less CPU spike + better compression |
| -threads 2 | Limit to 2 CPU threads |
| -c:a copy | Copy audio as-is without re-encoding |
For a background job that won't compete with your other tasks, you can also combine it with nice
nice -n 19 ffmpeg -i input.mp4 -vf scale=-2:480 -c:v libx264 -crf 23 -threads 2 -c:a copy output.mp4
Install cpulimit
sudo apt install cpulimit
cpulimit -l 50 -- ffmpeg -i input.mp4 -vf scale=-2:480 -c:v libx264 -crf 23 -c:a copy output.mp4
Replace 50 with your desired CPU percentage cap.
- 100 = 100% of one core
- 200 = 100% of two cores
- So on a 4-core CPU, 400 would be full usage, 50 would be ~12.5% of total capacity
This means if you want to cap FFmpeg to, say, 30% of your total CPU on a 4-core machine, you'd use -l 120 (4 cores × 100 × 0.30).
For a background job that won't compete with your other tasks, you can also combine it with nice
nice -n 19 cpulimit -l 50 -- ffmpeg -i input.mp4 -vf scale=-2:480 -c:v libx264 -crf 23 -c:a copy output.mp4