Log in

View Full Version : New AviSynth tool - AvsP v1.4.0 (6/5/07)


Pages : 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

foxyshadis
7th September 2006, 10:56
Well, you sort of can... if you want to really horribly hack into avisynth's guts. :p Call the filter with no optional args, patch the constructor pointer in the vtable to your own vararg function, and examine the stack. Alternately, scan the initializer function's code for calls to AVSValue::AsBool, AsInt, etc, and read back a few bytes for the correct push instruction.

Of course, the documentation exists so we don't have to actually attempt that. ;D

Dr.D
7th September 2006, 16:08
Well, I'll think about it, but ultimately it would be an artificial comparison - the window's as small as your input video, any zoom besides a doubling point resize would be innaccurate for the sake of comparison. That's right, but from another hand we watch a clip in full screen finally :-).
Well, 2x zoom will be fine, I think, as well as full screen preview.

Whoa whoa whoa - that's the first I've heard of that! I've recently been testing on my laptop, so I guess anything's possible. Exactly when does this occur (always, or just in a certain window)?
Always and on both of my computers.

Fizick
7th September 2006, 16:54
qwerpoi,
filters decriptions import in v.1.04 is quite good,
but IMHO the better is not to import this data to options.dat, but simply use this avsfilters.txt file as is (or to import to some separate file, not to options.dat). It is for easy updating of this list. Now we must or delete whole options.dat, or remove every filter one by one.
And the best solution is to get this info directly from Avisynth.
al least in near future we will have (I hope) the final v2.5.7 with full functions info support. See this link (avsFilmCutter editor by Ebobtron) for compatibility of various Avisynth versions (Filter / Function List details):
http://members.aol.com/avsfilmcutter/fcwebguide1.html

qwerpoi
7th September 2006, 18:13
qwerpoi: Thanks for the update. Works great with the import from the textfile. Would you like a dll version that you can include with avsP?
A dll version would be great, but note that my program is written in python using ctypes, so I'd need a c-compatible dll using the stdcall calling convention, which might be a pain (for c++ dlls you have to make macros to export functions compatible with c, and possibly have to make a def file, and other stuff I don't know much about :) ). Definitely would be handy, though.


That's right, but from another hand we watch a clip in full screen finally :-).
Well, 2x zoom will be fine, I think, as well as full screen preview.
Again, a full screen comparison is unfair - your video card or something else is doing a resize algorithm to the clip. I'll work on a doubling zoom, though. If you're just looking to preview a single clip in full screen, use the external preview feature (hit the play button, select a player like media player classic or something, and you're off).
Always and on both of my computers.
Okay, I'm going to need some more info. Specifically which keys don't work (every key on your numpad, just the arrow keys, etc)? Is the video preview shown or hidden? Does this happen to anyone else?


but IMHO the better is not to import this data to options.dat, but simply use this avsfilters.txt file as is (or to import to some separate file, not to options.dat). It is for easy updating of this list. Now we must or delete whole options.dat, or remove every filter one by one.
If you use tsp's program, you don't need to delete every filter - any filter from the avsfilters.txt will override the internal filter info in the options.dat. The reason for keeping them separate is what I mentioned in an earlier post - the filter info stored in options.dat can store more than just the filter name and arguments, you can store comments or notes, min and max values for certain arguments to help with user sliders, etc (from the menu Options -> AviSynth filters). This format conflicts with the text format (one filter per line), and I didn't want to keep saving and converting between the two - it's sort of a compromise.

And the best solution is to get this info directly from Avisynth.
al least in near future we will have (I hope) the final v2.5.7 with full functions info support. See this link (avsFilmCutter editor by Ebobtron) for compatibility of various Avisynth versions (Filter / Function List details):
http://members.aol.com/avsfilmcutter/fcwebguide1.html
Yes, reading from AviSynth is the best way to do it, but currently my program is not so sophisticated (it doesn't communicate with AviSynth directly, it just makes and saves .avs files). Certainly this can be viewed as a big drawback, it's something I'll work on (although it's hardly crippling, the majority of the usability is already there imo). Again, tsp's program is already able to generate the text file (assumming you're using AviSynth 2.5.6 or above). Anyway, thanks for the link, I'll try to read up on it.

