FFMPEG Documentation
Useful commands and parameter reference for video processing.
Links
Commands
Basic command for high-quality compression:
ffmpeg -i input.mp4 -vf "scale=-2:720" -c:v libx264 -preset slow -crf 30 -pix_fmt yuv420p -movflags +faststart -an output_new.mp4
Parameters Reference
| Parameter | Controls | Options | Notes |
|---|---|---|---|
| -i input.mp4 | Input file | any file | Main argument. |
| -c:v libx264 | Video codec | libx264 | Best compatibility. |
| -preset X | Speed/Comp | slow, medium, fast | Slower = smaller file. |
| -crf N | Constant Quality | 18–32 | Lower = better quality. |
| -vf "scale=-2:720" | Scaling | scale=-2:720 | Preserves aspect ratio. |
| -an | Remove audio | (flag) | Great for size reduction. |
| -movflags +faststart | Web Opt | +faststart | Better for streaming. |
Compatibility Warnings
Avoid using these parameters together as they interfere with each other:
- CRF vs Bitrate: Choose one main strategy.
- CRF vs QP: Different quality modes; don't mix.
- 2-Pass vs CRF: 2-pass is for target bitrate only.