video_writer: fix gamma for YUV screenshots

reproduction steps: take any lossy WebP screenshot and check the colors
(or JPEG without libjpeg support, or AVIF with tag-colorspace=no)
fixes: 6d9e72cd89
This commit is contained in:
sfan5 2023-07-24 23:45:31 +02:00
parent 90410cc17e
commit bc96b23ef6
1 changed files with 2 additions and 2 deletions

View File

@ -633,9 +633,9 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt,
mp_image_params_guess_csp(&p); mp_image_params_guess_csp(&p);
if (!image_writer_flexible_csp(opts)) { if (!image_writer_flexible_csp(opts)) {
// Formats that don't support non-sRGB csps should be forced to sRGB // If our format can't tag csps, set something sane
p.color.primaries = MP_CSP_PRIM_BT_709; p.color.primaries = MP_CSP_PRIM_BT_709;
p.color.gamma = MP_CSP_TRC_SRGB; p.color.gamma = MP_CSP_TRC_AUTO;
p.color.light = MP_CSP_LIGHT_DISPLAY; p.color.light = MP_CSP_LIGHT_DISPLAY;
p.color.sig_peak = 0; p.color.sig_peak = 0;
if (p.color.space != MP_CSP_RGB) { if (p.color.space != MP_CSP_RGB) {