[FFmpeg-trac] #11507(avfilter:new): vpp_qsv tonemapping and color space conversion does not change metadata
FFmpeg
trac at avcodec.org
Thu Mar 13 20:56:00 EET 2025
#11507: vpp_qsv tonemapping and color space conversion does not change metadata
----------------------------------------+----------------------------------
Reporter: Nathan Fendley | Type: defect
Status: new | Priority: normal
Component: avfilter | Version: 7.1
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------------+----------------------------------
Summary of the bug:
When you use these options in {{{vpp_qsv}}} on any Intel GPU:
{{{
out_color_matrix <string> ..FV....... Output color matrix coefficient
set
out_color_primaries <string> ..FV....... Output color primaries
out_color_transfer <string> ..FV....... Output color transfer
characteristics
tonemap <int> ..FV....... Perform tonemapping (0=disable
tonemapping, 1=perform tonemapping if the input has HDR metadata) (from 0
to 1) (default 0)
}}}
the metadata of the output is not changed to match the new color
information. On the other hand, {{{tonemap_vaapi}}} does this properly.
The video outputs look identical when played in VLC between {{{vpp_qsv}}}
and {{{tonemap_vaapi}}} but not identical to playing the original HDR
input, so something more than just incorrect metadata may be going on.
How to reproduce:
Use a system with an Intel media engine that has both the VAAPI and QSV
APIs working properly, and use any HDR video that's possible to decode
with the media engine.
{{{
# Does not work as intended, outputs a video that *says* it's BT.2020 with
HDR metadata but the video still comes out right
% ffmpeg -hwaccel qsv -hwaccel_output_format qsv -i HWDEC_HDR_INPUT.mkv
-vf
vpp_qsv=scale_mode=hq:format=p010:tonemap=1:out_color_matrix=bt709:out_color_primaries=bt709:out_color_transfer=bt709
-c:v hevc_qsv -global_quality:v 26 -an -sn OUTPUT_BAD_META.mkv
# Works as intended, produces correctly tagged BT.709 SDR
% ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i
HWDEC_HDR_INPUT.mkv -vf tonemap_vaapi=format=p010:m=bt709:p=bt709:t=bt709
-c:v hevc_vaapi -rc_mode ICQ -q:v 26 -an -sn OUTPUT_PROPER.mkv
ffmpeg version n7.1 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 14.2.1 (GCC) 20250207
from Arch Linux repos
}}}
Relevant mediainfo from source:
{{{
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0050 cd/m2, max: 1000
cd/m2
Maximum Content Light Level : 186 cd/m2
Maximum Frame-Average Light Level : 147 cd/m2
}}}
from {{{vpp_qsv}}} tonemap (metadata I believe to be false):
{{{
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0050 cd/m2, max: 1000
cd/m2
Maximum Content Light Level : 186
MaxCLL_Original : 186 cd/m2
Maximum Frame-Average Light Level : 147
MaxFALL_Original : 147 cd/m2
}}}
from {{{tonemap_vaapi}}}:
{{{
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11507>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list