qwerpoi
7th September 2006, 19:21
Holy schnoz, Batman! Someone made a website in Japanese about AvsP on the avisynth.info wiki! It's looks like a tutorial in an effort to translate all the features, it's got a bunch of screenshots (I should feel ashamed, since I didn't even make an official homepage :) ), looks very well done, check it out here:

http://www.avisynth.info/?AvsP

This plus the german doom9 post, wow, I'm glad my program supports unicode filenames :)

Fizick
7th September 2006, 20:33
the filter info stored in options.dat can store more than just the filter name and arguments, you can store comments or notes, min and max values for certain arguments to help with user sliders, etc (from the menu Options -> AviSynth filters). This format conflicts with the text format (one filter per line), and I didn't want to keep saving and converting between the two - it's sort of a compromise.


In this case, can you use not general options.dat, but some another file (filters.dat) for this?

Fizick
7th September 2006, 20:35
About japanese, german, russian: how we can localize the AvsP program interface? (menu items, etc)

Dr.D
7th September 2006, 21:09
Again, a full screen comparison is unfair - your video card or something else is doing a resize algorithm to the clip. I'll work on a doubling zoom, though.
OK, thanks!

If you're just looking to preview a single clip in full screen, use the external preview feature (hit the play button, select a player like media player classic or something, and you're off).
No, I'm looking for comparison.

Okay, I'm going to need some more info. Specifically which keys don't work (every key on your numpad, just the arrow keys, etc)? Is the video preview shown or hidden? Does this happen to anyone else?
All "white" numpad keys don't work ("Grey" keys work though).
With and without the video preview.

qwerpoi
7th September 2006, 21:29
In this case, can you use not general options.dat, but some another file (filters.dat) for this?
Hmm, I'd like to keep all the options in a single file if possible. Would be equivalent if I gave a way to clear all the filter info (either in the program or with the avsfilters.txt)?

About japanese, german, russian: how we can localize the AvsP program interface? (menu items, etc)
Whoa, I guess I never thought it out that far. I'll take a look into how difficult it would be to read this kind of info from files (if you could let me know of any programs that do this gracefully, that would help).

All "white" numpad keys don't work ("Grey" keys work though).
With and without the video preview.
Um, what are "white" keys and what are "grey" keys? Regardless, I'll try to investigate on some different pcs when I get the chance.

foxyshadis
7th September 2006, 22:12
http://pyicu.osafoundation.org/ is one of the more robust frameworks, based on the same stuff (ICU) java's i18n is. Use information can be found at icu's sourceforge site (http://icu.sourceforge.net/userguide/strings.html), which is sloooooooooooow today. Besides that, wx has the gettext() library for basic string translation.

Dr.D
7th September 2006, 22:41
Um, what are "white" keys and what are "grey" keys? Regardless, I'll try to investigate on some different pcs when I get the chance.
Sorry,
Arrows, Home, End, PgUp, PgDn, Ins, Del - do NOT work.
/, *, -, +, Enter - work.

mimage
7th September 2006, 22:59
Thanks for the great program!
Couple of issues:
1. Could you please add a zoom feature in preview? It's really hard to see the difference between clips starring to tiny window.
I must say it works fine for me.. I don't know why you call the screen tiny?? I guess it would be a nice added feature I guess it would be like the zoom option in vdub though I never use it. Might use something like that if I could adjust filters as look at a specific part of the picture. If not then I don't think I'd go through the trouble.. wouldn't be needed really IMO.

Maybe a default button for the user slider options. Have a place to set the number and then have a button like on the right side of the sliders. Like there's the "Initial Value" option but that changes around as you mess with your settings and I have to put the default one I had in wordpad or in a separate avs script just incase I want to put it back to the way it was before. Maybe have this as a side option because I guess there is needed space for the sliders so a default button might take up space.

I've found out the defaults and the mins of maxes of certain filters and made user sliders out of them..

Tweak(hue=[<"Tweakhue", -180, 180, 0.0>],sat=[<"Tweaksat", 0, 10.0, 1.0>],bright=[<"Tweakbright", -255, 255, 0.0>],cont=[<"Tweakcont", 0, 10.0, 1.0>])

Levels([<"Lvlsinputlow", 0, 255, 0>],[<"Lvlsgamma", 0.010, 10.000, 1.000>],[<"Lvlsinputhigh", 0, 255, 255>],[<"Lvlsoutputlow", 0, 255, 0>],[<"Lvlsoutpthigh", 0, 255, 255>])

msharpen(threshold=[<"mshrpnthrshhld", 0, 255, 10>],strength=[<"mshrpnstrnght", 0, 255, 100>])

mftoon(strength=[<"mftoon", 0, 255, 255>])

aWarpSharp(depth=[<"awarpsdepth", 0.0, 64.0, 16.0>],blurlevel=[<"awarpsblur", 1, 4, 2>],thresh=[<"awarpthresh", 0.0, 1.0, 0.5>],cm=[<"awarpcm", 0, 2, 2>])

Just thought I'd post them incase they might be of some use for someone.

Wish I could insert them easier instead of copying these settings from an RTF file. Maybe the option's there and I just haven't ran into it yet.

One of my main concerns is not having to look back at the RTF file to find out what the defaults were for the filters. Also one of the filters settings I posted above may not have the exact defaults set for it.. and I didn't know the min/max for certain filters as well.. for the Levels I just copied the min/max from the filter in VirtualDub but they can go higher(well duh they say so in the help options under avisynth)

