Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th November 2017, 08:25   #1  |  Link
mmace
Registered User
 
Join Date: Mar 2007
Posts: 123
HEVC HDR to x264 8 bit non-hdr

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
mmace is offline   Reply With Quote
Old 20th November 2017, 16:58   #2  |  Link
kamivh1
Registered User
 
Join Date: May 2012
Posts: 4
this is my problem too
can anyone help??
kamivh1 is offline   Reply With Quote
Old 20th November 2017, 19:20   #3  |  Link
x265_Project
Guest
 
Posts: n/a
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.
  Reply With Quote
Old 20th November 2017, 19:43   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
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
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 20th November 2017, 21:32   #5  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 324
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.

Last edited by excellentswordfight; 20th November 2017 at 21:40.
excellentswordfight is offline   Reply With Quote
Old 20th November 2017, 22:52   #6  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
Quote:
Originally Posted by x265_Project View Post
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.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 21st November 2017, 02:49   #7  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
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.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 10th December 2017, 16:39   #8  |  Link
Yoshi
Registered User
 
Join Date: Apr 2014
Posts: 32
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?
Yoshi is offline   Reply With Quote
Old 13th December 2017, 16:37   #9  |  Link
zub35
Registered User
 
Join Date: Oct 2016
Posts: 56
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)

Last edited by zub35; 13th December 2017 at 22:10.
zub35 is offline   Reply With Quote
Old 16th December 2017, 13:51   #10  |  Link
xabregas
Registered User
 
Join Date: Jun 2011
Posts: 121
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.
xabregas is offline   Reply With Quote
Old 16th December 2017, 16:33   #11  |  Link
Weyoun
Registered User
 
Join Date: Jul 2017
Posts: 11
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.
Weyoun is offline   Reply With Quote
Old 16th December 2017, 20:11   #12  |  Link
xabregas
Registered User
 
Join Date: Jun 2011
Posts: 121
Might be good to test it downscaling to 1080p as its less time consuming. Encoding 4K to 4k in x264 its beyond crazy.
xabregas is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.