View Full Version : HEVC HDR to x264 8 bit non-hdr
mmace
20th November 2017, 08:25
Hi guys, apologies if this is the wrong sub-forum but I'm hoping for some help...
I have some UHD HDR movies (seem to be the only ones available in UHD) that are in x265/HEVC. I need to transcode to x264 (hardware not fast enough for HEVC) and I also need to make them non-HDR as my UHD TV isn't HDR and my players (PC, Android and the TV itself) show the videos as very washed out with barely any colour.
I've been using handbrake to transcode HEVC to x264 but I'm not sure of the best way to do this, can anyone advise?
Thank you
kamivh1
20th November 2017, 16:58
this is my problem too
can anyone help??
x265_Project
20th November 2017, 19:20
HDR content has a different color space (ITU-R Recommendation 2020) than SDR (ITU-R Recommendation BT.709). Encoders (x264 or x265, for example) don't do any color space conversion.
Selur
20th November 2017, 19:43
iirc MPC-HC has an option to playback HDR on non-HDR displays, may be someone can create a Vapoursynth/Avisynth filter that does the same,... but I agree this is not something that should be part of the encoder itself
HDR10 -> SDR: https://forum.doom9.org/showthread.php?p=1800675
excellentswordfight
20th November 2017, 21:32
The biggest problem is not the color space but the transfer curve. HDR10 (e.g) is graded way differently than SDR-material so you need apply something like a LUT to convert it for it to look OK with a normal transfer curve. I have tried a few, with acceptable results, but never got the tonal curve/contrast before and after to be simulair enough for my taste.
It would be very nice to get the conversion method from madVR as a standalone filter (for avisynth or similar), the method used there is way better then anything I have tried at least.
nevcairiel
20th November 2017, 22:52
HDR content has a different color space (ITU-R Recommendation 2020) than SDR (ITU-R Recommendation BT.709). Encoders (x264 or x265, for example) don't do any color space conversion.
Thats quite the generalization. BT.2020 is not exclusive to HDR, any UHD content can/should use it, although some UHD stuff is still encoded in "legacy" 709.
There is still quite the conversion to be done from HDR to SDR, but you don't necessarily have to convert away from BT.2020.
Asmodian
21st November 2017, 02:49
Is there anything in avisynth or vaporsynth that can do an HDR to SDR conversion? I have HD versions of everything I have UHD HDR copies of (HD+UHD combo editions) but I wouldn't know where to start if I wanted to even directly transcode a UHD HDR blu-ray without any conversions, let alone convert HDR to SDR.
BT.2020 to BT.709 is easy, it is preserving the metadata or doing the HDR or SDR tone mapping using it that I have no idea how to do.
Yoshi
10th December 2017, 16:39
What would already help would be a possibility to feed some H.264 encoder with madVR's output as its results in terms of HDR->SDR conversion including dithering should be more than decent to start any encoding process with.
Hence the question to everyone: any tool around which is able to capture a player's output in conjunction with madVR and feeding that to let's say x264?
zub35
13th December 2017, 16:37
You can try using software for screen capture the stream issued by madVR in lossless compress, and then compress it into x264.
While this is the only quality way ... alas.
HDR - madVR - screen_capture (lossless or crf<10) - x264 (SDR)
xabregas
16th December 2017, 13:51
Mpv does a good job playing back those files by default on 8bit FullHD Tvs without the need of doing anything. Just open it in MPV and the colors are correct. So, as mpv uses ffmpeg, maybe if you screw around with ffmpeg settings you might achieve an ~accurate color space and then encode it to x264 8 bits ( Which for the moment is the most compatible we can get ) but you need to test it against source several times until the color satisfies you.
Weyoun
16th December 2017, 16:33
Try one of the following in ffmpeg and see what happens:
-vf zscale=w=3840:h=-1:f=bicubic:d=error_diffusion:range=full -pix_fmt yuv444p
-vf scale=w=3840:h=-1 -sws_flags bicubic -sws_dither ed -pix_fmt yuv444p
I remember one of them was better than the other but I can't recall which one at this time, but a quick 10 second sample will tell you.
You will have to change the 3840 to match the width of your video if it is not 3840.
I tried using madVR before but found it over saturated some colors to ridiculous degree depending on the scene.
xabregas
16th December 2017, 20:11
Might be good to test it downscaling to 1080p as its less time consuming. Encoding 4K to 4k in x264 its beyond crazy.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.