I hope maybe those settings I put up there are helpful so people don't have to go through the trouble of typing them in. I'd appreciate the same help.

Edit: I'll put up more slider settings to the list in this post. All Initial value settings set are based off of what the default value are for the filters displayed under the Parameters in avisynth or it was explained in the notes found in a zip package for the filter, mentioned in the Avisynth Manual or I found the info on some website. Sometimes the Initial value settings will not be set to the default that's for the filter because I couldn't find out what the default was for the filter.

And a final note, I appreciate your work and thanks a bunch! This is one of the most helpful programs I use for cleaning up footage! I sure have a load of a lot easier time on finding the settings I want! ^__^

Mtz
8th September 2006, 00:08
Thanks mimage for your samples. I put them to look how they work and after saw them I have some suggestions for qwerpoi:
- can you made sliders smaller to enter more? or something to scroll if them are more than can enter in the program window.
- can you make a Reset button like I drawed on the right. The Reset button to be for the default value. Also a small "l" for the default value?
- if I I have too many sliders I can't resize the preview window

All I described is in the screenshot:
http://img60.imageshack.us/img60/5194/avspslidersgr4.th.jpg (http://img60.imageshack.us/my.php?image=avspslidersgr4.jpg)

enjoy,
Mtz

mimage
8th September 2006, 00:27
Also have a scroll bar for the User sliders. I don't like it that if I have a lot of sliders up that it stretches so maybe a scroll bar for that would be nice. Maybe have the up and down button placed on the bottom right or something and have it not effect the length of the sliders or how much of the slider shows on the screen. It would kinda suck to have to scroll left and right just to see the rest of the sliders because they are being covered off because of some added scroll bar feature and the size of the sliders are really nice.. I hope in future releases you don't have to make them smaller for any reason. Not saying have a scroll bar for the video preview window but it would be nice to have something worked out for the sliders.

mitz wrote: "can you made sliders smaller to enter more? or something to scroll if them are more than can enter in the program window."

Yes it seems limited on how many I could put up because some of the sliders aren't showing up when I have a bunch of sliders set.

Here's what it looks like when I completely maximize the window on my pc screen.

http://img67.imageshack.us/img67/5273/screenhunter001co9.th.jpg (http://img67.imageshack.us/my.php?image=screenhunter001co9.jpg)

qwerpoi
8th September 2006, 01:54
Holy cow that's a lot of sliders :D ! I never really thought anyone would use like, more than four, but I guess I should have expected it. What I'll do is put the sliders in a scroll window like Mtz and mimage suggested, it'll take a little restructuring on my part but it should be doable. Let me throw out a warning, though - every time you release a slider, you are creating and loading a new .avs script. So you'll consume quite a lot of ram if you're sliding around a lot. Well, it's a video editing app, so I guess that's expected, but just thought I'd let you know.

Wish I could insert them easier instead of copying these settings from an RTF file. Maybe the option's there and I just haven't ran into it yet.
No option like that yet, but it's something that can be worked on. It has suggested that there may be ways to get info from the plugins or AviSynth itself, but right now it doesn't seem to be straightforward. I'll try and work on an easy way to store and load slider info.

Edit: Wait a sec, if you just want a quick way to insert a chunk of predefined text, you can make a macro pretty easily. Make a text file with the following text:

avsp.InsertText('Tweak(hue=[<"Tweakhue", -180, 180, 0.0>])')
Save the text file into your "Macros" directory and name it "TweakWithSlider.py" (or any name you want, but make sure about the .py extension). Start up AvsP.exe, you can now insert this text from the Macros menu. Note that only the first four macros get keyboard shortcuts, so this isn't a complete solution, but it's a good temporary workaround, I'll still think of ways to do this more specifically for slider info.

- can you make a Reset button like I drawed on the right. The Reset button to be for the default value. Also a small "l" for the default value?
Okay, let me think about ways to make this work.

mimage
8th September 2006, 03:14
- can you make a Reset button like I drawed on the right. The Reset button to be for the default value. Also a small "l" for the default value?

Okay, let me think about ways to make this work.

And could you make it so you could set what you want as the default in the "Define user slider" window? I used photoshop and added a line were you can add that info as an example..

http://img115.imageshack.us/img115/7380/defineuserslidertk8.jpg

Kind of like that.

