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. |
2nd August 2022, 18:56 | #221 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
I think it does make use of frame properties, so if you're using a recent version of Avisynth and a frame properties enabled build of ffmpeg, it will read them.
This is just an example: Code:
#Indexing ProRes HQ 4:2:2 23,976p 10bit planar HDR PQ source video=LWLibavVideoSource("KFH00862.mov") ch1=LWLibavAudioSource("KFH00862.mov", stream_index=1) ch2=LWLibavAudioSource("KFH00862.mov", stream_index=2) ch3=LWLibavAudioSource("KFH00862.mov", stream_index=3) ch4=LWLibavAudioSource("KFH00862.mov", stream_index=4) ch5=LWLibavAudioSource("KFH00862.mov", stream_index=5) ch6=LWLibavAudioSource("KFH00862.mov", stream_index=6) ch7=LWLibavAudioSource("KFH00862.mov", stream_index=7) ch8=LWLibavAudioSource("KFH00862.mov", stream_index=8) ch9=LWLibavAudioSource("KFH00862.mov", stream_index=9) ch10=LWLibavAudioSource("KFH00862.mov", stream_index=10) ch11=LWLibavAudioSource("KFH00862.mov", stream_index=11) ch12=LWLibavAudioSource("KFH00862.mov", stream_index=12) ch13=LWLibavAudioSource("KFH00862.mov", stream_index=13) ch14=LWLibavAudioSource("KFH00862.mov", stream_index=14) ch15=LWLibavAudioSource("KFH00862.mov", stream_index=15) ch16=LWLibavAudioSource("KFH00862.mov", stream_index=16) audio=MergeChannels(ch1, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10, ch11, ch12, ch13, ch14, ch15, ch16) AudioDub(video, audio) #From 4:2:2 10bit to 4:2:2 16bit planar ConvertBits(16) #From 4:2:2 16bit planar Narrow Range to RGB Planar 16bit Narrow Range z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:2020:2020:limited=>rgb:2020:2020:limited", resample_filter_uv="spline64", dither_type="error_diffusion") #From PQ to HLG with 16bit precision Cube("WarnerBros_PQToHLG_MaxCLL_2752.cube", fullrange=true) #From RGB 16bit planar Narrow Range to YUV422 16bit planar Narrow Range z_ConvertFormat(pixel_type="YUV422P16", colorspace_op="rgb:2020:2020:limited=>2020:2020:2020:limited", resample_filter_uv="spline64", dither_type="error_diffusion") #Filling the right frame properties with HLG propset("_Transfer", 18) #Speed-up + pitch adjustment ResampleAudio(48000) AssumeFPS(25, 1, false) TimeStretch(tempo=100.0*25.0/(24000.0/1001.0)) ResampleAudio(48000) #Clipping Limiter(min_luma=4096, max_luma=60160, min_chroma=4096, max_chroma=60160) Code:
#Filling the right frame properties with HLG propset("_Transfer", 18) If you wanna be absolutely sure that frame properties are set correctly, you can check them with AVSPmod and eventually populate them accordingly yourself, otherwise you can always use propClearAll() right after indexing and everything will be business as usual (I generally prefer the latter). Last edited by FranceBB; 4th August 2022 at 07:52. |
3rd August 2022, 09:14 | #222 | Link |
Registered User
Join Date: Jul 2018
Posts: 450
|
It's probably better that a moderator to move posts from #109 to #213 (including) in a separate thread to avoid confusions between the two builds.
At the moment the main diff between the builds(r2 and r14): Code:
- how alpha plane is treated: r2 - ZIMG_ALPHA_STRAIGHT; r14 - ZIMG_ALPHA_PREMULTIPLIED - r14 has additional pixel types aliases - RGBP8, RGBAP8, YUV444, YUV444P8, YUVA444P8, YUV422, YUV422P8, YUVA422P8, YUV420, YUV420P8 , YUVA420P8, YUV411, YUV411P8 - r14 has additional chroma locations - TOP_LEFT, TOP, BOTTOM_LEFT, BOTTOM - r2 has additional chroma location alias - dv (LEFT) - r2 has additional resample aliases - gauss (BICUBIC), lanczos4 (LANCZOS), blackman (LANCZOS), sinc (LANCZOS), z_BlackmanResize (LANCZOS), z_GaussResize (BICUBIC), z_SincResize (LANCZOS) - r14 has additional args: cpu_type, nominal_luminance, approximate_gamma, use_props - r14 has support for frame properties - r14 has additional args for the compatibility wrappers (z_xxResize) - chromaloc_op, dither Last edited by StvG; 3rd August 2022 at 09:19. |
3rd August 2022, 09:56 | #223 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,070
|
As the jpsdr post at https://forum.doom9.org/showthread.p...87#post1970987 -
I don't know what the others plugins output, neither what they expect in input. "linear", but wich one ? scene linear light and scaled by camera exposure or displayed linear ? Can the z.lib switch between different 'linear' conversions from HDR formats ? Following tests at https://forum.doom9.org/showthread.p...95#post1970995 shows that the OOTF on/off at the process of conversion system transfer to 'linear' looks like make the main difference. The difference is not great and may be too few persons now make processing in linear to detect this difference at real footage. |
4th August 2022, 13:32 | #224 | Link | |
Registered User
Join Date: Jul 2018
Posts: 450
|
Quote:
|
|
4th August 2022, 14:32 | #225 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,070
|
Can the OOTF stage be simulated as some AVS scripting after 'first stage conversion to linear' with zimg-AVS plugin ? To get 'scene-referred' too if required ?
"but this option is not api exposed" May be it can be feature-request and API supplement and finally go into next plugin version ? So for sources 'conditioned' in 'scene-linear light' it can be used as a one-step conversion from HDR transfer encoded form into linear for scaling or other processing. Last edited by DTL; 4th August 2022 at 14:37. |
4th August 2022, 23:23 | #226 | Link | |
Registered User
Join Date: Dec 2017
Posts: 90
|
Quote:
|
|
5th August 2022, 19:39 | #227 | Link | ||
Registered User
Join Date: Jul 2018
Posts: 450
|
avsresize_r15 (pass: gjFnhBCshVL3):
- relaxed restrictions for use_props=0; - added scene_referred parameter (default false). Quote:
Quote:
|
||
5th August 2022, 21:57 | #228 | Link |
Registered User
Join Date: Jul 2018
Posts: 1,070
|
It finally work about as expected https://forum.doom9.org/showthread.p...23#post1972723 but looks the float RGB values are very different for each plugin and require deep correction with 'magic numbers' like about 3.0 gain for one plugin and 0.157 for avsresize. But finally it can convert 10bit HLG YUV codevalues into rec709 via RGB-linear-float path with 'exact' precision in 8bit R'G'B' output. And the intermediate values forming transient looks about good too.
Last edited by DTL; 5th August 2022 at 22:01. |
6th August 2022, 16:22 | #229 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Quote:
Code:
#From 4:2:2 16bit planar Narrow Range to RGB Planar 16bit Narrow Range z_ConvertFormat(pixel_type="RGBP16", colorspace_op="2020:2020:2020:limited=>rgb:2020:2020:limited", resample_filter_uv="spline64", dither_type="error_diffusion", use_props=0) #From PQ to HLG with 16bit precision Cube("\\myserver.local\avdb\Server\encoder\encoder\Processors\avs_plugins\LUTs\WarnerBros_PQToHLG_MaxCLL_2752.cube", fullrange=true) #From RGB 16bit planar Narrow Range to YUV422 16bit planar Narrow Range z_ConvertFormat(pixel_type="YUV422P16", colorspace_op="rgb:2020:2020:limited=>2020:2020:2020:limited", resample_filter_uv="spline64", dither_type="error_diffusion", use_props=0) #Filling the right frame properties with HLG propset("_Transfer", 18) |
|
6th August 2022, 18:58 | #230 | Link | |
Registered User
Join Date: Jul 2018
Posts: 450
|
Quote:
|
|
8th August 2022, 12:45 | #231 | Link | ||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
Thanks, I have updated my scripts!
I have another question, though. I have a BT601 SD 25i TFF source that I want to convert to BT709 but I want to leave interlacing alone. Of course I could just bob, use z_ConvertFormat() and then separatefields() etc, but I'd like to avoid that. I noticed that in z_ConvertFormat() there's "interlaced" as a parameter that can be either true or false, however if I set it to "true", it says "Interlaced operation not supported": Quote:
why? this works but I'd like to avoid it: Quote:
Last edited by FranceBB; 8th August 2022 at 12:54. |
||
9th August 2022, 05:48 | #233 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
I see...
Will it ever be added? As to propclearall (), if I don't use it, even if avsresize won't use them with use_props=0, it won't nuke them, so they would still be there which is even worse 'cause at that point they would just be wrong and not updated. EDIT: Actually, you're right, use_props=0 make it not read them but still set them, so they're gonna be correct, my bad. Last edited by FranceBB; 9th August 2022 at 09:11. |
10th August 2022, 01:52 | #234 | Link |
Registered User
Join Date: Jul 2018
Posts: 450
|
avsresize_r16 (pass: ZrDjU0BAGRha):
- improved use_props=-1; - throw error when use_props=0 and _FieldBased/_Field > 0; - added support for interlaced clips: when interlaced=true, always use_props=0. |
10th August 2022, 08:19 | #235 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
|
What a lovely morning present.
Yesterday Donald gifted the community with a CUDA porting of Cube(), today you introduced interlaced = true support in avsresize. I wonder what's gonna be next... |
13th August 2022, 17:12 | #239 | Link |
Registered User
Join Date: Jul 2018
Posts: 450
|
avsresize_r17 (pass: OPtHxyD16GmI): use_props=-1 improved a bit more.
|
14th August 2022, 20:15 | #240 | Link |
Registered User
Join Date: Jul 2018
Posts: 450
|
avsresize_r18 (pass: MzYJG3B0mt0M): fixed output frame properties when use_props=0 and colorspace_op/chromaloc_op not specified.
|
Thread Tools | Search this Thread |
Display Modes | |
|
|