[HELP] AviSynth 32 bit - ColorMatrix filter not working for video? - 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: [HELP] AviSynth 32 bit - ColorMatrix filter not working for video? (/thread-1569.html) |
AviSynth 32 bit - ColorMatrix filter not working for video? - The_Tinkerer - 19.10.2020 Try loading the attached "ColorTest.mp4" video into Hybrid. Enable the ColorMatrix filter for AviSynth, clear "Adjust by Resolution", then select From: Rec.709, To: Rec.601. Open the previewer, then toggle the check box for ColorMatrix on and off. It has no effect on the preview. The script looks like this: ClearAutoloadDirs() The thing is, the ColorMatrix filter DOES work for VapourSynth. Enable it for VapourSynth and use the same settings... clear "Adjust by resolution", then select From: Rec.709, To: Rec.601. Open the previewer and toggle it, and you will see the correct color change. The script looks like this: # Imports I checked, and this behavior is the same in Hybrid version 2020.02.19.1. So it's been like this for a while. The AviSynth ColorMatrix filter DOES work as expected when using IMAGE streams. It shifts colors the same as the VapourSynth filter does. You can verify this by loading the attached image as an image stream and toggling the filter. (The reason I'm wanting to do 709 to 601, is I'm processing DVD's with other applications that force a shift to 709 (like running ColorMatrix from 601 to 709). Running this filter afterwards shifts it back to the correct colors.) I've attached some logs, as well as the source file and single image. Logs: [attachment=1086] [attachment=1087] [attachment=1085] Test Video: [attachment=1088] Test Image: [attachment=1089] RE: AviSynth 32 bit - ColorMatrix filter not working for video? - Selur - 19.10.2020 When using '709->601' conversion Hybrid uses: ClearAutoloadDirs() ClearAutoloadDirs() To check whether something changes I:
-> seems to be working After this (which made it easier to spot the changed of the color matrix) I disabled "Filtering->Avisynth->Filter view" and then looked at the changes, when en- and disabling 'ColorMatrix' while it was set to '709->601'. -> knowing what to look for the changed where there => can't reproduce the problem. Cu Selur RE: AviSynth 32 bit - ColorMatrix filter not working for video? - The_Tinkerer - 19.10.2020 Let me try to show what is happening to me using 256 color animated gifs. It does at least show in general what is happening to me. It's probably best to right click the images and open them in a new tab, to show them at original size. Pay attention to the colors in the video (image). Here's the video file (ColorTest.mp4) in AviSynth. I'm toggling the ColorMatrix filter itself off and on. On my system, it has no effect: Here's the same video file in VapourSynth. Again, same ColorMatrix filter settings, toggling off and on. The color pallette shifts like it's supposed to: Finally, here's the image (Test-AdobeRGB.png) that was used to make the above video file in AviSynth, loaded as an image stream. Again, same settings for ColorMatrix. Toggling the filter shows it works and shifts the color pallette: So, the problem for me on my system, is that the AviSynth ColorMatrix filter is NOT working for VIDEO file (in this case .mp4) input. Can you confirm, that when you load ColorTest4.mp4 into Hybrid, open the AviSynth previewer, and then toggle the ColorMatrix filter on and off with the above settings, if you see the same thing that is shown in the first gif? Or do you see something more like the third gif? I tried running jobs and saving video files, and what is shown in the previewers is what renders to the output files. RE: AviSynth 32 bit - ColorMatrix filter not working for video? - Selur - 19.10.2020 Not at a computer till later today. Does it work if you use the filter view like I described before? Cu Selur RE: AviSynth 32 bit - ColorMatrix filter not working for video? - The_Tinkerer - 19.10.2020 For AviSynth, I believe it is working for the image stream, because it is an RGB image, and the script runs ConvertToYUY2(interlaced=false, matrix="Rec601") That is what is actually doing the color palette shift. The ColorMatrix filter is not needed at that point. So, a workaround for AviSynth for YUV video, is to use the following custom script: ConvertToRGB(interlaced=false, matrix="Rec709") or ConvertToRGB(interlaced=false, matrix="Rec709") Shouldn't ColorMatrix do the above? (19.10.2020, 07:16)Selur Wrote: Not at a computer till later today. I did try it as you described, I got the same results. And it renders to output file that way as well. RE: AviSynth 32 bit - ColorMatrix filter not working for video? - Selur - 19.10.2020 Strange thing is that it worked fine for me with mp4 files,.... RE: AviSynth 32 bit - ColorMatrix filter not working for video? - The_Tinkerer - 19.10.2020 Dependency Walker for ColorMatrix.dll shows it has no dependencies other than kernel32.dll, so I wonder if it's a Windows 7/10 problem. Edit - Probably not, I tried ColorMatrix.dll version 2.5 from 2009, and that didn't work for me either. RE: AviSynth 32 bit - ColorMatrix filter not working for video? - Selur - 19.10.2020 1. If there was a missing dependency loading the library would have failed. 2. check the preview scripts (they are in your temp folder while the Avisynth Preview is open), the problem must be with them Cu Selur RE: AviSynth 32 bit - ColorMatrix filter not working for video? - Selur - 19.10.2020 Okay, I can reproduce the problem with your sample,... Works fine with the attached file from me. -> looking into it --- Preview script itself looks fine: ClearAutoloadDirs() Using another source filter doesn't make a difference either. Cu Selur Ps.: Opened a post over at doom9s, may be someone else sees the problem. RE: AviSynth 32 bit - ColorMatrix filter not working for video? - Selur - 20.10.2020 from doom9s answers: It's the expected result, because you used 2 different ConvertToRGB32 matrices so question is how does the preview code needs to be adjusted? instead of using two different matrixes, like I did: SourceFiltered = SourceFiltered.ConvertToRGB32(matrix="Rec601") ConvertToRGB32(matrix="Rec709") since I specified it as 'from' in ColorMatrix or ConvertToRGB32(matrix="Rec601") since I specified it as 'to' in ColorMatrix or ConvertToRGB32(matrix="Rec709") since I specified it the source was flagged with it. ? I suspect it '"Rec709" since I specified it the source was flagged with it', but I'm totally unsure atm. Cu Selur |