Dr.D
8th September 2006, 04:49
Looks like only me is so stupid...:(

How to save
1. Sliders.
2. Whole "project", I mean when I reopen the program I would like to see all the tabs, all the sliders again.

Looks like everybody can do this easy, someone created zillions of sliders in one script, I can't beleive that he inserts all of them each time...

qwerpoi
8th September 2006, 05:00
Looks like only me is so stupid...:(

How to save
1. Sliders.
2. Whole "project", I mean when I reopen the program I would like to see all the tabs, all the sliders again.

Looks like everybody can do this easy, someone created zillions of sliders in one script, I can't beleive that he inserts all of them each time...
No, you're not stupid, there's currently no way to save sliders or a project. Some people are copying their script into a separate text editor in order to keep the slider text. There's no built-in way to save sliders because to me, sliders are meant to be a temporary way to evaluate good filter strength values, similar to virtualdub, or photoshop, or something. But I'll try and add a feature to save a project, which will save the scripts in all open tabs with the slider info, it's a reasonable request.

Balm
8th September 2006, 09:40
Just want to say "Great work!!!" :thanks:

Cu Balm

krisq
8th September 2006, 10:14
I've just stumbled on a little problem. I've set avsp as my default editor for .avs files. When I create new .avs (i'm using Total Commander, i'm creating new file with shift+f4) the name of the file is not passed to avsp and when i'm saving i have to enter the name again in the save dialog. Notepad and others do not have this problem.

qwerpoi
8th September 2006, 10:50
@Balm
b^_^ (this is my custom "you're welcome" smiley)

I've just stumbled on a little problem. I've set avsp as my default editor for .avs files. When I create new .avs (i'm using Total Commander, i'm creating new file with shift+f4) the name of the file is not passed to avsp and when i'm saving i have to enter the name again in the save dialog. Notepad and others do not have this problem.
Hmm, that's interesting, works fine for me. Can you tell me the exact name of the text file you're having trouble with?

krisq
8th September 2006, 11:00
I don't know if you've understood me correctly so:
shift+f4, i get the dialog from TC where i enter the name of the file to create (test.avs), press 'ok' and then avsp shows up but the name is not passed to it. All i get is 'New Tab' instead of test.avs.

BTW download link is dead for some reason :)

qwerpoi
8th September 2006, 11:23
I don't know if you understood me correctly so:
shift+f4, i get the dialog from TC where i enter the name of the file to create (test.avs), press 'ok' and then avsp shows up but the name is not passed to it. All i get is 'New Tab' instead of test.avs.
Okay, I think I understand, I'll download total commander and investigate the issue.

BTW download link is dead for some reason :)
You're right, it's not just the download link though, avisynth.org is down for the moment (hopefully it's maintenence and not because my prog is sucking too much bandwith :scared: )

Mtz
8th September 2006, 11:37
Is possible when clicking in the area from the picture the slider to be moved with only one unit? If the distance between min and max values is big I cannot fine tune the slider.
http://img213.imageshack.us/img213/9871/avspclickjm7.jpg
I think instead the "slider arrow" you can make a small "slider rectangle" to save space for sliders.

Thanks for the "TweakWithSlider.py" idea. I hope someday we will have a database with sliders for all filters. Them can be very useful for learning more easy avisynth. Now I learned how to... "Tweak the Hue":cool:. If we already have sliders, Dr.D will not need the option to save them, even I like also his idea.

enjoy,
Mtz

Henrikx
8th September 2006, 12:26
@qwerpoi
Is it possible to write a multi language Wiki ?
Possibly someone begins with English,and than Russian,German,French..etc ?
And please,no directly links to Decrypter,etc.. ,like meGUI Wiki,that is forbidden in Germany.Sad but Truth !

krisq
8th September 2006, 14:05
Okay, I think I understand, I'll download total commander and investigate the issue.


That's great because I can't live without TC :D
Also, is there a way to make avsp use only one instance?
if I 'do the enter' on two .avs files i get two instances of avsp instead of one with two tabs.

mkanel
8th September 2006, 15:10
@tsp,

Good idea on the extractfilters application. Would it also be possible to read the syntax from user defined functions (avsi) in the Avisynth plugin directory?

@qwerpoi,

Thanks, great program.

Mike.

Dr.D
8th September 2006, 15:23
No, you're not stupid, there's currently no way to save sliders or a project. Some people are copying their script into a separate text editor in order to keep the slider text. There's no built-in way to save sliders because to me, sliders are meant to be a temporary way to evaluate good filter strength values, similar to virtualdub, or photoshop, or something. But I'll try and add a feature to save a project, which will save the scripts in all open tabs with the slider info, it's a reasonable request.Thanks, it will be a good feature of your wonderful program!

mkanel
8th September 2006, 16:09
@qwerpoi,

To make it easier to use your program with user defined functions (*.avsi), could you have it treat an avsi extension as it does an avs extension? If I try to open an avsi or use drag and drop AvsP tries to open it with the DirectShowSource filter instead of letting me edit the function. Currently to edit an avsi with AvsP I need to open the avsi with another text editor and then copy and paste the contents into AvsP.

Thanks. Mike.

qwerpoi
8th September 2006, 17:20
Download link is working okay again.

Is possible when clicking in the area from the picture the slider to be moved with only one unit? If the distance between min and max values is big I cannot fine tune the slider.
Yep, I might try to add some buttons, trick is not to use up too much screen space. In the meantime, here's a trick to getting fine tuning - left-click on the slider tab and don't release, then use the keyboard arrow keys. A bit of twister action for those less coordinated, but it works for now.

I think instead the "slider arrow" you can make a small "slider rectangle" to save space for sliders.
Don't know what you mean by a slider rectangle. Are you referring to the dragging tab, or the whole slider in general?

Thanks for the "TweakWithSlider.py" idea. I hope someday we will have a database with sliders for all filters. Them can be very useful for learning more easy avisynth. Now I learned how to... "Tweak the Hue":cool:. If we already have sliders, Dr.D will not need the option to save them, even I like also his idea.
Ho ho, the upcoming version will have a way to store slider info on a filter-per-filter basis, look forward to it :)

