Log in

View Full Version : Using ColorMill in AviSynth


canuckerfan
21st December 2006, 03:01
Okay, I'm trying to use the Vdub filter ColorMill. I have no idea where to begin. If someone could lend me a hand. I tried searching the forums but ended up being confused with my script. My initial problem is loading the plugin. Here's my script:

LoadPlugin("g:\Kartick's Stuff\Tools\dvd editors\dgmpgdec149b3\DGDecode.dll")
Import("C:\Program Files\AviSynth 2.5\plugins\LimitedSharpenFaster.avs")
Import("C:\Program Files\AviSynth 2.5\plugins\Ylevels.avs")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\ColorMatrix.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DeSpot.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\SSE3Tools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\fft3dfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE3.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RepairSSE3.dll")
LoadVirtualDubPlugin("G:\Kartick's Stuff\Tools\video tools\virtualdub\plugins\AutoLevel.VDF")

Setmemorymax(512)

mpeg2source("G:\Hindi Movies\HP\scripts\VideoFile.d2v",idct=5,info=3)

ColorMatrix(mode="Rec.601->Rec.709",hints=true)

Crop(4,68,-12,-68)
LanczosResize(704,344)

DeSpot(pwidth=50,pheight=50,p1=35,p2=14,mthres=25)
FFT3DFilter(bt=4,sigma=2.7,ow=48/2,oh=48/2)
LimitedSharpenFaster(Smode=4,strength=160,lmode=2)



AddBorders(0,68,0,68)

ConvertToYUY2()

It keeps saying invalid arguments to function "LoadVirtualDubPLugin". I know I am doing something wrong, if someone could just steer me in the right direction. I tried looking at the source code for ColorMill and it might as well have been in Cantonese for me.:confused:

Please help. Thanks.

superuser
21st December 2006, 04:33
I think you forgot to specify with what filter name AVISynth should will be referencing this filter as.


try something like:

LoadVirtualDubPlugin("G:\Kartick's Stuff\Tools\video tools\virtualdub\plugins\AutoLevel.VDF", "MyAutoLevel", 0)

canuckerfan
21st December 2006, 04:43
^Thanks. That did the trick. Knew I was missing something. Now I just need to find out what params mean what. Maybe the source code can help with that. I'm gonna fool around with it and see if I come up with anything.

grannyGeek
21st December 2006, 05:15
This is what I figured out after gleaning a few hints on the forum, and it works for me.

Load video into VirtualDub, and tweak the filter settings to desired settings.
DON'T HAVE ANY OTHER V-DUB FILTERS ACTIVE, you want your ColorMill configuration settings to be the only ones listed.
Go to File > Save Processing Settings, and save the file to an easily accessible name and folder, it adds the .VCF extension automatically.

In the AviSynth script, put the line

LoadVirtualdubplugin(vdPath+"colormill.vdf", "colormill",1)

where vdPath is the path to where you put the plugin.
The entry for "colormill" tells AviSynth that this is the name you will use to call the plugin.

Then use notepad to open your saved VCF file, and almost at the bottom, you will find a line that looks like this ---

VirtualDub.video.filters.instance[0].Config(25700, 45924, 7268, 25700, 36452, 14235, 42596, 25665, 25700, 25700, 25700, 25700, 25700, 1124, 5);

Now open your script.
If your video is not in RGB, you must add a line to ConvertToRGB32()
Add a line to call ColorMill, and in parentheses, copy and paste the setting numbers that follow Config
(I marked the sample in bold red)

Script should look something like this---
LoadVirtualdubplugin(vdPath+"colormill.vdf", "colormill",1)
ConvertToRGB32()
colormill(25710, 44388, 31069, 25699, 26212, 25708, 26468,
\ 28516, 29028, 25700, 27260, 25701, 25700, 1124, 5)
Refresh your script, and see how it looks.

