Browser FFmpeg recipe
Compress Video Online with FFmpeg
Create a smaller MP4 while keeping broadly compatible video and audio codecs.
Command
Run this FFmpeg command
ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 128k compressed.mp4When to use it
- email attachments
- web uploads
- faster sharing
- storage cleanup
How it works
- Upload the source video.
- Use CRF compression to reduce file size.
- Run the command and download the compressed MP4.
Option reference
| Option | What it does |
|---|---|
-c:v libx264 | Encodes video with H.264. |
-crf 28 | Controls quality and size. Higher values make smaller files. |
-preset fast | Balances encoding speed and compression. |
-b:a 128k | Sets a compact audio bitrate. |
Practical notes
- Try CRF 23 for higher quality or CRF 30 for smaller files.
- Large videos may take time because browser FFmpeg runs on your device.
FAQ
What CRF value should I use?
For H.264, 23 is a common quality baseline. 28 is smaller, and 30 or higher is more aggressive.
Will compression reduce quality?
Yes, lossy compression trades some quality for a smaller file size.