Is it possible to write a multi language Wiki ?
Possibly someone begins with English,and than Russian,German,French..etc ?
And please,no directly links to Decrypter,etc.. ,like meGUI Wiki,that is forbidden in Germany.Sad but Truth !
Multi language? I'm only fluent in two languages, English and AviSynth :). But you're right, there's definitely a need for complete documentation, all these features are getting out of hand. I guess I'll get working on it after I finish with this upcoming release.

That's great because I can't live without TC
Help me out then, for me tc keeps opens new avs files with notepad! I've registered .avs files with AvsP.exe such that double-clicking in either windows explorer or tc works, I even used "Associate With..." in tc, but it still opens avs files with notepad using the Shift-F4 feature. Am I missing something?

Also, is there a way to make avsp use only one instance?
if I 'do the enter' on two .avs files i get two instances of avsp instead of one with two tabs.
Should be doable, I'll look into it.

To make it easier to use your program with user defined functions (*.avsi), could you have it treat an avsi extension as it does an avs extension?
Good point, I'll take care of that.

krisq
8th September 2006, 18:32
Help me out then, for me tc keeps opens new avs files with notepad! I've registered .avs files with AvsP.exe such that double-clicking in either windows explorer or tc works, I even used "Associate With..." in tc, but it still opens avs files with notepad using the Shift-F4 feature. Am I missing something?


no problem :). 'configuration/options/edit/view' and there you can set default editor.
i'm using something called 'choiceeditor' for tc that basically lets you choose different editors for each extension. but this should do the trick without the need to install any third-party plugins.

tsp
8th September 2006, 23:02
A dll version would be great, but note that my program is written in python using ctypes, so I'd need a c-compatible dll using the stdcall calling convention, which might be a pain (for c++ dlls you have to make macros to export functions compatible with c, and possibly have to make a def file, and other stuff I don't know much about ). Definitely would be handy, though.

the calling convention is not a problem. But currently it only registers the autoloaded plugins while manually loaded plugins and user functions (including the ones in .avsi) is not included.
A solution could be to export two functions from the dll:
const char* __stdcall GetParam()
that returns all autoloaded user function and plugins in same format as the current avsfilters.txt
and
const char* __stdcall GetParam(const char* plugin)
that returns the filters and parameters in the dll file plugin
This would require avsP to scan the avs file and imported avs files for LoadPlugin and call GetParam for each instance. At the same time you could add user functions as well

qwerpoi
8th September 2006, 23:45
no problem :). 'configuration/options/edit/view' and there you can set default editor.
i'm using something called 'choiceeditor' for tc that basically lets you choose different editors for each extension. but this should do the trick without the need to install any third-party plugins.
Found the problem (issue with switching working directories), it'll be fixed in the new release (which hopefully be out in a few days). Thanks for bringing it to my attention.

A solution could be to export two functions from the dll:
const char* __stdcall GetParam()
that returns all autoloaded user function and plugins in same format as the current avsfilters.txt
and
const char* __stdcall GetParam(const char* plugin)
that returns the filters and parameters in the dll file plugin
This would require avsP to scan the avs file and imported avs files for LoadPlugin and call GetParam for each instance. At the same time you could add user functions as well
I think it would be okay to just get all autoloaded functions as a start. I imagine dynamically adding plugin info from scanning the script would cause me some complications with syntax highlighting and such, and since AviSynth is not a declaritive language it could be error prone. But it's worth trying out, so having both functions would be great. One favor you could do for me is if you haven't already compiled the dll, name the second function GetParamFromDll (or something), since I'm not sure how good ctypes is at handling overloaded stuff.

Mtz
9th September 2006, 02:10
Don't know what you mean by a slider rectangle. Are you referring to the dragging tab, or the whole slider in general?
Something like this:
http://img61.imageshack.us/img61/2166/rectanglexa2.jpg

enjoy,
Mtz

JoeBG
9th September 2006, 05:53
Hi,

