[FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: set keep_aspect to true for the crop filter
James Almer
jamrial at gmail.com
Tue Jul 9 22:06:26 EEST 2024
The input sample aspect ratio applies to the pre-cropping dimensions, so update it.
Signed-off-by: James Almer <jamrial at gmail.com>
---
fftools/ffmpeg_filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 097bd2ed48..0d85c30aba 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1703,7 +1703,7 @@ static int configure_input_video_filter(FilterGraph *fg, AVFilterGraph *graph,
if ((ifp->opts.flags & IFILTER_FLAG_CROP)) {
char crop_buf[64];
- snprintf(crop_buf, sizeof(crop_buf), "w=iw-%d-%d:h=ih-%d-%d:x=%d:y=%d",
+ snprintf(crop_buf, sizeof(crop_buf), "w=iw-%d-%d:h=ih-%d-%d:x=%d:y=%d:keep_aspect=1",
ifp->opts.crop_left, ifp->opts.crop_right,
ifp->opts.crop_top, ifp->opts.crop_bottom,
ifp->opts.crop_left, ifp->opts.crop_top);
--
2.45.2
More information about the ffmpeg-devel
mailing list