Hello, and thanks in advance for any help.
I was gifted a UHD Blu-ray but don't have a 4K TV, so I figured I'd do the color conversion and resizing losslessly with VirtualDub2-UtVideo then shrivel that as I normally would with MeGUI-AviSynth. Unfortunately, after several days and many hours, I can't for the life of me figure out how to tonemap BT.2020 to BT.709. I've tried everything from the seemingly obvious
to HDRTools plugin andCode:ColorMatrix(Mode="Rec.2020->Rec.709")
with no noticeable change in the video's colors. Please, can anyone offer a solution (or a link to a tutorial)?Code:ConvertYUVtoXYZ(Color=1) ConvertXYZtoYUV(pColor=1)
Ahhh, here's a test clip.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 18 of 18
Thread
-
Last edited by LouieChuckyMerry; 4th Jun 2023 at 15:31. Reason: Link To Test Clip
-
Search the forum for "tonemap" lots of discussion.
It was mentioned that Handbrake\Vidcoder seemed to do it if you select bt.709 in Filters\Colorspace
Here's an Avisynth example:
Code:lwlibavvideosource("C:\Users\Public\Videos\Mamma Mia_sample2_HEVC_HDR_re-encode.mp4") ConvertBits(10) # Use 12 for 12-bit z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none") # Choose one of these: DGReinhard() #DGHable() z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered")
-
Thanks for your reply, davexnet. Honest, I searched for many hours, and on more than this forum. I've looked into HandBrake but am running Win 7, so the latest version is rather old (plus, the only "lossless" options are either x264 or x265 with a CRF of 0 which, after more searching, makes me wonder if it's actually lossless). I'd prefer VirtualDub2/UtVideo for the first pass, and appreciate your above script, but it seems the syntax is off because, even after trying to correct it, I receive error messages that I'm unable to overcome. Unfortunately I'm Extremely CLI Challenged, so ffmeg is too daunting (I'll search for a GUI, though). Anyway, if I find a solution that seems acceptable I'll post it here so that others searching for a solution can find one (hence, the title of my post which, to be fair, is probably technically incorrect ).
-
Trying to change title of post... "Preview Changes" shows the new title... Sigh...
Last edited by LouieChuckyMerry; 5th Jun 2023 at 19:19. Reason: Still Trying...
-
The syntax is fine, you may have some external filters missing, eg. DGTonemap and possibly L-Smash Works (for LWLibavvideosource)
http://avisynth.nl/index.php/DGTonemap
https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works/releases
older releases of Lsmash here:
https://github.com/HolyWu/L-SMASH-Works/releases/Last edited by davexnet; 5th Jun 2023 at 21:42.
-
Thanks again for your help, davexnet. I already index with L-Smash Works and have DGTonemap in my Plugins folder; however, when I attempt to run your script in VirtualDub2 I receive the error message "There is no function named 'z_ConvertFormat'."
Edit: Maybe I need to manually load DGTonemap? I'll try...
EditEdit: Nope, same error message. Here's my script (using AviSynth+):
Code:LoadPlugin("FilePath\LSMASHSource.dll") LoadPlugin("FilePath\DGTonemap.dll") LWLibavVideoSource("FilePath.mkv", format="YUV420P8") SetFilterMTMode("Default_MT_Mode",2) ConvertBits(10) # Use 12 for 12-bit z_ConvertFormat(pixel_type="RGBPS",colorspace_op="2020ncl:st2084:2020:l=>rgb:linear:2020:l", dither_type="none") # Choose one of these: DGReinhard() #DGHable() z_ConvertFormat(pixel_type="YV12",colorspace_op="rgb:linear:2020:l=>709:709:709:l",dither_type="ordered") PreFetch(5)
Last edited by LouieChuckyMerry; 6th Jun 2023 at 19:49. Reason: A Thought; And, More Information
-
Looks like you also need this...
http://avisynth.nl/index.php/Avsresize -
You can do the colorspace change and the resize at the same time.
Take clever Ffmpeg-GUI, load your video, click main, click encode videostream, click resize.
Make your settings and click encode.
[Attachment 71533 - Click to enlarge]
When that's done, click multiplex and mux your new video. -
davexnet: Thank you, I'll try to carve out some time tonight to add AVSResize to my Plugins folder (I need to wait for an encode to finish).
_____________
ProWo: Wow, excellent timing (and thanks for your reply). I went hunting for an FFMpeg GUI yesterday and settled on clever FFMpeg-GUI for my first to try (thanks for your GUI, too; I especially appreciated the set up guide upon first opening), so thank you also for the above picture. After color conversion and resizing I plan to encode the result with my usual AviSynth script using MeGUI (denoising, sharpening, debanding, etc.), so I'd like to do the first bit losslessly. I'd normally use VirtualDub2/UtVideo; do you have a recommendation for a lossless codec in clever FFMPeg-GUI?Last edited by LouieChuckyMerry; 7th Jun 2023 at 12:31. Reason: Information; Information
-
-
Last edited by ProWo; 10th Jun 2023 at 15:07. Reason: typo
-
ProWo: What an awesome GUI . And the choice of color is a very nice touch. Thanks again .
-
ProWo: I was excited to run some tests today but clever FFMpeg-GUI "opens" minimized and can't be maximized so there's no GUI. This happens on two computers, both running Win 7, even after reboots. Any ideas?
-
-
Having some time this weekend I ran some tests on a short clip to compare six different methods of tonemapping:
1) AviSynth[davexnet's Above Script + Downscaling]
2) clever FFMpeg-GUI[Reinhard + Downscaling]
3) clever FFMpeg-GUI[Hable + Downscaling]
4) HandBrake[Colorspace BT.709 + Downscaling]
5) Avidemux[Reinhard + Downscaling]
6) Avidemux[Hable + Downscaling]
I didn't note speed because not every method displays that information and I did no fine-tuning of the settings because not every method allowed for that. Here are the results (in the above order):
1,1:
[Attachment 71652 - Click to enlarge]
2,1:
[Attachment 71653 - Click to enlarge]
3,1:
[Attachment 71654 - Click to enlarge]
4,1:
[Attachment 71655 - Click to enlarge]
5,1:
[Attachment 71656 - Click to enlarge]
6,1:
[Attachment 71657 - Click to enlarge]
1,2:
[Attachment 71658 - Click to enlarge]
2,2:
[Attachment 71659 - Click to enlarge]
3,2:
[Attachment 71660 - Click to enlarge]
4,2:
[Attachment 71661 - Click to enlarge]
5,2:
[Attachment 71662 - Click to enlarge]
6,2:
[Attachment 71663 - Click to enlarge]
To my eyes the results with HandBrake are the worst, but to be fair I'm running Win 7 and the last version of HandBrake I can use, 1.4.2, is verrrrrry old. I also think the davexnet's AviSynth script is not so good but, again to be fair, I don't know enough to make the necessary adjustments (although I'm sure davexnet does ). Clever FFMpeg-GUI with Hable is a bit dark, but it's results with Reinhard look good. Avidemux's two results are quite similar but I find the Hable a bit too bright. So, down to clever FFMpeg-GUI with Reinhard and Avidemux with Reinhard I'd pick clever FFMpeg-GUI for the indoor scene, given it's light from candles and through stained glass, but Avidemux for the outdoor scene. Both clever FFMpeg and Avidemux's settings are tweakable so I'd do some more testing until happy (or I could beg ProWo for some advice ).
_____________
EDIT: I just noticed that I failed to downscale a couple of the test clips but it seems to me that that shouldn't affect the colors (but, hey, I've been wrong many times before).Last edited by LouieChuckyMerry; 11th Jun 2023 at 15:19. Reason: Grammar; Syntax; Resolution
Similar Threads
-
Convert Color Space (BT.709 to BT.601) Without Reencoding?
By jorel221 in forum Video ConversionReplies: 3Last Post: 18th Apr 2023, 07:03 -
Color conversion
By salvo00786 in forum DVD RippingReplies: 16Last Post: 12th Sep 2022, 13:41 -
Converting BT.2020 down to BT.709
By THRobinson in forum Video ConversionReplies: 15Last Post: 19th Jan 2021, 14:41 -
10bit BT.2020 HDR content to 10Bit BT.2020 WITHOUT HDR metadata
By wmplib in forum Video ConversionReplies: 3Last Post: 10th Apr 2020, 07:44 -
color conversion
By Aludin in forum Newbie / General discussionsReplies: 23Last Post: 6th Aug 2019, 10:26