← Back to Week 02

FFMPEG Documentation

Useful commands and parameter reference for video processing.

Links

Official Download Page →

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.mp4Input fileany fileMain argument.
-c:v libx264Video codeclibx264Best compatibility.
-preset XSpeed/Compslow, medium, fastSlower = smaller file.
-crf NConstant Quality18–32Lower = better quality.
-vf "scale=-2:720"Scalingscale=-2:720Preserves aspect ratio.
-anRemove audio(flag)Great for size reduction.
-movflags +faststartWeb Opt+faststartBetter for streaming.

Compatibility Warnings

Avoid using these parameters together as they interfere with each other: