Seems like the ffmpeg decoding call is missing the colorMatrix option. (will look into it)
-> try whether enabling: 'Config->Internals->Avisynth->Always use Avisynth' helps.
Cu Selur
Problem seems to be that the input uses a custom color matrix and Hybrid guesses Rec.709
from MediaInfo:
Code:
Codec settings : CustomMatrix
Codec settings, Matrix : Custom
The preview needs to convert to RGB uses Rec709.
-> Since you are not doing any YUV<>RGB during conversions the encoding probably doesn't look right since the colormatrix signaling is also bt709.
So signaling another colorMatrix (or none) might fix the issue during playback. Preview can't be accurate with custom colorMatrix.
Neither of your debug output used colorMatrix. (works fine here, but will create a dev version which should show a bit more consistent avisynth preview)
Cu Selur
This bug still exist. In the above case, the ColorMatrix worked in the range 709 - 709 (no cropping source)
When cropping source to 744-420, ColorMatrix worked in the range 709 - 601 with similar big difference between the source and target in the preview window
Setting ColorMatrix to the same input&output value negates it's use and it isn't used.
In this case is not same input&output value 709 - 601. When I disable this filter - no difference between the source and target
With Colormatrix enabled ent set to 'Rec.709'->'Rec.601' the preview script is:
Code:
SetMemoryMax(768)
SetMTMode(2,16) # changing MT mode
LoadPlugin("G:\Hybrid\AVISYN~1\DGDecode.dll")
LoadPlugin("G:\Hybrid\AVISYN~1\ColorMatrix.dll")
# loading source: F:\TestClips&Co\MPEG-2\Tablitsa_colormatrix.mpg
# input luminance scale tv
Source = MPEG2Source(d2v="H:\Temp\mpg_e0b8c6319ad8a0dd51e4cdd1d25dd581_4827.d2v",info=3)
# current resolution: 720x576
SourceFiltered = Source
# color modifications
SourceFiltered = SourceFiltered.ColorMatrix(mode="Rec.709->Rec.601",interlaced=true,hints=true)
# filtering
# adjust color to(2): RGB32
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec601")
Source = Source.ConvertToRGB32(matrix="Rec709")
StackHorizontal(Source, SourceFiltered)
return last
disabling the option and the preview script is:
Code:
SetMemoryMax(768)
SetMTMode(2,16) # changing MT mode
LoadPlugin("G:\Hybrid\AVISYN~1\DGDecode.dll")
# loading source: F:\TestClips&Co\MPEG-2\Tablitsa_colormatrix.mpg
# input luminance scale tv
Source = MPEG2Source(d2v="H:\Temp\mpg_e0b8c6319ad8a0dd51e4cdd1d25dd581_4827.d2v")
# current resolution: 720x576
SourceFiltered = Source
# filtering
# adjust color to(2): RGB32
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec709")
Source = Source.ConvertToRGB32(matrix="Rec709")
StackHorizontal(Source, SourceFiltered)
return last
I also see a clear color switch when en- and disabling the option while having the Avisynth Filter Preview open.
-> can't reproduce the issue you describe.
Cu Selur
Ps.: Preview script is inside the temp-folder (while Avisynth Preview is used) if you want to check yourself.
Please open the my source file Tablitsa.mpg, not Tablitsa_colormatrix.mpg
Then crop it left-12, right-10, top-78, bottom-78
Now switch to avisinth - color tab and you see colormatrix filter range 709 - 601
Press avisinth preview and eneble and disable colormatrix - you see, when disabling this filter - no difference, when enabled - big difference
Quote:Please open the my source file Tablitsa.mpg, not Tablitsa_colormatrix.mpg
Same file, I just renamed it so that I can categorize it better.
With ColorMatrix 709->601, the preview script is:
Code:
SetMemoryMax(768)
SetMTMode(2,16) # changing MT mode
LoadPlugin("G:\Hybrid\AVISYN~1\DGDecode.dll")
LoadPlugin("G:\Hybrid\AVISYN~1\ColorMatrix.dll")
# loading source: F:\TestClips&Co\MPEG-2\Tablitsa_colormatrix.mpg
# input luminance scale tv
Source = MPEG2Source(d2v="H:\Temp\mpg_e0b8c6319ad8a0dd51e4cdd1d25dd581_4827.d2v",info=3)
# current resolution: 720x576
SourceFiltered = Source
# color modifications
SourceFiltered = SourceFiltered.ColorMatrix(mode="Rec.709->Rec.601",interlaced=true,hints=true)
SourceFiltered = SourceFiltered.AssumeFrameBased().SeparateFields()
# cropping to 698x420
SourceFiltered = SourceFiltered.Crop(12,78,-10,-78)
# current resolution: 698x420 (SourceFiltered)
SourceFiltered = SourceFiltered.Weave()
Source = Source.AssumeFrameBased().SeparateFields()
Source = Source.Crop(12,78,-10,-78)
# current resolution: 698x420 (Source)
Source = Source.Weave()
# filtering
# adjust color to(2): RGB32
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec601")
Source = Source.ConvertToRGB32(matrix="Rec709")
StackHorizontal(Source, SourceFiltered)
return last
with ColorMatrix disabled, the preview script is:
Code:
SetMemoryMax(768)
SetMTMode(2,16) # changing MT mode
LoadPlugin("G:\Hybrid\AVISYN~1\DGDecode.dll")
# loading source: F:\TestClips&Co\MPEG-2\Tablitsa_colormatrix.mpg
# input luminance scale tv
Source = MPEG2Source(d2v="H:\Temp\mpg_e0b8c6319ad8a0dd51e4cdd1d25dd581_4827.d2v")
# current resolution: 720x576
SourceFiltered = Source
SourceFiltered = SourceFiltered.AssumeFrameBased().SeparateFields()
# cropping to 698x420
SourceFiltered = SourceFiltered.Crop(12,78,-10,-78)
# current resolution: 698x420 (SourceFiltered)
SourceFiltered = SourceFiltered.Weave()
Source = Source.AssumeFrameBased().SeparateFields()
Source = Source.Crop(12,78,-10,-78)
# current resolution: 698x420 (Source)
Source = Source.Weave()
# filtering
# adjust color to(2): RGB32
SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec709")
Source = Source.ConvertToRGB32(matrix="Rec709")
StackHorizontal(Source, SourceFiltered)
return last
So from my standpoint everything looks fine.
As expected when ColorMatrix isn't enabled, output and input colors don't differ since no filtering is applied,...
Switching colorMatrix on and off changes the colors of the output like it is supposed to do.
-> I'm don't know where you see a problem.
Cu Selur