Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
Registered User
Join Date: Oct 2021
Posts: 21
|
Grid plugin usage.
Grid plugin is very unintuitive, i used manyPlus version for Avisynth+
Usage described here (its same as instruction coming with plugin). However sf and ef properties do not work, no way to specify grid display to start/end from frame number? Code:
FFmpegSource2("C:\vid\00007.mp4") Grid(last, lineint=60, bold=2, vbold=2, color=$cccccc, bcolor=$AA0000, vbcolor=$AAAA00, grid=true, axis=false) Last edited by Rob105; 3rd June 2023 at 10:35. |
![]() |
![]() |
![]() |
#2 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
V.C Mohan aint been around since Aug 2022.
You could try PM him, and/or email him, see http://www.avisynth.nl/users/vcmohan/vcmohan.html V.C, is I think 80+ Y.O, you may not be successful. From an Old source for grid that I have, [EDIT: AvisynthPluginInit2, ie avisynth 2.58] Code:
// Calls the constructor with the arguments provied. } // The following function is the function that actually registers the filter in AviSynth // It is called automatically, when the plugin is loaded to see which functions this filter contains. /* extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) { env->AddFunction("Grid", "cii[lineint]i[bold]i[vbold]i[color]i[bcolor]i[vbcolor]i[grid]b[axis]b", Create_Grid, 0); return "Grid Plugin"; } */ dll source which had Grid() as one of many functions. Source linked for separate Grid() plugin on Wiki uses this Code:
env->AddFunction("Grid", "c[sf]i[ef]i[lineint]i[bold]i[vbold]i[color]i[bcolor]i[vbcolor]i[grid]b[axis]b", Create_Grid, 0); Looks to me like current wiki dll (ii, not optional, "Grid Does not have a named argument 'sf'") and current wiki source ([sf]i[ef]i, are optional), not from the same version project.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 3rd June 2023 at 14:44. |
![]() |
![]() |
![]() |
#3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
Further to above.
Comments in above post for 21 Mar 2017 x64 version. The later 25 June 2020, Grid_2_6.zip is x86 only, no x64 version. I'll try to rejig versions for v2.58, v2.6, v2.6 Avs+ x86 and x64. (just incase V.C. does not make a show)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
![]() |
![]() |
![]() |
#4 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
OK, maybe this of use, maybe not.
Grid_25.dll, Avs v2.58 colorspaces only. Grid_x86.dll, Avs v2.6 Std 8 bit colorspaces only, except YV411. Grid_x64.dll, Avs v2.6 Std 8 bit colorspaces only, except YV411. https://www.mediafire.com/file/fn08y...230604.7z/file Fixed a couple of very minor bugs. Txt file, Included in zip, Code:
Supports All 8 bit AVS26 colorspaces except YV411. [x86 and x64 dll's, _25 dll is AVS v2.58 colorspace only] NOTE, despite ManyPlus version docs of Grid, it has had Sf, Ef args removed [StartFrame, EndFrame]. [EDIT: Sf, Ef OK in this version] Grid dll FilterName Grid() will conflict with ManyPlus Grid() Filter. [Can call via Grid_Grid() or ManyPlus_Grid() to avoid conflict] and would take me some time to get up to speed, so above is only for 8 bit AVS v2.6 Std Colorspaces. Also Note, ManyPlus Grid(), will crash on YV411. [presumably the older versions of Grid() will do too] EDIT: ONLY VERY BRIEF testing and only on x64 version, original source used was AVS 2.6 std colorspace only, the x86 Grid_2_6 source code. [incl in zip] Report any problems. EDIT: Added Version Resource to the dll's as below. ![]() Assigned a version of 2.0.0, V.C, tended to just give a date or AVS version eg 2.6 for Avs v2.6.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 4th June 2023 at 01:53. |
![]() |
![]() |
![]() |
#5 | Link |
Registered User
Join Date: Oct 2021
Posts: 21
|
Thanks for follow up, i did not manage to make your plugin work at all, removed all old versions and installed your DLL.
How i meant to call it Grid_Grid or Grid? Neither one work both x86 and 64bit versions. P.S. I am not good with color spaces and YUV etc, perhaps it was an issue, but i used uncompressed AVI and same problem, it don't work. |
![]() |
![]() |
![]() |
#6 | Link |
Registered User
Join Date: Jul 2003
Location: India
Posts: 890
|
Hi. I am 89 years old. I do check occassionally if there are any messages to me.
Grid function is now part of ManyPlus plugin. Long time back I used to provide facility to start at a specified frame and end at a specified frame. I have removed all such facilities as I found no other plugin provides such. Also that can be achieved by use of Trim and + in the avisynth+ script. As I did not find any user observations on any of my plugin functions I am thinking of announcing my disappearance from this Forum, but now I may continue for one more year. |
![]() |
![]() |
![]() |
#7 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
Hi V.C., nice to see that you're still kicking around
![]() The occasional filter does allow for start and end frame, but not that many, I guess its no great loss and you can use Trim() as you say. Here is my recompile update for bugfix, had copy/paste error. I've left the sf,ef args alone, I want a separate version of your Grid() for myself anyway [Probably why I had the source from the ManyPlus whotsit]. Perhaps I could rename so as not to confilct with ManyPlus version, maybe Graticule() or something. NOTE, In Grid() example on Wiki, this is bugged Code:
Grid(last,24,200,25,4,5,$ff0000,$7f0000,$5f0000,true,false) Also added a "$" before RRGGBB in HTML docs, result = "specified as $RRGGBB" Sorry Rob105, cocked up the plug, below update to v2.01 fixed. https://www.mediafire.com/file/5vz9m...230605.7z/file Included in AVS folder. Code:
/* Grid (clip, int "sf"=0, int "ef"=FrameCount-1, int "lineint"=10, int "bold"=5, int "vbold"=2, int "color"=$000000, int "bcolor"=color, int "vbcolor"=color, bool "grid"=true, bool "axis"=false) int sf, Default 0. display to start from frame number. int ef, Default last frame of clip. display to end on frame number. int lineint, Default 10. Line (dotted) interval in pixels. Must be Even AND >= 4, AND <= Height/4 AND <= width/4. int bold, Default 5. At least 1. Bold line every nth grid line. int vbold, Default 2. At least 1. Very bold line every nth bold grid line. int color, Default $000000. Color of grid line. int bcolor, Default color. Color of bold line. int vbcolor, Default color. Color of very bold line. bool grid, Default true. Whether grid lines to be displayed. bool axis, Default false. Whether axis lines to be displayed. */ BlankClip(Color=$FFFFFF) #ColorBars(Pixel_Type="YV12") # Alternative ShowFrameNumber SF = 0 EF = 99 # End @ Frame 99 LINEINT = 10 BOLD = 5 VBOLD = 2 COLOR = $000000 BCOLOR = $FF0000 VBCOLOR = $0000FF SHOWGRID = True SHOWAXIS = False Grid(last,sf=SF,ef=EF,lineint=LINEINT,bold=BOLD,vbold=VBOLD,color=COLOR,bcolor=BCOLOR,vbcolor=VBCOLOR,grid=SHOWGRID,axis=SHOWAXIS)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
![]() |
![]() |
![]() |
#9 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
What you want to call it ?
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
![]() |
![]() |
![]() |
#11 | Link |
Registered User
Join Date: Oct 2021
Posts: 21
|
Hi guys, i actually ended up using importing Grid plugin from VirtualDub, because in Avisynth grid plugin has lines that are too thick i just need 1px width solid line, dotted lines i don't like.
If you continue to develop this plugin, please add opacity right now its too bold and covers video frame too much. Last edited by Rob105; 10th June 2023 at 15:07. |
![]() |
![]() |
![]() |
#12 | Link |
Registered User
Join Date: Oct 2021
Posts: 21
|
I run into some interesting bug with Grid Plugin all versions from Avisynth Wiki.
Also 64Bit version of plugin does not even open at all. PHP Code:
![]() Last edited by Rob105; 10th June 2023 at 15:06. |
![]() |
![]() |
![]() |
#13 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
Well, that looks like a problem with your video source filter, try LSMashVideoSource as it is an ISO (mp4) file.
Source filter seems to have a problem determining the width of your mp4 file. (Nothing to do with Grid() at all, not even mentioned in your script). Good idea to find out what the problem is, ie, is it your mp4, or is it your png, I expect that it is your mp4. Just insert a "return v1" immediately after ffmpesource2 thingy, I expect it looks weird. EDIT: Your png image could take some time for mods to get around to, suggest post on image host site, eg PostImage.org:- https://postimages.org/ No account necessary, and no time limit before deletion [unless you set one, I think]. Use either "Thumbnail for Forum", or maybe "Image" or similar "for Forum", then paste the link.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 10th June 2023 at 17:18. |
![]() |
![]() |
![]() |
#14 | Link | |
Registered User
Join Date: Oct 2021
Posts: 21
|
Quote:
Image https://postimg.cc/rzZ9fMxB Video https://www.upload.ee/files/15325751...GINAL.mp4.html |
|
![]() |
![]() |
![]() |
#15 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
There is something wrong with your video source ie ffmpegsource2, suspect an old version.
This works fine here with my ffmpegsource2 or LSmashVideoSource. Also note the method of being able to return result at any stage of the script, and therefore being able to debug your own script easy. (better than throwing your hands into the air and screaming, "it dont work"). Code:
#v1 = FFmpegSource2("c:\vid\myvid.mp4") #ruller_vert = ImageSource("c:\vid\Ruller-1920px.png").crop(0,0,1080,0).TurnRight.ConvertToYV12() #v1 = StackHorizontal(ruller_vert, v1, ruller_vert) #v1 = FFmpegSource2(".\00005_ORIGINAL.mp4") # works fine for me v1 = LSMashVideoSource(".\00005_ORIGINAL.mp4") # so does this #Return v1 # 1920x1080 (50 fps) ruller_H = ImageSource(".\Ruller-1920px.png",End=0) # END=0, = single frame, else END=1000 by default with result of 1001 frames #Return ruller_H # 1920x18 ruller_H = ruller_H.crop(0,0,1080,0) # Make width same as v1.height #Return ruller_H # 1080x18 ruller_vert = ruller_H.TurnRight #Return ruller_vert # 18x1080 ruller_vert = ruller_vert.ConvertToYV12() #Return ruller_vert # 18x1080 v2 = v1.Grid() # Apply grid only on video clip #Return v2 StackHorizontal(ruller_vert, v2, ruller_vert) # voila EDIT: Also, your last line (actually, the script you posted would not work at all and would produce an error message, despite your bad result image) Code:
v1 = StackHorizontal(ruller_vert, v1, ruller_vert) Code:
v1 # Implicit Assign v1 to special Last clip, which will be returned by default if no explicit "Return Last". Code:
Last = v1 # Explicit Assign v1 to special Last clip, which will be returned by default if no explicit "Return Last". Code:
Return v1 Code:
StackHorizontal(ruller_vert, v1, ruller_vert) # implicit assign to Last clip
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 11th June 2023 at 09:50. |
![]() |
![]() |
![]() |
#16 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
Perhaps of use (perhaps not). [not tested too much]
Code:
c = LSMashVideoSource(".\00005_ORIGINAL.mp4") rh = ImageSource(".\Ruller-1920px.png",End=0) rh = rh.levels(32,1.0,128,0,255,false) # Make rule, a bit more visible. Apply_RuledGrid(c,rh,true,true) return last Function Apply_RuledGrid(clip c, clip rule_h, bool "horiz", bool "Vert", [* Rule args *] \ int "LineInt", int "bold", int "vBold", [* Grid Args *] \ int "color", int "bcolor",int "vbcolor", [* Grid Args *] \ bool "Grid", bool "axis") [* Grid Args *] \ { c ConvertToRGB32() # We only support RGB32 output. rule_h = rule_h.ConvertToRGB32() myName = "Apply_RuledGrid: " horiz = Default(horiz,false) vert = Default(vert,true) Assert(horiz || vert,myName+"Horiz and vert both false, nothing to do") Assert(!horiz || rule_h.width >= c.width,myName+"clip width greater than rule_h width") Assert(!vert || rule_h.width >= c.height,myName+"clip height greater than rule_h width") r_h = (!horiz) ? NOP : rule_h.crop(0,0,width ,0) r_v = ( !vert) ? NOP : rule_h.crop(0,0,height,0).TurnRight # ALL Grid optionals are defaulted within Grid plugin, not here. g = Grid(LineInt=LineInt,bold=bold,vBold=vBold,color=color,bcolor=bcolor,vbcolor=vbcolor,Grid=Grid,axis=axis) corner = (horiz && vert) ? Last.Blankclip(Width=rule_h.height,Height=rule_h.height) : NOP h = (Corner.IsClip) ? Stackhorizontal(corner,r_h,corner) : (horiz) ? r_h : NOP m = (r_v.IsClip) ? StackHorizontal(r_v,g,r_v) : g (h.IsClip) ? StackVertical(h,m,h) : m } [clickme, twice] ![]() EDIT: OOoops re-posted, had bold and vbold as Bool instead of int. Also, changed to output of RGB32 (from YV12), makes more sense when 'gridded'. EDIT: Moved Rule args before grid args, easier to use eg Apply_RuledGrid(c,rh,true,true)
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 11th June 2023 at 12:01. |
![]() |
![]() |
![]() |
#17 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,258
|
Quote:
It's pretty easy to make your own grid using mt_lutspa (masktools2) . You can change the size , colors, overlay opacity etc... This example uses 16x16 grid (change the 16 if you want different x,y dimensions) . Change the opacity parameter for overlay if you want Code:
video=colorbars(pixel_type="YV12") grid=video.mt_lutspa(relative=false, expr="x 16 % 0 == y 16 % 0 == | 255 0 ?", u=-128,v=-128) overlay(video, grid, mask=grid, opacity=1) ![]() If you're trying to censor/ mask out that guy's face in post #14 (or anything moving, really, for any video) , use a NLE with a motion tracker. That will be 10x easier , faster, more accurate and actually "stick" to the face instead of randomly wobbling around. Dedicated masking and rotoscoping tools are going to be much better for those types of tasks. Avisynth is the wrong tool for that job . I saw some of your other threads on animated a block , conditional reader, it's a waste of time doing it that way and it won't even match the motion accurately. The video content motion is not linear to begin with. If you were going to do figure out x, y coordinates, scale - you might as well rotoscope it manually, the latter would still be faster, more accurate (you aren't limited to rectangle shapes) Last edited by poisondeathray; 11th June 2023 at 23:31. |
|
![]() |
![]() |
![]() |
#18 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,812
|
Some censor type stuff, here:- https://forum.doom9.org/showthread.p...93#post1935393
EDIT: Manual tracking only.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 12th June 2023 at 13:01. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|