16.09.2024, 23:50
(31.08.2024, 07:08)Selur Wrote: Hybrid uses avsInfo to analyse .avs and MediaInfo to analyse .mkv input for the color matrix.
In the script you used:
You commented out the lines which set the color matrix and return the clip.MKV="C:\Users\cebol\Desktop\ENCODES\HYBRID\Los juegos del hambre - Balada de pajaros.mkv"
BL=FFVideoSource(MKV).z_ConvertFormat(bit_depth=16).libplacebo_Tonemap(src_csp=3, dst_csp=1).z_ConvertFormat(pixel_type="YUV420P16", chromaloc_op="top_left=>top_left", resample_filter="spline36")
EL=FFVideoSource(MKV.ReplaceStr(".mkv", "_EL.mkv"))
MapNLQ(BL, EL)
z_ConvertFormat(pixel_type="YUV420P10", dither_type="error_diffusion")
z_Spline36Resize(dither="error_diffusion", 1920, 804, 0, 276, -0, -276)
#Prefetch(2)
SelectRangeEvery(8000,10)
#z_ConvertFormat(colorspace_op="2020ncl:2020:2020:limited=>2020ncl:2020:2020:limited", dither_type="error_diffusion")
#return last
So this clip has no color matrix info and the only thing possible to do is: guess
That said, current avsInfo does not analyse the matrix info.
So if you want this to be fixed, create a sample script with sample file and all the dependencies used.
The script:
a. needs to load the dependencies
b. the script needs to set the color matrix and return a clip
This way I can reproduce the problem and try to adjust avsInfo to read the color matrix.
(31.08.2024, 07:16)Selur Wrote: Reading the color matrix info from Avisynth scripts seems not possible since the output of Avisynth scripts does not contain this information.
see: https://avisynthplus.readthedocs.io/en/l...oInfo.html and http://avisynth.nl/index.php/Filter_SDK/.../VideoInfo
=> nothing Hybrid can do about that
Cu Selur
(31.08.2024, 09:00)Selur Wrote: So:
- Color matrix detection of Avisynth input is not possible, since Avisynth doesn't have an interface to check the color matrix. You need to overwrite the input color matrix if the resolution based guess doesn't help.
Ps.: The proper way to overwrite the input values would be to use "Filtering->Misc->Overwrite input"
The lines that adjust the matrix color that you have indicated that I have commented out/disabled, in reality those lines should not be present.
I had the lines there because I was testing. I thought that maybe Hybrid didn't detect the matrix color because the avs script didn't have the video with it present, so then I was trying to manually assign the matrix color (with z_ConvertFormat and other plugins) to see if this way Hybrid was able to recognize the matrix color... but it didn't.
So that commented line is actually missing and shouldn't be there. It was just tests I was doing and then I forgot to delete it.
But well, you have already discovered that the output of the Avisynth scripts do not contain this information, so that's why Hybrid never recognized it even trying to put it in manually.
I didn't know the option: "Filtering->Misc->Overwrite input".
That's very interesting. So if I just manually set the option here as Rec.2020ncl it would be all correct?
(31.08.2024, 07:08)Selur Wrote: The autocrop uses ffmpeg or mplayer, my guess is they have problems with the script.
=> like with 1.&2. I need a working script with dependencies to reproduce the problem.
(31.08.2024, 09:00)Selur Wrote: Looked at the crop detect and Hybrid properly uses:
to detect the crop values, but FFmpeg always reports that there is no cropping.ffmpeg -i "PATH TO avs" -vf cropdetect=24:2 -f null NUL
For a 720x480 Avisynth source ffmpeg will report something like:
When using '-vf cropdetect' instead of '-vf cropdetect=24:2', thus not limiting the black color detection or the mod, it seems to work and ffmpeg reports:[Parsed_cropdetect_0 @ 0000026d6fa61c80] x1:0 x2:719 y1:0 y2:479 w:720 h:480 x:0 y:0 pts:2 t:0.066733 limit:24.000000 crop=720:480:0:0
-> will adjust Hybrid in next dev[Parsed_cropdetect_0 @ 000002a154381c80] x1:4 x2:715 y1:0 y2:479 w:704 h:480 x:8 y:0 pts:2 t:0.066733 limit:0.094118 crop=704:480:8:0
So:
- the crop on Avisynth scripts should work now.
I tried to test the Auto crop option to see if it now works with avs scripts, but I can't use it.
The option appears disabled and you can't interact with it. And this happens all the time, both with avs scripts and MKV files.
![[Image: dybz6JI.png]](https://i.imgur.com/dybz6JI.png)
(31.08.2024, 10:05)Selur Wrote: Rewrote the Avisynth handling a bit and uploaded a new dev.
Try how that version works with your setup.
General advice: learn Avisynth if you feed Hybrid Avisynth scripts.
Blindly using stuff, like you do atm., will only cause problems in the future.
Cu Selur
Now the encodes are already shown as 2020 in MediaInfo instead of 709. So good news!
And also the avs script works correctly without the need to read dependencies, as it was always the case in older versions.
There is one strange thing though:
As I told you days ago, when I open in Hybrid an avs script that has already inside a resize to 1080 then Hybrid reported that it cannot find color matrix and then it assumes it is bt709 since the video size is larger than 720*576.
And now obviously the same thing is still happening, but the strange thing is that even though this happens (Hybrid assumes the color as bt709) if I make an encode and then open it in MediaInfo it turns out that the encode is bt2020 anyway.
That is, it doesn't matter if Hybrid assumes that the matrix color is bt709 or bt2020ncl, because anyway it always generates a resulting encode that is 2020.
Is this normal?
It should be noted that there is a strange thing that keeps happening as I explained in previous messages, and I do not understand why.
And that is that I have checked the text of the logs after doing encodes and it still continues to appear many times the text "709" by numerous places, despite the fact that I am encoding 2020.
Is this a bit strange? Or is it normal and nothing to worry about?
I am referring to what I told you in previous messages:
(31.08.2024, 02:37)murriato Wrote: But as a result of this thread and the problem I have, I have had to review my logs so I can attach them to you in case they are helpful.
And I have noticed that in these logs in many occasions the text "709" appears, for example here:
"C:\Program Files\Hybrid\64bit\ffmpeg.exe" -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "C:\Users\cebol\Desktop\ENCODES\MapNLQ.avs" -an -sn -vf format=yuv420p10le,scale=1920:1038 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -color_range tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -sws_flags spline -f yuv4mpegpipe
So reading in the log so many "709" has surprised me, and I'm worried because I'm encoding HDR content and not SDR, so if I'm encoding HDR it should not appear in the log so many settings that refer to the 709 color space, should all appear as 2020.
Is this correct (should always appear 2020 and should never appear 709)?
Or do these log texts not matter and do not imply anything and I should not worry?
My encodes (my output videos that I generate with Hybrid) are all correct and all are HDR output.
But I'm worried because reading this text fragment in the log I get the feeling (or at least that's what my logic says) that the source is being read as 709 instead of 2020 (although the output is correctly written as 2020)... and in case this is really happening then it will be forming a kind of funnel/bottleneck causing a part of the color spectrum to be lost, since 2020 encompasses a wider breadth and range of colors than 709.
In the current logs of this new version of Hybrid, for example, I can find these texts in which "709" is mentioned (although there are dozens more):
Quote:2024.09.12 - 02:44:22_Windows 11 Version 23H2 (64bit)_2024.09.01.1 - level 9: tokenizeAndStart(1): "C:\Program Files\Hybrid\64bit\ffmpeg.exe" -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "C:\Users\cebol\AppData\Local\Temp\encodingTempSynthSkript_2024-09-12@02_44_22_6910_0.avs" -an -sn -color_primaries bt2020 -color_trc smpte2084 -colorspace bt709 -color_range tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -f yuv4mpegpipe -
Quote:2024.09.12 - 02:44:22_Windows 11 Version 23H2 (64bit)_2024.09.01.1 - level 9: argumentString(1): -y -loglevel fatal -noautorotate -nostdin -threads 8 -i "C:\Users\cebol\AppData\Local\Temp\encodingTempSynthSkript_2024-09-12@02_44_22_6910_0.avs" -an -sn -color_primaries bt2020 -color_trc smpte2084 -colorspace bt709 -color_range tv -pix_fmt yuv420p10le -strict -1 -vsync 0 -f yuv4mpegpipe -
2024.09.12 - 02:44:22_Windows 11 Version 23H2 (64bit)_2024.09.01.1 - level 9: arguments(1):
-y
-loglevel
fatal
-noautorotate
-nostdin
-threads
8
-i
C:\Users\cebol\AppData\Local\Temp\encodingTempSynthSkript_2024-09-12@02_44_22_6910_0.avs
-an
-sn
-color_primaries
bt2020
-color_trc
smpte2084
-colorspace
bt709
-color_range
tv
-pix_fmt
yuv420p10le
-strict
-1
-vsync
0
-f
yuv4mpegpipe
-
I attach several debug outputs of some encode tests, in which you can search and find many "709":
- HybridDebugOutput - MKV (4K): Encode of a 4K MKV (the input is a normal mkv, not an avs script).
- HybridDebugOutput - avs script (4K): Encode of an avs script (the original 4K is kept, without resizing to 1080)
- HybridDebugOutput - avs script (4K resize to 1080): Encode of an avs script (resize to 1080 within the avs script itself)
By the way, when I encode in this version of Hybrid the result ends up with 2 files (.265 and .mkv) instead of only .mkv as it has always happened to me.
I guess it's because this option is disabled as well as the Auto crop option. And I have always chosen MKV in this option but now I can't choose anything, and I guess this is the cause of this problem, but I don't know.
![[Image: 4uoTDLv.png]](https://i.imgur.com/4uoTDLv.png)
![[Image: DlUEuW5.png]](https://i.imgur.com/DlUEuW5.png)
Thank you very much Mr. Selur as always!