how can I manage it to write a macro for just inserting scripts like the following:

#
##DeLogo##
import("C:\Video\Avisynth\AviSynth 2.5\DeLogo\DeLogo.avs")
DeLogo( x1, y1, "RO", "ARD", Cmix=0.0, Lmix=0.0)
#

The name of the skript is DeLogo and I want to insert it with a simple click. Any idea how to manage this?

foxyshadis
9th September 2006, 05:56
C++ compiles overloaded functions into these really ugly names that encode all the arguments & types (as well as which should be passed on the stack and which as registers - none with stdcall), see this page (http://www.kegel.com/mangle.html). It's so much friendlier calling from C when it's declared as extern C with explicitly different names.

vcmohan
9th September 2006, 13:17
I have been trying to use this new tool for the last two days. I get some times errors even for opening DirectShowSource file but not always. Sometimes it just hangs. I also got a semipersistant ( for a few trials) error stating that an unexpected character [ was found. Now I am not getting this error without me doing any thing.May be My system is going bad

I have tried using some thing like this.
fht = a.height() or 480 and tried putting this in the maximum value of a parameter like.
[<"hmax",0,fht,20>]. But I got an slider error stating invalid entry. As shown in one Macro it should be possible to get these values as fht=avsp.GetHeight() and use. Will it be required each time to %,...%...%.>], fht, fht, fht)

Is there a way to select true or false entry with radio buttons may be?
If my string of params have some true/ false, some integer variables, some string variables how can I input the string variable and bool value in the param specification?As below?
Myplugin( reverse = false, option = "one", xx=[< "xx",0,100,4>],...)

qwerpoi
9th September 2006, 19:06
Hi,

how can I manage it to write a macro for just inserting scripts like the following:

#
##DeLogo##
import("C:\Video\Avisynth\AviSynth 2.5\DeLogo\DeLogo.avs")
DeLogo( x1, y1, "RO", "ARD", Cmix=0.0, Lmix=0.0)
#

The name of the skript is DeLogo and I want to insert it with a simple click. Any idea how to manage this?
Easy enough, the Template Example.py in your macros directory is a good thing to look at for basic text insertion. Here's the DeLogo macro, copy and paste into a text file in your Macros directory named DeLogo.py:
avsp.InsertText(
'''#
##DeLogo##
import("C:\Video\Avisynth\AviSynth 2.5\DeLogo\DeLogo.avs")
DeLogo( x1, y1, "RO", "ARD", Cmix=0.0, Lmix=0.0)
#'''
)
The macro is only using one function, avsp.InsertText(), which by default inserts the given text into the current tab at the current cursor position. Also note the text was surrounded by triple single quotes, which is a special string that preserves newlines and stuff. This macro will show up in the Macros menu the next time you start up AvsP, the first 4 macros get keyboard shortcuts F1 through F4, so you may need to rename some of the macro files to get them in the order you want (they are sorted alphabetically). You can read the macros_readme.txt if you want to learn about other available functions.

