From 9a7291d48ea8ee9c661a7a1f70de1c75cad17336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 20 Oct 2023 04:53:15 +0200 Subject: [PATCH] mp_image: set crop metadata when converting to AVFrame So it is not lost after filtering. --- video/mp_image.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/video/mp_image.c b/video/mp_image.c index 5c4f30b686..d5ce8da14b 100644 --- a/video/mp_image.c +++ b/video/mp_image.c @@ -1141,6 +1141,11 @@ struct AVFrame *mp_image_to_av_frame(struct mp_image *src) dst->width = src->w; dst->height = src->h; + dst->crop_left = src->params.crop.x0; + dst->crop_top = src->params.crop.y0; + dst->crop_right = dst->width - src->params.crop.x1; + dst->crop_bottom = dst->height - src->params.crop.y1; + dst->sample_aspect_ratio.num = src->params.p_w; dst->sample_aspect_ratio.den = src->params.p_h;