I've noticed that I sometimes must go back and tweak saturation a bit more and save a new VCF file, because my capture is in YUV and it is a RGB filter --- I think converting between RGB and YUV affects the color range a bit.

hope this helps

EDIT
while I was typing, superuser answered the question.
Oh, well, maybe someone else can use this info too.

canuckerfan
21st December 2006, 05:20
^Worked like a charm. Thanks for the tips:)

One more question. Because of the conversion of colourspaces... would it be necessary to use colormatrix? So far, I have something like this:

Setmemorymax(512)

mpeg2source("G:\Hindi Movies\HP\scripts\VideoFile.d2v",idct=5,info=3)

ColorMatrix(mode="Rec.601->Rec.709",hints=true)

Crop(4,68,-12,-68)
LanczosResize(704,344)


DeSpot(pwidth=50,pheight=50,p1=35,p2=14,mthres=25)
FFT3DFilter(bt=4,sigma=2.8,ow=48/2,oh=48/2)
DeHalo_alpha()
LimitedSharpenFaster(Smode=4,strength=100)

ConvertToRGB32()
ColorMill(25700, 25700, 25700, 25700, 25800, 25700, 28527, 20847, 25700, 25700, 25700, 25700, 25700, 1124, 2053)

AddBorders(0,68,0,68)


ConvertToYUY2()

superuser
21st December 2006, 05:32
^offtopic: is not the strength used in LSF pretty high?

foxyshadis
21st December 2006, 06:35
MPEG2 default is rec 601, MPEG4 default is rec 709, so if you're crossing the two you'll need it. If you're going back to MPEG2 you have to switch the order around. (And it probably won't be used at all if hints are used.)

rfmmars
21st December 2006, 06:49
You might want to sub "Fdump's" eqRGB 2.11 for Colormill if you don't need the non linera funtions of Colormill. This other filter of his run twice as fast as colormill.

Richard
photorecall.net

canuckerfan
21st December 2006, 07:47
^that's a good idea. but here's the vcf file for eqRGB:

VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
VirtualDub.audio.EnableFilterGraph(0);
VirtualDub.video.SetInputFormat(0);
VirtualDub.video.SetOutputFormat(7);
VirtualDub.video.SetMode(3);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetCompression();
VirtualDub.video.filters.Clear();
VirtualDub.video.filters.Add("RGB Equalizer(2.11)");
VirtualDub.video.filters.instance[0].Config("€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€‚€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€†€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€„€‚Œ€‚„€‚„€‚„€‚„€‚„€‚„€‚„€‘„€‚„€");
VirtualDub.audio.filters.Clear();


those characters don't work in avisynth. Any ideas? perhaps I am missing a font or something.

canuckerfan
21st December 2006, 11:58
anyone for eqRGB?

rfmmars
21st December 2006, 14:44
anyone for eqRGB?

Interesting, Vdub can read the file correctly.........so is it extended charactores or Russian or what? Let me see what I get.

Richard

rfmmars
21st December 2006, 15:47
Interesting, Vdub can read the file correctly.........so is it extended charactores or Russian or what? Let me see what I get.

Richard

More thoughts on the above

I get simular results but the charactors are different. Try pasteing those wierd settings in to your script and see what happens, it should work, the only problem I would see is if you wanted to add sliders in "AVSp". The problem may be solved add just by adding the correct language pack to your computer

You could contact "Fdump" he's very helpful, I worked with him on the fuctions needed in his filters.

For me in the color restoration of old movie film, I need to change the values for every scene, so "Avsynth" doesn't work for me with his filters. I output from "AVSp" to Vdub where I can do a "JobList" but even better, Magix A.G. in their new EP-11 Plus UK version NLE, I can add most VD plugins on a field or frame basis, so after all my film editing is done, I then add the color correction.

Richard
photorecall.net

canuckerfan
21st December 2006, 21:58
okay, I got it. Turns out that I have to put those characters into my script WITH the quotation marks. haha. Thanks everyone for the help.