Selur's Little Message Board
[BUG] AviSynth x86 - Image sequence issue in previewer - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: [BUG] AviSynth x86 - Image sequence issue in previewer (/thread-1563.html)



AviSynth x86 - Image sequence issue in previewer - The_Tinkerer - 15.10.2020

Using Hybrid 2020.10.11.1.

Consider this:

We are going to load a 24 bit png image sequence into 32 bit AviSynth.

We are going to run QTGMC.

This is the resulting script:

ClearAutoloadDirs()
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\LoadDll.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\ImageSeq.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\AddGrainC.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\dfttest.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\EEDI2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\eedi3.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\FFT3DFilter.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\masktools2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\mvtools2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\TDeint.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\RgTools.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\MedianBlur2.dll")
LoadPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\nnedi3.dll")
LoadCPlugin("C:\PROGRA~1\Hybrid\32bit\AVISYN~1\yadif.dll")
LoadDLL("C:\Program Files\Hybrid\32bit\avisynthPlugins\libfftw3f-3.dll")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\QTGMC.avsi")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\SMDegrain.avsi")
Import("C:\Program Files\Hybrid\32bit\avisynthPlugins\Zs_RF_Shared.avsi")
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
# loading source: E:/USER/Test-AdobeRGB.png
#  color sampling RGB32@8, matrix: bt709, scantyp: progressive, luminance scale: limited
ImageReader(file="E:\USER\Test-AdobeRGB.png", end=100, fps=23.976, use_DeviL=true, pixel_type="RGB24")
# current resolution: 1440x1080
# denoising filtering using QTGMC
ConvertToYV24(interlaced=false, matrix="Rec709")
QTGMC(Preset="Fast", InputType=1, TR2=0, Sharpness=0.2, SourceMatch=0, Lossless=0, ediThreads=2)

# adjust color to YV12
ConvertToYV12()
PreFetch(4)
return last

This script converts the RGB colors to YV24 for QTGMC, then to YV12 for the final output for 4:2:0.

The problem, is that matrix="Rec709" is specified for the ConvertToYV24 filter, but not for the ConvertToYV12 filter.


This results in a color pallette shift. Since nothing is specified for the ConvertToYV12 filter, it must be using some other conversion matrix than Rec709:

[Image: LVcslCN.gif]

So, when ConvertToYV24(interlaced=false, matrix="Rec709") is used in a script, then later in the script ConvertToYV12 is used, it needs to be run as ConvertToYV12(matrix="Rec709"), not ConvertToYV12(). When it is run as ConvertToYV12(matrix="Rec709"), then the color shift that is shown in the above image does not happen. So the matrix= setting should always be used to match whatever matrix is being used for the video.


RE: AviSynth x86 - Image sequence issue when converting to YV24 then to YV12 - Selur - 15.10.2020

Quote:The problem, is that matrix="Rec709" is specified for the ConvertToYV24 filter, but not for the ConvertToYV12 filter.
That can't be your problem since matrices are only needed during RGB<>YUV conversions.

The problem you see is probably in the preview script.
-> If you open the Avisynth Preview, check your temp folder, there should be a temp file that should contain the preview script.
(alternatively the debug output also should contain the script)

The preview script should end with:
ConvertToRGB32(interlaced=false, matrix="Rec709")

-> would need a debug output to know what is happening.

Cu Selur

Ps.: It'll also send you a link to my current dev version via PM, to be sure this isn't a bug I already fixed somehwere.


RE: AviSynth x86 - Image sequence issue when converting to YV24 then to YV12 - The_Tinkerer - 15.10.2020

You're right... I thought the preview script was loading what was shown on the script preview button.

The problem is fixed in the 2020.10.15.1 dev version.

It appears to be have been caused by the preview script not including ConvertToRGB32(matrix="Rec709") at the end.

Blush


RE: AviSynth x86 - Image sequence issue in previewer - Selur - 15.10.2020

Yeah, I rewrote some stuff related to RGB handling. Smile
Btw. this was a 'preview only'-bug, meaning encoding output should have been fine.

Cu Selur