Task:
Crop out the right middle area of a small video.
Solutions:
$ ./ffmpeg -i Promo1.mp4 -filter:v "crop=320:180:iw-320:ih-240" promo1cropped.mp4
The code above crops from the right and lower edges of the video image.
$ ./ffmpeg -i Promo1.mp4 -filter:v "crop=100:100" promo1croppedcenter.mp4
The code above crops out 100 pixels from the center of the video image.
$ ./ffmpeg -i Promo1.mp4 -filter:v "crop=100:100:0:0" promo1croppedtopleft.mp4
The code above crops out 200 pixels from the starting from the top left edge of the video image.
$ ./ffmpeg -i Promo1.mp4 -filter:v "crop=ih/3*4:ih" promo1cropped4by3center.mp4
Assuming the input video is in 16:9 format, or anything wider than 3:4. The code above crops out the left and right sides from the starting from the top left edge of the image.
$ ./ffmpeg -i Promo1.mp4 -filter:v "crop=100:100:iw-100:0" promo1croppedkeep100pxtopright.mp4
Crops and keeps only the top right 100px by 100px corner of a video.
previous page
|