Vapoursynth HDR to SDR not working as expected - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html) +--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html) +--- Thread: Vapoursynth HDR to SDR not working as expected (/thread-2848.html) |
Vapoursynth HDR to SDR not working as expected - Brutoloco - 08.08.2022 I don't know much about this matter, so I've started to find out about it. I wanted to convert a movie with HDR to SDR using Hybrid. And I've found that the Vaporsynth's conversion filters don't work as expected. Or am I doing something wrong. The image is either more whitish or gray, or even worse than what it looks like without HDR processing. None of the filters or options seem to give an acceptable result. However, I have seen that by using "No XSynth", and enabling Tonemap in the FFMPEG tab. The result seems to be what is expected with any of your options. I have also tried to use a conversion from HDR to SDR through the Nvenc codec, and that has worked perfectly. The Avisynth filter doesn't seem to have any options. Apart from this, I don't understand much about it, but I have also noticed that, when in VUI, I believe that in any of the codecs, the options "transfer characteristics" and "color primaries" are activated, to input, without adding any other option to proccess, the result doesn't look whitish, and it appears to have been converted to SDR somehow. The test video that I am using, a piece of the film, has these characteristics. Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main 10@L5.1@High HDR format : SMPTE ST 2086, HDR10 compatible Codec ID : V_MPEGH/ISO/HEVC Duration : 31 s 407 ms Bit rate : 9 606 kb/s Width : 3 840 píxeles Height : 2 160 píxeles Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23,976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 (Type 2) Bit depth : 10 bits Bits/(Pixel*Frame) : 0.048 Stream size : 36,0 MiB (93%) Default : Yes Forced : No 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 : 1000 cd/m2 Maximum Frame-Average Light Level : 180 cd/m2 RE: Vapoursynth HDR to SDR not working as expected - Selur - 08.08.2022 Since you didn't read the sticky and provide essential information like a debug output or what OS you are on I tried to reproduce this using a file from https://4kmedia.org/lg-new-york-hdr-uhd-4k-demo/. I can confirm that for some reason "Filtering->Vapoursynth->Color->HDR to SDR" "HDR10ToSDR" and "ToneMap" do not seem to work as they should. 'HDR10 to SDR (DG)' and 'ToneMap (Placebo)' seem to work fine. (later is not available in the version you use and former is Windows only) Using https://4kmedia.org/lg-colors-of-journey-demo/ as sample, HDR10ToSDR and ToneMap seem to work fine. HDR10ToSDR(Hable): HDR10ToSDR(Simple): ToneMap(Hable): ToneMap(Möbius): ToneMap(Reinhard): -> I'll try to figure out why those two filters do not work as they should on some source, this evening after work. Cu Selur RE: Vapoursynth HDR to SDR not working as expected - Selur - 08.08.2022 Had a quick look and the issue seems that Hybrid sets the Transfer information to a wrong value. MediaInfo report: Color range : Limited clip = clip if not core.text.FrameProps(clip,'_Transfer') else core.std.SetFrameProps(clip, _Transfer=9) -> I'll fix it after work. Cu Selur RE: Vapoursynth HDR to SDR not working as expected - Selur - 08.08.2022 Got on it before work, send you a link to a dev version via pm. Cu Selur RE: Vapoursynth HDR to SDR not working as expected - Brutoloco - 08.08.2022 I'm sorry I didn't provide the debug and more information. I'm using Windows 11. I forgot to mention that with some options the real result is far from what you see in the preview. For example, it is very noticeable with the ToneMap (Placebo). The result does not match the preview. But maybe this only happens with the video I'm using. I have downloaded the dev version, and used the test video that I used at the beginning. I've done some testing with the different options, and something seems to be wrong with Vapoursynth or some setting, or it's because of the HDR version of the test video I'm using. I've seen that LG's test video youu linked, doesn't show the entry "HDR format: XXXXXX" in the mediainfo, as it does in the one I'm using, maybe it has something to do with it. I don't know much about it, I know there are are several HDR formats, and it seems that it doesn't necessarily appear in Mediainfo.
But the thing is, converting FFMPEG Tonemap with NoXsynth or Nvenc HDR to SDR, with either option, gives a much more natural and colorful and bright result, and it doesn't look weird at all. Vapoursynth: HDR10 to SDR --> Brighter but Tarnish colors Tonemap (Mobius) --> Brighter but Tarnish colors HDR10 to SDR (DG) --> Colors seems better, but very dark Tonemap (Placebo) --> Although is ok in preview, seems that did nothing in the result, tarnish colors and whitish NoXSynth: FFMPEG Tonemap (Mobius)--> OK (perfect) NVenc HDR to SDR (Bt2390)--> OK (perfect) I need a day or some to do some more tests with the other video test, that I can't do right now because I'm processing. Debug output after processing with Tonemap (Placebo), which in vapoursynth preview seems ok, but the result if equal as original video on a player which not process HDR. RE: Vapoursynth HDR to SDR not working as expected - Selur - 08.08.2022 Since you are using HDR->SDR using '--colormatrix bt2020nc ' is wrong, that's a HDR color matrix. Try bt709 instead. (this would explain, why the preview and the encoded colors differ) Cu Selur Ps.: just for completeness Filtering->Vapoursynth->Color->Matrix->TimeCube also has some matrices for HDR to SDR conversion. PPs.: Also note that NVEnc and FFmpeg->ToneMap both use different default settings for Hable&Co. So it's to be expected that you will different results with the default value. |