summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-02-11 00:50:02 +0100
committerDudemanguy <random342@airmail.cc>2024-03-09 05:58:52 +0000
commit024edb29913cbef676ebdc234afe91193849de20 (patch)
tree5cf681de82bfe5c55cb5aa7d306e628cb7fd7347
parentd9c1e9bc5c8ca5e4a75b197789b77890375cb8e2 (diff)
downloadmpv-024edb29913cbef676ebdc234afe91193849de20.tar.bz2
mpv-024edb29913cbef676ebdc234afe91193849de20.tar.xz
vf_format: add hdr10plus sub-parameter to format video filter
-rw-r--r--DOCS/interface-changes.rst1
-rw-r--r--DOCS/man/vf.rst4
-rw-r--r--video/filter/vf_format.c10
3 files changed, 15 insertions, 0 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst
index 146ed0f6b0..14557de1b5 100644
--- a/DOCS/interface-changes.rst
+++ b/DOCS/interface-changes.rst
@@ -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.
diff --git a/DOCS/man/vf.rst b/DOCS/man/vf.rst
index 1d067e31f4..59175e79ef 100644
--- a/DOCS/man/vf.rst
+++ b/DOCS/man/vf.rst
@@ -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.
diff --git a/video/filter/vf_format.c b/video/filter/vf_format.c
index 4a2916864c..f226bf22a7 100644
--- a/video/filter/vf_format.c
+++ b/video/filter/vf_format.c
@@ -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,