Posts: 228
Threads: 17
Joined: 2021 Oct
Thanks: 18
Given 78 thank(s) in 65 post(s)
Country:
2023-08-15, 10:18 AM
(This post was last modified: 2023-08-16, 03:05 AM by Bilbofett.)
This can do SDR <-> HDR back/forward conversion, realtime preview, edit metadata, MaxCLL, MaxFALL, etc.
Free trial w/ all features, limited to 1 minute export max
https://www.acrovid.com/neofootage_ai.htm
Posts: 767
Threads: 35
Joined: 2018 Feb
Thanks: 652
Given 1089 thank(s) in 412 post(s)
Country:
2025-01-21, 04:50 PM
(This post was last modified: 2025-01-21, 08:31 PM by bronan.)
I found a pretty easy way to do SDR to HDR conversion in Avisynth+. I wanted to include SDR extended scenes in an HDR main feature, which meant converting them to HDR for editing together. The key to it is FranceBB's LinearTransformations LUTs. Using the AVSCube plugin, you can load his BT601_NTSC_to_BT2100_PQ LUT that will convert standard range video to HDR. I still needed to apply a level adjustment after that to increase brightness 20% to match surrounding footage, but overall its an easy and free method with great results. The following converts standard 1080p SDR to 4K HDR that matches UHD format:
Code: LoadPlugin("vscube.dll")
deletedScenes = FFMS2("y:\Deleted Scenes.m2ts")
\.Spline36Resize(3840, 2160)
\.ConvertBits(16)
\.ConvertToPlanarRGB()
\.Cube("BT601_NTSC_to_BT2100_PQ.cube")
\.ConvertToYUV420()
\.ConvertBits(10)
\.Levels(0, 1, 816, 0, 1020)
Posts: 613
Threads: 45
Joined: 2021 Jul
Thanks: 472
Given 495 thank(s) in 245 post(s)
Country:
I really need to learn how to use avisynth
Posts: 767
Threads: 35
Joined: 2018 Feb
Thanks: 652
Given 1089 thank(s) in 412 post(s)
Country:
2025-01-21, 06:04 PM
(This post was last modified: 2025-01-21, 06:10 PM by bronan.)
(2025-01-21, 05:54 PM)stwd4nder2 Wrote: I really need to learn how to use avisynth
It's definitely a little overwhelming to start, but very powerful once you get the hang of the basics. I recommend grabbing the 64-bit Avisynth+ (it works out of the box with higher bit depth video), and AvsPmod to use as your script editor and preview. The only plugin that is really necessary is FFMS2 (basically FFMPEG in a wrapper avisynth can use), as it can open pretty much any video file with frame accuracy. Just download the latest release and put the files from the x64 folder into C:\Program Files (x86)\AviSynth+\plugins64 and you are set.
Posts: 228
Threads: 17
Joined: 2021 Oct
Thanks: 18
Given 78 thank(s) in 65 post(s)
Country:
(2025-01-21, 04:50 PM)bronan Wrote: I found a pretty easy way to do SDR to HDR conversion in Avisynth+. I wanted to include SDR extended scenes in an HDR main feature, which meant converting them to HDR for editing together. The key to it is FranceBB's LinearTransformations LUTs. Using the AVSCube plugin, you can load his BT601_NTSC_to_BT2100_PQ LUT that will convert standard range video to HDR. I still needed to apply a level adjustment after that to increase brightness 20% to match surrounding footage, but overall its an easy and free method with great results. The following converts standard 1080p SDR to 4K HDR that matches UHD format:
Code: LoadPlugin("vscube.dll")
deletedScenes = FFMS2("y:\Deleted Scenes.m2ts")
\.Spline36Resize(3840, 2160)
\.ConvertBits(16)
\.ConvertToPlanarRGB()
\.Cube("BT601_NTSC_to_BT2100_PQ.cube")
\.ConvertToYUV420()
\.ConvertBits(10)
\.Levels(0, 1, 816, 0, 1020)
Great find and tip, thanks! P.S. Why didn't you just leave it in 16-bit? Thats 2 color conversions you're doing
Posts: 1,128
Threads: 28
Joined: 2015 Jan
Thanks: 716
Given 326 thank(s) in 216 post(s)
2025-01-24, 10:05 AM
(This post was last modified: 2025-01-24, 10:41 AM by CSchmidlapp.)
(2025-01-24, 04:27 AM)Bilbofett Wrote: Great find and tip, thanks! P.S. Why didn't you just leave it in 16-bit? Thats 2 color conversions you're doing
AVScube only allows RGBP16 color space.
DGcube (a CUDA varient if you have an appropriate Nvidia card) allows RGBP16 and YUV420P16 (with a few "limits"), so you can keep in YUV 4.2.0 but still have to do bit depth changes.
Script im currently playing with based on above...
Code: LWLibavVidioSource("VIDEO FILE")
z_ConvertFormat(pixel_type="YUV420P16")
DGCube("BT601_NTSC_to_BT2100_PQ.cube", in ="lim", lut="full", out="lim", interp="tetrahedral")
z_ConvertFormat(pixel_type="YUV420P10")
v=Levels(0, 1, 816, 0, 1020)
a=LWLibavAudioSource("VIDEO FILE", stream_index=2)
audiodub(v, a)
Posts: 143
Threads: 1
Joined: 2021 Apr
Thanks: 276
Given 41 thank(s) in 28 post(s)
Country:
Can you show some examples?
HDR BT 2020 is not an easy colour space to grade.
But may be useful for simple tasks.
Posts: 767
Threads: 35
Joined: 2018 Feb
Thanks: 652
Given 1089 thank(s) in 412 post(s)
Country:
2025-01-24, 05:09 PM
(This post was last modified: 2025-01-24, 05:11 PM by bronan.)
(2025-01-24, 04:27 AM)Bilbofett Wrote: Great find and tip, thanks! P.S. Why didn't you just leave it in 16-bit? Thats 2 color conversions you're doing
It seemed to work OK without the 16-bit line, but that code is straight from the LinearTransformations Git so I decided to not question it  He says the following:
Code: The transformation is performed with 16bit precision, which means that if your input source is lower, let's say, 8bit planar yv12, it will be brought to 16bit planar RGB internally, the linear transformation will be applied with 16bit planar precision and then the result will be brought down to 8bit planar yv12.
Planar RGB 16bit is strongly suggested as your source as it's gonna be faster, in fact 4:2:0, 4:2:2, 4:4:4 planar up to 16bit will be converted back and forth internally.
How to use my LUTs in Avisynth without using the function "Linear Transformation()":
FFVideoSource("example.mxf")
ConvertBits(16)
ConvertToPlanarRGB()
Cube("C:\Programmi\AviSynth+\LUTs\example.cube")
Posts: 228
Threads: 17
Joined: 2021 Oct
Thanks: 18
Given 78 thank(s) in 65 post(s)
Country:
(2025-01-24, 05:09 PM)bronan Wrote: (2025-01-24, 04:27 AM)Bilbofett Wrote: Great find and tip, thanks! P.S. Why didn't you just leave it in 16-bit? Thats 2 color conversions you're doing
It seemed to work OK without the 16-bit line, but that code is straight from the LinearTransformations Git so I decided to not question it He says the following:
Code: The transformation is performed with 16bit precision, which means that if your input source is lower, let's say, 8bit planar yv12, it will be brought to 16bit planar RGB internally, the linear transformation will be applied with 16bit planar precision and then the result will be brought down to 8bit planar yv12.
Planar RGB 16bit is strongly suggested as your source as it's gonna be faster, in fact 4:2:0, 4:2:2, 4:4:4 planar up to 16bit will be converted back and forth internally.
How to use my LUTs in Avisynth without using the function "Linear Transformation()":
FFVideoSource("example.mxf")
ConvertBits(16)
ConvertToPlanarRGB()
Cube("C:\Programmi\AviSynth+\LUTs\example.cube")
How about a dither command after it converts back down to 10-bit?
Posts: 143
Threads: 1
Joined: 2021 Apr
Thanks: 276
Given 41 thank(s) in 28 post(s)
Country:
(2025-01-21, 04:50 PM)bronan Wrote: I found a pretty easy way to do SDR to HDR conversion in Avisynth+. I wanted to include SDR extended scenes in an HDR main feature, which meant converting them to HDR for editing together. The key to it is FranceBB's LinearTransformations LUTs. Using the AVSCube plugin, you can load his BT601_NTSC_to_BT2100_PQ LUT that will convert standard range video to HDR. I still needed to apply a level adjustment after that to increase brightness 20% to match surrounding footage, but overall its an easy and free method with great results. The following converts standard 1080p SDR to 4K HDR that matches UHD format:
Code: LoadPlugin("vscube.dll")
deletedScenes = FFMS2("y:\Deleted Scenes.m2ts")
\.Spline36Resize(3840, 2160)
\.ConvertBits(16)
\.ConvertToPlanarRGB()
\.Cube("BT601_NTSC_to_BT2100_PQ.cube")
\.ConvertToYUV420()
\.ConvertBits(10)
\.Levels(0, 1, 816, 0, 1020)
I tried this.
But got a blank output in avsmod.
|