Crop a video using ffmpeg

NILIf you ever need to crop a video, which mean that you want to reduce the area

of the video to a square of it to trim areas you don't want.

This is possible with ffmpeg using the video filter crop.

To make the example more readable, I replaced values with variables names:

So the actual commands look like

ffmpeg -i input_video.mp4 -filter:v "crop=$WIDTH:$HEIGHT:$START_LEFT:$START_TOP" output_video.mp4

If you want to crop the video to get a 320x240 video from the top-left

position 500,100 the command would be

ffmpeg -i input_video.mp4 -filter:v "crop=320:240:500:100" output_video.mp4

Proxy Information
Original URL
gemini://perso.pw/blog//articles/ffmpeg-crop.gmi
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
167.351594 milliseconds
Gemini-to-HTML Time
0.405673 milliseconds

This content has been proxied by September (3851b).