[FFmpeg-devel] [PATCH 5/6] avfilter/vf_colorspace: strip color volume metadata

Niklas Haas ffmpeg at haasn.xyz
Fri Apr 26 15:28:02 EEST 2024


From: Niklas Haas <git at haasn.dev>

---
 libavfilter/vf_colorspace.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 7bacd7892a..46c442f3fb 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -750,6 +750,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
     } else {
         out->color_trc   = s->user_trc;
     }
+
+    if (out->color_primaries != in->color_primaries || out->color_trc != in->color_trc)
+        av_frame_remove_side_data_changed(out, AV_FRAME_CHANGED_COLOR_VOLUME);
+
     if (rgb_sz != s->rgb_sz) {
         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(out->format);
         int uvw = in->width >> desc->log2_chroma_w;
-- 
2.44.0



More information about the ffmpeg-devel mailing list