vf_format: add hdr10plus sub-parameter to format video filter

This commit is contained in:
Kacper Michajłow 2024-02-11 00:50:02 +01:00 committed by Dudemanguy
parent d9c1e9bc5c
commit 024edb2991
3 changed files with 15 additions and 0 deletions

View File

@ -62,6 +62,7 @@ Interface changes
over blending alpha components into specific background types
- add `--border-background` option
- add `video-target-params` property
- add `hdr10plus` sub-parameter to `format` video filter
--- mpv 0.37.0 ---
- `--save-position-on-quit` and its associated commands now store state files
in %LOCALAPPDATA% instead of %APPDATA% directory by default on Windows.

View File

@ -316,6 +316,10 @@ Available mpv-only filters are:
Whether or not to include Dolby Vision metadata (default: yes). If
disabled, any Dolby Vision metadata will be stripped from frames.
``<hdr10plus=yes|no>``
Whether or not to include HDR10+ metadata (default: yes). If
disabled, any HDR10+ metadata will be stripped from frames.
``<film-grain=yes|no>``
Whether or not to include film grain metadata (default: yes). If
disabled, any film grain metadata will be stripped from frames.

View File

@ -60,6 +60,7 @@ struct vf_format_opts {
bool convert;
int force_scaler;
bool dovi;
bool hdr10plus;
bool film_grain;
};
@ -178,6 +179,13 @@ static void vf_format_process(struct mp_filter *f)
});
}
if (!priv->opts->hdr10plus) {
memset(img->params.color.hdr.scene_max, 0,
sizeof(img->params.color.hdr.scene_max));
img->params.color.hdr.scene_avg = 0;
img->params.color.hdr.ootf = (struct pl_hdr_bezier){0};
}
if (!priv->opts->film_grain)
av_buffer_unref(&img->film_grain);
@ -240,6 +248,7 @@ static const m_option_t vf_opts_fields[] = {
{"dar", OPT_DOUBLE(dar)},
{"convert", OPT_BOOL(convert)},
{"dolbyvision", OPT_BOOL(dovi)},
{"hdr10plus", OPT_BOOL(hdr10plus)},
{"film-grain", OPT_BOOL(film_grain)},
{"force-scaler", OPT_CHOICE(force_scaler,
{"auto", MP_SWS_AUTO},
@ -256,6 +265,7 @@ const struct mp_user_filter_entry vf_format = {
.priv_defaults = &(const OPT_BASE_STRUCT){
.rotate = -1,
.dovi = true,
.hdr10plus = true,
.film_grain = true,
},
.options = vf_opts_fields,