I have been trying to use this new tool for the last two days. I get some times errors even for opening DirectShowSource file but not always. Sometimes it just hangs. I also got a semipersistant ( for a few trials) error stating that an unexpected character [ was found. Now I am not getting this error without me doing any thing.May be My system is going bad
The way the sliders work internally is that whenever you preview the video, the program searches for chunks of text "[<...>]" and replaces it with the last number. So if you get an error about the unexpected character [, then either the program failed to properly find all the "[<...>]" text or there is an extra bracket somewhere in the script (the AviSynth language does not use brackets).

I have tried using some thing like this.
fht = a.height() or 480 and tried putting this in the maximum value of a parameter like.
[<"hmax",0,fht,20>]. But I got an slider error stating invalid entry. As shown in one Macro it should be possible to get these values as fht=avsp.GetHeight() and use. Will it be required each time to %,...%...%.>], fht, fht, fht)
Your example of using an AviSynth variable fht for a slider parameter will currently not work, since it would require either directly communicating with AviSynth or parsing the script syntax, of which my program does neither (although it's a good idea for the future). Basically, you will run into the least amount of trouble if you create user sliders with the dialog box (in the right-click menu, or use keyboard shortcut F12). Looks like it might be annoying for the script you're trying to make, but that's the way it is for now :( . Note that the macro example you brought up, avsp.GetHeight(), is getting info from the script's output, as opposed to getting info internally from AviSynth itself. I guess it's important to keep in mind that the user sliders aren't very sophisticated, they just allow a way to define a slider with a min and max numerical value, it actually has very little to do with AviSynth specifically. If you're still getting issues with slider bars, post your entire script here.

Is there a way to select true or false entry with radio buttons may be?
If my string of params have some true/ false, some integer variables, some string variables how can I input the string variable and bool value in the param specification?As below?
Myplugin( reverse = false, option = "one", xx=[< "xx",0,100,4>],...)
It's not currently possible, but it's a good idea, one that I've thought about occasionally. It took me quite a while to determine a syntax for the current style of user sliders that was both flexible and easy to understand, it's probably take a lot of work to extend the syntax without blowing up the complexity. I'll try and think about it some more.

vcmohan
10th September 2006, 03:18
Thanks for the quick response. One more issue. Even if I comment out a line which has slider specifications the sliders still appear.

qwerpoi
10th September 2006, 03:37
Thanks for the quick response. One more issue. Even if I comment out a line which has slider specifications the sliders still appear.
Yup, I noticed that a little while ago too. I'll try to have it fixed by the next release, thanks for bringing it to my attention.

mimage
10th September 2006, 11:43
Thanks for the quick response. One more issue. Even if I comment out a line which has slider specifications the sliders still appear.
Isn't better to keep it that way and have it so you press refresh on the video to have them disappear? I don't know.. I'm very non technical with this stuff.. I might have misunderstood what problem you said you have. But I think it would be nice to have to just refresh.

Mtz
10th September 2006, 12:39
I come with some ideas:
1. what do you think to create a new tab called filters. When clicking on that tab to apear filters grouped by category and in every category to apear on the right when pointing to that category the available filters. (like you did for example at Video > Go to Bookmark > Last scrolled frame).
When clicking on a filter, if the user already defined sliders for that filter to pop-up a window asking something like: "Sliders available. Do you want to load them?" and a Yes, No and Cancel (Cancel for not loading the filter at all).
2. A small X button on the left of the filters line to delete the entire line.

http://img213.imageshack.us/img213/7883/avspnewtabym2.jpg (http://imageshack.us)

enjoy,
Mtz

midelic
10th September 2006, 13:57
Small sugestion.
Multiple tabs situation.
-Menu on the tab -Right click-close(to avoid go to "File" - "Close tab")

JoeBG
10th September 2006, 18:02
Easy enough, the Template Example.py in your macros directory is a good thing to look at for basic text insertion. Here's the DeLogo macro, copy and paste into a text file in your Macros directory named DeLogo.py:
avsp.InsertText(
'''#
##DeLogo##
import("C:\Video\Avisynth\AviSynth 2.5\DeLogo\DeLogo.avs")
DeLogo( x1, y1, "RO", "ARD", Cmix=0.0, Lmix=0.0)
#'''
)
The macro is only using one function, avsp.InsertText(), which by default inserts the given text into the current tab at the current cursor position. Also note the text was surrounded by triple single quotes, which is a special string that preserves newlines and stuff. This macro will show up in the Macros menu the next time you start up AvsP, the first 4 macros get keyboard shortcuts F1 through F4, so you may need to rename some of the macro files to get them in the order you want (they are sorted alphabetically). You can read the macros_readme.txt if you want to learn about other available functions.


Many thank for your quick help. I managed to insert some of my favourite skripts

qwerpoi
10th September 2006, 18:22
Isn't better to keep it that way and have it so you press refresh on the video to have them disappear? I don't know.. I'm very non technical with this stuff.. I might have misunderstood what problem you said you have. But I think it would be nice to have to just refresh.
What vcmohan means is that even when you refresh the video, any sliders in comments still show up in the video preview. This is because I simply searched for all instances of "[<...>]" in the text, regardless of whether it was in a comment or not. I've fixed this, it'll be in the next release, which will come out either today or tomorrow.

1. what do you think to create a new tab called filters. When clicking on that tab to apear filters grouped by category and in every category to apear on the right when pointing to that category the available filters. (like you did for example at Video > Go to Bookmark > Last scrolled frame).
When clicking on a filter, if the user already defined sliders for that filter to pop-up a window asking something like: "Sliders available. Do you want to load them?" and a Yes, No and Cancel (Cancel for not loading the filter at all).
Hmm, interesting idea. For now I have a different mechanism to load user sliders (new release either today or tomorrow), but your idea might be more clear for the average user. I'll give it some thought.

2. A small X button on the left of the filters line to delete the entire line.
You can already delete an entire line by left-clicking in the margin once, which highlights the entire line, then hit backspace or something.

Small sugestion.
Multiple tabs situation.
-Menu on the tab -Right click-close(to avoid go to "File" - "Close tab")
You can already close a tab quickly by clicking on it with the middle mouse button (like Firefox or other tabbed controls). Or use the keyboard shortcut Ctrl-W to close the current tab. I may put a right click menu on tabs in the future, though.

qwerpoi
10th September 2006, 23:37
New version 1.1.0, see first post for download link and updated screenshot, this one's a bigger update than the previous ones. The full changelog's at the end of the readme.txt, here's a list of requested changes in this release:

* scrolled window for user sliders (suggested by Mtz, mimage)

* buttons on user sliders for fine tuning (suggested by Mtz)

* click blue slider value to reset to initial value (suggested by Mtz, mimage)

* method for storing filter auto-complete presets (suggested by mimage)

* separate filters.dat (suggested by foxyshadis, Fizick)

* save all scripts as session with user sliders (suggested by Dr. D)

* video preview zoom levels (suggested by Dr. D)

> fixed improper opening files of .avsi files (thanks mkanel)

> fixed minor issue with working dir when opening files (thanks krisq)

> fixed commented sliders (thanks vcmohan)

You can see from the updated screenshot in the first post that for user sliders, buttons were added for fine tuning of numbers (the preview doesn't update until you release the button, similar to dragging the slider). Also you can click the blue numbers to reset the slider to its initial value.

There now exists an advanced way to store presets for each defined filter. In the "Options -> AviSynth filters..." you are able to edit, delete, or add new AviSynth filters and arguments - this is not a new feature. What's new is that if you add a line to the "Filter arguments" text box starting with "Preset: ", the program will use the preset text for autocompletion. Best explained with an example: if you find the function Tweak in the "Options -> AviSynth filters" dialog, you'll see the text box for the filter arguments containing:
(clip, float "hue", float "sat", float "bright", float "cont", bool "coring")
To add a preset, change the text as follows:
(clip, float "hue", float "sat", float "bright", float "cont", bool "coring")

Preset: Tweak([<"TweakHue", -180, 180, 0>], [<"TweakSat", 0, 10.0, 1.0>])

Click OK on the dialog box, restart the program, and now every time you use the autocomplete feature (keyboard shortcut Ctrl-Space or start a word with a capital letter) with Tweak, it will enter the preset text instead of "Tweak(". This way you can store custom preset values or user sliders for each individual filter, without having to jump back and forth with documentation. Note that the options.dat has been split into filters.dat and options.dat, where filters.dat contains all the AviSynth filter information, which makes it easier for people to share some of their filter info customizations.

Anyway, there are a couple of requested features that didn't make it into this release, most importantly a method for localizing the program interface for different languages - I'll still be working on those things. But I think unless there are any pressing issues the major focus will be putting together some complete documentation in one place (not exactly looking forward to it :) ). Let me know if there are any problems with the new release.

matrix
11th September 2006, 01:57
What I noticed is that when pressing the blue number to reset to the initial value, if it's a whole number, it adds a decimal , witch causes a script error.

BTW this is a great program. I love it.
Thank you very much.

Edit:

Also, F1 to F4 to insert macros, don't work anymore.
It asks to choose a directory, and creates an avs script for every file in that directory.
DirectShowSource("C:\AvsP\macros\TweakWithSlider.py")
Sharpen(1.0)
Info()

qwerpoi
11th September 2006, 02:49
What I noticed is that when pressing the blue number to reset to the initial value, if it's a whole number, it adds a decimal , witch causes a script error.
By gum, you're right! A small bug on my part - I updated the link with the corrected version (same version number, I added your fix to the changelog).

Also, F1 to F4 to insert macros, don't work anymore.
It asks to choose a directory, and creates an avs script for every file in that directory.
DirectShowSource("C:\AvsP\macros\TweakWithSlider.py")
Sharpen(1.0)
Info()
Sorry if I was unclear earlier, F1 through F4 run the first four macros, they don't insert macros. The version you download has four example macros, by hitting F2 you ran the "Batch example" macro, which does exactly as you described, it asks you to choose a directory and creates avs scripts accordingly. In order to insert a macro you've written into the menu, simply put the .py file in your Macros folder and start the program. Again, sorry if I was unclear in an earlier post.

krisq
11th September 2006, 09:03
Found the problem (issue with switching working directories), it'll be fixed in the new release (which hopefully be out in a few days). Thanks for bringing it to my attention.


Great news :D. One more thing. I think that separator between script window and video window should be 'moveable'.


hmm... v1.1.0 still not working for me as it should. the name of created file is not passed to avsp :(

qwerpoi
11th September 2006, 09:40
hmm... v1.1.0 still not working for me as it should. the name of created file is not passed to avsp :(
Arrgh, last-minute change with the save session feature broke the fix :mad:. I updated the link on the first post (same version number) - sorry about the inconvenience. Man, I'm running 0 for 2 on the bug score, hopefully those numbers will improve soon!

I think that separator between script window and video window should be 'moveable'.
Yeah, and it might be in the future, but for now that would give me all sorts of trouble. Basically there's a lot of work going on dynamically sizing the video output window along with the region for user sliders, with potential scroll bars on the video preview and the user slider area it makes things a lot cleaner on my side to keep the preview size fixed to the video height. If you need a quick shortcut to hide the video preview, try middle-mouse clicking anywhere on the video when it's shown.