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

qwerpoi
8th March 2007, 21:01
Finally got a capture of that allusive startup error window !! As Terranigma noted is closes AvsP on startup.
Thanks for the nimble screenshot :), and sorry about the bug, I'll have it fixed by the next release. And I'll see what I can do about redirecting the error messages to a text file for cases like these...

Just recently discovered avsP and starting to seize the potential of this application in script editing.

I was wondering if there was a possiblity to store (and access) global variables in a macro so another macro could use a global variable stored in a previous macro?

It could take the form of a key/value dictionary in avsp object that would allow different macros to access the same dictionary and fiddle with previously saved values.

Thanks in advance, keep on the good work.
It's a good idea, but you should be able to implement it already without extra macro functions. Basically use cPickle to dump and load from a file named "vars.dat" (or whatever) which stores your dictionary. Something like this:

import cPickle
import os

# Load the persistent variables
if os.path.isfile('vars.dat'):
f = open('vars.dat', mode='r')
vars = cPickle.load(f)
f.close()
else:
vars = {}

# Your macro goes here...
# Access, add, or delete entries to the vars dictionary...
#

# Save the persistent options
f = open('vars.dat', 'w')
cPickle.dump(vars, f)
f.close()

I could possibly add macro functions to wrap this kind of stuff, but it doesn't seem worthwhile to save a couple of lines of code at the expense of reduced freedom. I guess what I'm saying is that in order to use a macro function like this, you'd have to be pretty familiar with Python, and if you're pretty familiar with Python, you already know or can figure out how to use cPickle to store persistent data. Let me know what you think.

Excellent work qwerpoi, as always :).
Something cool came to my mind lately. When you make a preset like

LeakKernelDeint (order=0, threshold=6, sharp=true, map=false)

it would be nice if we could do something like

LeakKernelDeint (order=%C, threshold=6, sharp=true, map=false)

where %C is the cursor so that way we could immediatley edit this value without scrolling to it. What do you think?
Interesting suggestion, I'll try and have it in the next release.

@qwerpoi

:thanks:

Update German Translation 1.3.7
You may want to update your translation - starting from this version, you can translate 'Ctrl' to 'Strg' without messing up the keyboard shortcuts (I think 'Alt' and 'Shift' don't need translating on German keyboards, but you can translate those as well).

Hi!
At first, I want to thank qwerpoi for the nice job.
:thanks:
Second: we prepared an italian translation for the tool (for the version 1.3.6). You can find it here (http://people.ee.ethz.ch/~rporetti/AvsP_Trad/AvsP_1.3.6_translationITA.zip)
Very cool, always nice to have another language. I'll add the link to the first post and the website.

Eggroll
9th March 2007, 01:38
I don't know python, I happened to research about it. I've been programming for the past 7-8 years, mostly c, c++ and c# so I still understand what's going on without being familiar with python's syntax and all that.

I thought of using a temp file at first but it seemed like an awful lot of mess to create a file (and eventually delete it), possibly dealing with ntfs permission, file lock and all that. I know it's possible and easy to do, but I was looking for a 'cleaner' way of storing temporary variables in memory since it's usually where I'll want to store it anyway.

The problem with a file is that it persists even when the application is closed.

As a temporary solution, I wrote my variables in the clipboard so I don't have to manage files on disk.

Anyways, thanks for your answer, if no change is made, I'll just either use clipboard like I do now or use cPickle. Not my favorite method but it'll work just as good since my purpose is to write macros to ease the creation of script, even at the expense of creating a few intermediary files that the user can clean out whenever it is needed.

khs81
9th March 2007, 09:27
I'm sorry, better correct the link i gave you for the italian translation with the one without the version number included in the namefile, so that the link remains the same also when a new version come out and I post the new translation.

Here (http://people.ee.ethz.ch/~rporetti/AvsP_Trad/AvsP_translationITA.zip) you find the new link.

Thanks and sorry for this little mistake

qwerpoi
9th March 2007, 19:09
The problem with a file is that it persists even when the application is closed.
I misunderstood your first post, I thought you wanted persistence, my mistake. Of course cPickle will still work for what you need, as well as your clipboard solution, but neither is optimal, so I'll see what I can come up for the next version.

I'm sorry, better correct the link i gave you for the italian translation with the one without the version number included in the namefile, so that the link remains the same also when a new version come out and I post the new translation.

Here (http://people.ee.ethz.ch/~rporetti/AvsP_Trad/AvsP_translationITA.zip) you find the new link.

Thanks and sorry for this little mistake
No problem, I updated the links on the website and first post accordingly.

Eggroll
10th March 2007, 13:09
I'll be waiting then...


Thanks!

zemog
10th March 2007, 13:20
@qwerpoi

:thanks: One more time

TheRainmaker
11th March 2007, 17:39
Finally got a capture of that allusive startup error window !! As Terranigma noted is closes AvsP on startup.

http://img80.imageshack.us/img80/6562/capturepz7.jpg

If you still got a problem to open AvsP try this;
Delete all of things about AvsP aplication and if you still have zipped file(or download again) extract again in any folder...
It will be work %100...

foxyshadis
12th March 2007, 19:11
I've been trying out the new syntax highlighting tools, now that the function definitions are all up-to-date, and I'm loving it! =D I was wondering if you think it'd make sense to highlight the function argument names, and maybe extend the comment background to the edge of the window. It's all pretty smooth, though.

Also, have you had any word about how well avsp runs on *nix systems? Just curious.

Oh, and concerning Python and single-instance, it looks like the budget method is a workable one:
http://mail.python.org/pipermail/python-list/2000-October/057530.html
http://mail.python.org/pipermail/python-list/2000-October/057670.html
But you still have to come up with some method to pass in data, without sockets or COM. In Win32 you can register an event handler to fire when a file or folder is updated, then you could read information out of that and activate yourself, but I have no idea if you could do that in python.

Alain2
12th March 2007, 20:00
French translation updated ;)
Well done, another long and good changelog, and syntax highlighting seems fixed this time! :) Only one small request: can the syntax highlights have priority on the "Highlight current line" option ? Meaning,when a background color has been defined in some syntaxe highlight, can it stay even when the line is selected (and therefore highlighted)?

The new macro created lots of new inputs with the arguments in the functions definition, that's nice ; do you think it would be possible for it to distinguish between required and optional parameters, and add " for the arguments accordingly ? But maybe this information is not available from avisynth 2.5.7...

I haven't had a chance yet to test the rest of the new features, but they sound very cool in the changelog and your explanations !

tsp
12th March 2007, 20:22
The new macro created lots of new inputs with the arguments in the functions definition, that's nice ; do you think it would be possible for it to distinguish between required and optional parameters, and add " for the arguments accordingly ? But maybe this information is not available from avisynth 2.5.7...!
The information is unfortunately not available for avisynth as it is the individually filters that defines what parameter is necessary and they are no way to tell avisynth what parameters that are needed.

foxyshadis: interprocess communication (sockets) is available for python just look at the python docs: http://docs.python.org/lib/ipc.html
also by using ctypes it should be easy to create a mutex to check for only 1 instance of avsp

foxyshadis
12th March 2007, 21:59
He said sockets add a meg to the install though. :p I was just trying to think of hackish ways of doing it to keep the size down.

Alain, in plugins, all named arguments are optional, required ones can't have names in avisynth. It's nice to manually enter the required names, though, and then you would need that. TO get the macro to do that for you, change:

arglist=arglist+" "+namedargname

to

arglist=arglist+' "'+namedargname+'"'

And then change overwriteAll to True on the bottom, rerun it, and you should have quoted args. Good idea btw.

tsp
13th March 2007, 00:20
He said sockets add a meg to the install though. :p I was just trying to think of hackish ways of doing it to keep the size down.

okay didn't see that. So using ctypes to access the windows API IPC function would be a solution (and rather hackish too :) )


Alain, in plugins, all named arguments are optional, required ones can't have names in avisynth. It's nice to manually enter the required names, though, and then you would need that. TO get the macro to do that for you, change:

arglist=arglist+" "+namedargname

to

arglist=arglist+' "'+namedargname+'"'

And then change overwriteAll to True on the bottom, rerun it, and you should have quoted args. Good idea btw.
sorry it is only true for the build-in filters. As an example try compiling this filter:

AVSValue __cdecl CreateExample(AVSValue args, void* user_data, IScriptEnvironment* env) {
int i=args[1].AsInt(1) ;//default is supplied so even if it is not named it is optional
return args[0].AsClip();//no default so required even if it is a named arg.
}

extern "C" __declspec(dllexport) const char* __stdcall AvisynthPluginInit2(IScriptEnvironment* env) {
env->AddFunction("Example", "[required]ci", CreateExample, 0);
}

The filter created would take this syntax "Example(clip required, int)". the named argument "required" is needed as there are no default value while the unnamed argument int is optional because a default value is provided.

qwerpoi
13th March 2007, 04:00
@qwerpoi

:thanks: One more time
Thanks for the translation update, I updated the links accordingly.

If you still got a problem to open AvsP try this;
Delete all of things about AvsP aplication and if you still have zipped file(or download again) extract again in any folder...
It will be work %100...
Yes, you're right, you only need to delete _last_session_.ses for things to work. The problem is is that if you have scripts with unicode in them, it's possible for the issue to come up again. I'll try and have this bug squashed once and for all in the next release.

I've been trying out the new syntax highlighting tools, now that the function definitions are all up-to-date, and I'm loving it! =D I was wondering if you think it'd make sense to highlight the function argument names, and maybe extend the comment background to the edge of the window.
Some good suggestions, I'll see what I can do.

Also, have you had any word about how well avsp runs on *nix systems? Just curious.
Although wxPython is cross-platform, AvsP uses some windows-specific functions, particularly in the video display code, which calls up on avifil32.dll and msvfw32.dll via the ctypes python package (although currently the display code is being rewritten by tsp to utilize avisynth.dll instead of avifil32.dll...). The display code is pretty well separated, so making AvsP cross-platform shouldn't be too much work (in theory). Of course, unless I'm missing something, it's not an issue until Avisynth 3.0 comes out. Whenever that happens, the display code can be rewritten to utilize the interfaces that Avisynth 3.0 would provide.

Oh, and concerning Python and single-instance, it looks like the budget method is a workable one:
http://mail.python.org/pipermail/python-list/2000-October/057530.html
http://mail.python.org/pipermail/python-list/2000-October/057670.html
But you still have to come up with some method to pass in data, without sockets or COM. In Win32 you can register an event handler to fire when a file or folder is updated, then you could read information out of that and activate yourself, but I have no idea if you could do that in python.
Thanks for the info, I'll give it a look over. And yes, you should be able detect when a file or folder is activated in python using ctypes and win32 itself (here's a link (http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html) if you're curious). Of course, that would be adding even more windows-specific code...:p

Only one small request: can the syntax highlights have priority on the "Highlight current line" option ? Meaning,when a background color has been defined in some syntaxe highlight, can it stay even when the line is selected (and therefore highlighted)?
Thanks for the translation update. As far as highlighting priority is concerned, I'm not sure if it's possible, but I'll check it out.

The new macro created lots of new inputs with the arguments in the functions definition, that's nice ; do you think it would be possible for it to distinguish between required and optional parameters, and add " for the arguments accordingly ? But maybe this information is not available from avisynth 2.5.7...
I don't know too much about AviSynth's internals, so whatever tsp and foxyshadis said :). Perhaps if we're looking to the future, it would be possible to enforce plugin design in Avisynth 3.0 to specify which arguments are defaults and which are required, and furthermore specify ranges of allowable values for each argument, which would lead to the ability to automatically create user sliders for each filter. Which is not an important feature to me, but people seem to like going crazy with those user sliders :).

Veiga
13th March 2007, 06:03
@qwerpoi


:thanks:

Portugues translation release for v1.3.7

foxyshadis
13th March 2007, 18:08
The filter created would take this syntax "Example(clip required, int)". the named argument "required" is needed as there are no default value while the unnamed argument int is optional because a default value is provided.

That is true, although in practice the convention almost always holds. I can only think of a couple of filters with any required named arguments, and none with optional unnamed. (Most languages with named arguments don't support that, too much confusion in parsing.) Good point, though.

Short of avisynth further extending the filter argument list, I guess there's no fullproof way to analyse it for optional/required, then.

nibbles
15th March 2007, 06:45
* added pixel position and color information to status bar (suggested by nibbles, jmac698)
:thanks:
Absolutely fantastic. I really appreciate the feature for updating the function defs based on 2.5.7.
Your app works so well, on one of my computers, I was still using v1.2.1. :)

I have a macro question if anyone has a few minutes. I have an avs script that starts off like this:
c1=AVISource("K:\B\1.avi", audio=true, pixel_type="YUY2").Trim(4,143101).Crop(8,0,-8,-10,true)
c2=AVISource("J:\B\2.avi", audio=true, pixel_type="YUY2").Trim(97,143195).Crop(8,0,-8,-10,true)
c3=AVISource("J:\B\3.avi", audio=true, pixel_type="YUY2").Trim(97,143195).Crop(8,0,-8,-10,true)

What I've done is write a macro that when activated adds a c2=c2.DeleteFrame(1234)
type of command in that script. Once I delete a frame from c2 for instance, I was hoping I could add some python code to my macro that reads in the second line and adds 1 to the Trim command final frame value so that the total number of frames is unchanged, like this:
c1=AVISource("K:\B\1.avi", audio=true, pixel_type="YUY2").Trim(4,143101).Crop(8,0,-8,-10,true)
c2=AVISource("J:\B\2.avi", audio=true, pixel_type="YUY2").Trim(97,143196).Crop(8,0,-8,-10,true)
c3=AVISource("J:\B\3.avi", audio=true, pixel_type="YUY2").Trim(97,143195).Crop(8,0,-8,-10,true)

But I have no idea how to parse the line and add 1 to the value.
Ok thanks for all you've done. Have a great week!
nibs

qwerpoi
15th March 2007, 18:28
Portugues translation release for v1.3.7

Thanks for the translation update, I updated the links on the first post and website accordingly.

What I've done is write a macro that when activated adds a c2=c2.DeleteFrame(1234)
type of command in that script. Once I delete a frame from c2 for instance, I was hoping I could add some python code to my macro that reads in the second line and adds 1 to the Trim command final frame value so that the total number of frames is unchanged, like this:
c1=AVISource("K:\B\1.avi", audio=true, pixel_type="YUY2").Trim(4,143101).Crop(8,0,-8,-10,true)
c2=AVISource("J:\B\2.avi", audio=true, pixel_type="YUY2").Trim(97,143196).Crop(8,0,-8,-10,true)
c3=AVISource("J:\B\3.avi", audio=true, pixel_type="YUY2").Trim(97,143195).Crop(8,0,-8,-10,true)

But I have no idea how to parse the line and add 1 to the value.
Hmm, this is not the easiest of tasks. Unfortunately, currently there's no way to replace sections of the text with macros, but it shouldn't be difficult to add to the next version. In the meantime, you can try something like this. Change your script to be:x = 143195

c1=AVISource("K:\B\1.avi", audio=true, pixel_type="YUY2").Trim(4,143101).Crop(8,0,-8,-10,true)
c2=AVISource("J:\B\2.avi", audio=true, pixel_type="YUY2").Trim(97,x).Crop(8,0,-8,-10,true)
c3=AVISource("J:\B\3.avi", audio=true, pixel_type="YUY2").Trim(97,143195).Crop(8,0,-8,-10,true)
where "x = 143195" is the very first line of your script (note the change "Trim(97,x)" in the c2 line). Then you can use this simple macro:
avsp.InsertText(' + 1', pos=(0,-1))
which will add a " + 1" to the end of the first line every time you run the macro. Note that the line "x = 143195" must remain in the same place, but does not need to be on the first line - if it was the 10th line then you would use a pos=(9,-1), etc. Not the prettiest solution if you plan on running this macro hundreds of times, but otherwise it gets the job done. I'll try and have some macros for positioning and replacing in the next version, but keep in mind that even with the ability to replace sections, a macro like this will likely be fragile (ie, might not work properly if you add lines to the beginning of the script, or change the name of variables, etc.) If anyone has a more clever solution, feel free to jump in.

nibbles
15th March 2007, 20:00
Hey that'll work perfectly. Unless somebody else wants positioning
and replacement macros, I'm set with what you just posted.
That is really gonna shine! :)

Alain2
17th March 2007, 12:43
Features request:
- Possibility to have the main script window "always on top" (especially when having set the video as a separate window ; coiuld be useful as well when using an external player, but personnally it's the interaction between the script and video windows that I am interested in)
- Option to limit the max width of the video (to say for instance for me 1550, as my screen resolution is 1600x1200) when using the auto zoom. That way I won't have to resize the video window for every different script I have, I would just expand to fullscreen the video window and always have the same video dimension for all my scripts..

jubilex
24th March 2007, 20:42
nevermind...

boombastic
29th March 2007, 18:53
Sorry if this has already been asked but i'd like to backup the script i made to an avi encoded with xvid and ,possibly with ac3 or mp3 audio.
I know that i can call avs2avi but how can i specify xvid options and parameters?
For the audio part how can i do?

boombastic
29th March 2007, 19:31
i'm almost done with this script:
mpeg2source("E:\Black2\prova.d2v")
trim(0,172155)
Crop(8,120,-8,-120)
parity = GetParity() ? 1 : 0
LeakKernelDeint(threshold=4,twoway=true,order=1)
LRemoveDust_YV12(1)
dull = last
sharp = dull.LimitedSharpenFaster()
Soothe( sharp, dull, 20 )
ColorMatrix()
a=last
b=mpeg2source("E:\Black2\prova.d2v")
b=b.trim(172156,177132)
b=b.Crop(8,120,-8,-120)
b=b.TomsMoComp(1,1,1)
video=a+b
audio=NicAC3Source("E:\Black2\prova T01 2_0ch 256Kbps DELAY -384ms.ac3")
Audiodub(video,audio)
DelayAudio(-0.384)

but now the problem of how to tell avs2avi the xvid parameters(q value,trellis,vhq mode,ecc...) remains,any clue?

qwerpoi
29th March 2007, 21:37
but now the problem of how to tell avs2avi the xvid parameters(q value,trellis,vhq mode,ecc...) remains,any clue?
The way avs2avi works with xvid is by running the xvid configuration gui. In other words, open your script in AvsP, run "Tools -> Save as avi...", in the dialog that shows up select the number of passes and hit run. The rest is taken care of by avs2avi, it will show you the standard video codec configuration dialog, select xvid as the compressor and hit the configure button, etc. If you're running 2 passes, the video codec configuration dialog will show up twice.

If you'd rather specify all your parameters without a gui, then you need to use a special build of xvid, xvid encraw. In this case instead of using AvsP's avs2avi dialog, you should using a macro. You can check out the "Encoding example" or "Encoding example 2" macro to get you started.

jolson
30th March 2007, 09:10
Maybe the avs2qxvid.bat could help...?
http://forum.doom9.org/showthread.php?t=119500

boombastic
30th March 2007, 17:03
Maybe the avs2qxvid.bat could help...?
http://forum.doom9.org/showthread.php?t=119500

Yes thatcould be usefull but someone(i'm not able but i can try...) sholud create a Macro for AvsP that encode the current script with avs2qxvid.The best thing would be that this macro let the user input the TGHQ-CT, TGFAST-CT, TGEDIT-00, TGANIME-00.or MTK-CT parameter for the bat file....

martino
2nd April 2007, 20:23
I keep getting an error when I want to open just a simple AVS script, only with AviSource() in it;
Traceback (most recent call last):
File "AvsP.py", line 4552, in OnMenuFileOpen
File "AvsP.py", line 6200, in OpenFile
File "wx\stc.pyo", line 2842, in SetText
File "encodings\cp1252.pyo", line 22, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 49: character maps to <undefined>
The script opens up fine in VDub and media players though and even encoding works without any problems...

UPDATE: Looks like changing the input avi filename resolved this issue... :/

jmac698
6th April 2007, 22:08
avsp 1.3.7 bug

Pixel color display in YUV mode, shows wrong values.
colorbars(pixel_type="YV12") click on the yellow bar, it should read 161, not 159.
But thanks for adding this feature, I've been waiting a long time to have it :)
ps you can't just convert from rgb, some YUV can't be displayed as well. There's several yuv that can map to one rgb.
The main reason I wanted it is to measure yuv colors ;(

foxyshadis
7th April 2007, 00:44
Do this:
StackHorizontal(StackVertical( \
ConvertToRGB(matrix="bt.601"), \
ConvertToRGB(matrix="pc.601")), \
StackVertical( \
ConvertToRGB(matrix="bt.709"), \
ConvertToRGB(matrix="pc.709")), \
)

One of them is bound to match your expectations, unless you use a totally different colormatrix. :p (I don't think any of them will give you 159 or 161 - $99 or $A1 - unless you're converting back to yuv by hand.)

Oh! And make sure you use avisynth 2.5.7. There was a lot of discussion between .6 and .7 about colorbars, and some changes were made to it.

I can throw together a small plugin that just plops YUV values into RGB if you'd like that. Since it probably isn't particularly easy to get it to show in avsp otherwise.

qwerpoi
7th April 2007, 04:03
I keep getting an error when I want to open just a simple AVS script, only with AviSource() in it;
Traceback (most recent call last):
File "AvsP.py", line 4552, in OnMenuFileOpen
File "AvsP.py", line 6200, in OpenFile
File "wx\stc.pyo", line 2842, in SetText
File "encodings\cp1252.pyo", line 22, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 49: character maps to <undefined>
The script opens up fine in VDub and media players though and even encoding works without any problems...

UPDATE: Looks like changing the input avi filename resolved this issue... :/
Thanks for bringing that up, I'll try and get this and the other unicode issues squared away for the next release.

avsp 1.3.7 bug

Pixel color display in YUV mode, shows wrong values.
colorbars(pixel_type="YV12") click on the yellow bar, it should read 161, not 159.
But thanks for adding this feature, I've been waiting a long time to have it :)
ps you can't just convert from rgb, some YUV can't be displayed as well. There's several yuv that can map to one rgb.
The main reason I wanted it is to measure yuv colors ;(
I'm not very knowledgeable about color space conversions, as you guessed all I did was use the rgb to yuv conversions (rec601) as pointed out in this thread (http://forum.doom9.org/showthread.php?p=177792#post177792). At the time that was the only way I could handle it, since the frames were being passed to AvsP in rgb. In the next version, AvsP will be doing more direct communication with AviSynth (thanks to contributions from tsp), so this way of handling things may change (once I get everything figured out).

jmac698
7th April 2007, 04:31
You mean like this?
Function mapYUVtoRGB(clip Y) {
U=Y.UToY().pointresize(Y.width,Y.height)#yv12 is scaled 2x, 2y
V=Y.VtoY().pointresize(Y.width,Y.height)#yuy2 is scaled 2x
Return (MergeRGB(V,Y,U))
}
I *know* the yellow bar is Y=161, it's displayed wrong in the status bar. And actually, I'm the one who initiated the new colorbars :-) It's supposed to be 162, but alas I'm only using 2.56 right now (I don't know why..?)

foxyshadis
7th April 2007, 06:36
Hey, that's a neat little method, and I was trying so hard to think of a way to do it without a custom function, too. ;p

It's listed as A2, 162, in the G/Y on mine. Do you have photoshop, or some other editor you can collect per-channel values from? It might be that it's actually coming through as 159 for some bizarre reason.

ChiDragon
14th April 2007, 22:29
Been a while since I've used AvsP, is there a toggle for true/false or could this be added? Like right-click or use a keyboard shortcut to change a true value to false or vice-versa.

qwerpoi
15th April 2007, 19:03
Been a while since I've used AvsP, is there a toggle for true/false or could this be added? Like right-click or use a keyboard shortcut to change a true value to false or vice-versa.
No, currently there's no way to do it. At the moment, I'm working on a way to automatically build user sliders for every single function in a script (check boxes for true/false arguments, list boxes for string arguments), but it probably won't be in the next release. Incidentally, the next release will be in about a week, if everything goes well. This release will focus on improved communication between AviSynth and AvsP, should be good stuff. Once that release is ironed out, the plan is to have the automated sliders in the following release.

ChiDragon
15th April 2007, 23:56
Alright cool, thanks. For the moment I'm "tagging selection for toggling" and using that to alternate between the default and my changed value.

Mug Funky
17th April 2007, 14:28
not sure if this is worth pursuing or not (probably not), but i have a dream of writing a big RGBlut for lift, gain and gamma, and then using my wiimote + nunchuk to control the values in avsp.

is it possible to somehow tie a slider to an input device like a joystick?

qwerpoi
17th April 2007, 19:03
Alright cool, thanks. For the moment I'm "tagging selection for toggling" and using that to alternate between the default and my changed value.
As I mentioned, there's no quick keyboard shortcut, but as an alternative to toggle selections, you could use a user slider like this:
AVISource("C:\test.avi", audio=Select([<"audio", 0, 1, 0>], False, True))
A bit chunky, so it's up to you how you want to do it. Like I said, I'm working on a way to streamline the process, so think of these as more or less temporary solutions.

not sure if this is worth pursuing or not (probably not), but i have a dream of writing a big RGBlut for lift, gain and gamma, and then using my wiimote + nunchuk to control the values in avsp.

is it possible to somehow tie a slider to an input device like a joystick?
Are you serious? If you are, then yes, I believe it's doable. I'll take a look into it, if it's not too difficult I'll try and implement it (although probably not in time for the coming release). I imagine you'd be in the vast minority of people using the feature, though :)

Dr.Khron
18th April 2007, 15:35
I just started using all the power features in AvsP... VERY cool program, much thanks to the developer.

Ok, so I've got an odd issue... Is there any way to set the FPS the program uses to determine time stamps?

My current script loads a D2V file with DGDecode. The DVD is NTSC material: 720x480 at 29.97 FPS. However, the program displays the video as being 640x480 at 23.976 FPS.

This causes descrepancies between frame counts and various time stamps... its a pain in the ass to try and convert frame counts into times for the TextSub filter and other things.

EDIT:
DOH. I just realized that AvsP is displaying the information for the ouput file... my de-interlace routine causes the FPS to change, and I resize the video in the course of the script.

Still doesn't solve my problem, tho...

EDIT:
Yes, it actually does solve my problem... as long as I use the 23.976 for my FPS, all of the frame math works out (for filters added after de-interlacing, anyway).

tony62
19th April 2007, 14:25
Hello and thank you for this great tool.
I have a problem with the avs2avi side of life though.
I have downloaded avs2avi-139.zip unzipped and specified the path within AvsP(and restarted). I have written a simple scipt:

LoadPlugin("C:\Documents and Settings\Tony62\My Documents\Downloads\DGDecode.dll")
MPEG2Source("C:\Documents and Settings\Tony62\My Documents\Working Folder\VTS_01_1.d2v", cpu=0)
Crop(0, 74, -0, -66)

and all runs well in MPC or VirtualDubMod.
The problem comes when i 'save as avi', avs2avi.exe launchs within task manager then disappears:confused:

Any help would be appreciated:)

qwerpoi
20th April 2007, 07:52
The problem comes when i 'save as avi', avs2avi.exe launchs within task manager then disappears:confused:

Any help would be appreciated:)
Ah, it's been I while since I did work on the avs2avi gui. It looks like the problem is caused by spaces in the filename - try saving the avisynth script to a directory without spaces (C:\test.avs or something), it should work then. I'll try and have that fixed up by the next release.

tony62
20th April 2007, 18:30
Ah, it's been I while since I did work on the avs2avi gui. It looks like the problem is caused by spaces in the filename - try saving the avisynth script to a directory without spaces (C:\test.avs or something), it should work then. I'll try and have that fixed up by the next release.
Thanks for the prompt reply and yes you are correct that saving my .avs to C:\bla_bla.avs works like a charm:) You won't believe how long i spent trying to solve the problem before posting:eek:
I'm looking forward to your resizing calculator. Will it be completed also in the next version?
Again, good work and thanks!!

Mug Funky
21st April 2007, 16:50
I imagine you'd be in the vast minority of people using the feature, though

haha! yeah, probably. i've been doing a bit of colour grading lately and didn't see a reason that avisynth couldn't do it (except for the whole 8 bit, mostly 4:2:0 thing). generally the colour tweakage happens via 3 trackballs (lift, gamma, and gain), and colour for each one is controlled by pushing the ball in the corresponding direction on a vectorscope (up and left a bit for red, down and right a bit for cyan, etc). thought it'd be fun to try do that using the wii as it has more than enough direction controls on it for something like that. also it's fairly simple to get the wiimote into a PC using a bluetooth dongle and a couple of candles.

but i wouldn't find it to be a very useful feature for anything else at all... so don't implement it unless your curiosity gets the better of you :)

Fizick
21st April 2007, 17:17
feature request (may be it exists?):
after copy and paste of line of script with silders, automatically generate new names of sliders in new line.
For example, by some incrementing of last symbol or suffix.

qwerpoi
21st April 2007, 21:23
Thanks for the prompt reply and yes you are correct that saving my .avs to C:\bla_bla.avs works like a charm:) You won't believe how long i spent trying to solve the problem before posting:eek:
I'm looking forward to your resizing calculator. Will it be completed also in the next version?
Again, good work and thanks!!
Yeah, I'm guessing it's a problem a lot of developers have - out of habit, I try not to have any spaces in any of my folders or filenames whenever possible, so I never notice when it becomes an issue, despite the fact that the majority of users have spaces in ALL their files and folders (thanks a lot, microsoft :)). Sorry it caused any headaches, I fixed the problem for the next version (which should be out in a few days).

As for the resize calculator, it also was something I had planned long ago, really the only reason it's there in the menu is because the Tools menu was a bit bare :). Right now I have a ton of work to do for some new features, so it's not a top priority, but if anyone wants to help, you could direct me to a good example of what you want the feature to be like (last I recall, the resize calculator in Gordian Knot was the standard). Even better, if someone digs through sources and provides accurate formulas for the various appropriate calculations necessary, I'd be able to put together the gui interface fairly quickly.

but i wouldn't find it to be a very useful feature for anything else at all... so don't implement it unless your curiosity gets the better of you :)
Yeah, the reason I'm considering it is because the framework I'm using, wxPython, already has joystick support, so adding the feature might be very simple (although I haven't looked at the details). And it would be cool to control sliders through gestures a la "Minority Report" :)

feature request (may be it exists?):
after copy and paste of line of script with silders, automatically generate new names of sliders in new line.
For example, by some incrementing of last symbol or suffix.
Good request, the feature doesn't currently exist. What I'm trying to do is get rid of the slider label entirely, since it's occasionally cumbersome to work with, as you point out. What will happen is that sliders will automatically be generated for every argument in your script. This sounds like it could be a very bloated approach, so believe me when I say that I am trying to put the whole thing together in a very clean and unobtrusive way. Again, this won't be ready for the next release, but hopefully will be in the release after that, still a lot of things that need to be worked out.

Dr.Khron
22nd April 2007, 17:47
I've got an idea for a new feature... its sort of a half baked idea, though.
How about "sub-script awareness"?

This is where you call an external text file from your AVS. The only example I've encountered is calling .SSA files for TextSub, but there must be other applications.

If I'm tweaking a .SSA, I have AvsP open for my script, and then I need to have notepad open to edit the SSA. If I make a change, I need to save the SSA in notepad and refresh the AvsP preview output. Switching back and forth can get confusing if you have a bunch of stuff open.

It would be nice if you could have another set of tabs for Sub-scripts, so that you didn't even have to save the SSA file to refresh the preview. Basically, if AvsP allowed you to handle and edit sub-scripts in the same way it handles AVS files, I'd be thrilled.

qwerpoi
24th April 2007, 22:38
New version 1.3.8, download from the AvsP download page (http://avisynth.org/qwerpoi/Download.html) or from the mirror (http://www.savefile.com/files/667523) (win98 users can download from here (win98) (http://www.savefile.com/files/667525)). This version has major changes in the display code, AvsP now directly communicates with AviSynth in order to get video frames and information. It requires a recent version of AviSynth (tested with 2.5.7), if your AviSynth version is too old, don't worry, AvsP will fall back on the old method of getting frames. Here's the changelog:
* changed display code to retrieve frames directly from Avisynth (contributed by tsp)

* highlight error line in script on error clip

* added new video zoom option to fit entirely inside the window (suggested by Alain2)

* added "always on top" option for main window (suggested by Alain2)

* added method to specify cursor position in filter presets (suggested by krisq)

* allow for global variables in macros (suggested by Eggroll)

* remember last path when configuring doc path/url for function help (suggested by Spuds)

* path to AvsP help directory now configurable (suggested by Fizick)

* dump program error messages to both window and log file for easier bug reporting

+ fixed unicode error on startup (thanks Spuds)

+ fixed unicode error on file open (thanks martino)

+ fixed bug with avs2avi gui and spaces in avs filename (thanks tony62)

+ accurate yuv colors reported in video status bar (thanks jmac698)

+ minor fixes to window layout code
The biggest change is that AvsP now directly communicates with AviSynth through the Avisynth c interface (via avisynth.py in the source, big thanks to tsp for the contribution). Directly communicating with Avisynth has several advantages. Information such as colorspace, parity, audio channels, etc, is now directly available in AvsP. Scripts can be loaded from memory instead of creating temporary files. Error scripts can be identified and handled differently, so in this version any error scripts are created with the same number of frames as the last shown video, such that syntax errors don't cause you to lose the video frame you were currently on. Furthermore, upon an error clip, AvsP will now automatically give focus to the script and highlight the line with the error.

In order to check out video information now provided by Avisynth, you can simply click "Video information" in the video right-click menu. Also you can now configure the program's status bar to report any video information you would like, go to "Options -> Program settings...", and in the "Video 1" tab, click on the "Customize video status bar..." button. You'll see a dialog (http://avisynth.org/qwerpoi/Video.html#customizing-status-bar-message) where you can specify practically any piece of information about the video Avisynth can give you, including pixel color info (which now has colors being directly retrieved from Avisynth instead of relying on RGB to YUV formulas). If you find that any information is being reported incorrectly (ie, Audio channels = -1, etc), this indicates that your version of Avisynth is not recent enough, try installing 2.5.7 or newer.

In actuality, all this stuff is in some sense only scratching the surface of what can be done. Since the Avisynth c interface has been entirely wrapped into Python, it should be possible to write Avisynth plugins directly in Python (which would be usable as an AvsP macro, even if you don't have Python installed on your computer). Right now this would have limited usability, since currently there's no way to save the results of such a plugin to an avi, but with more work it should be possible. Anyway, I'm trying to release this version right now to make sure that everything is stable, I will release a bugfix version with no new features if there are any major problems, but in the future, hopefully these ideas will be further explored.

Another important change is that I went through the code and fixed several unicode issues, hopefully now there won't be any more unicode related problems. I also set up AvsP to dump errors to a text file as well as the pop-up error window, so if you ever find the error window flashing and immediately disappearing when you start up or close AvsP, you can see the message in the file named "avsp_error_log.txt" located in the same directory as AvsP.exe.

Some other changes worth mentioning. There's a new zoom option, "Fit inside window", this will fit the video such that it is entirely inside the window at all times (the older zoom option has been renamed to "Fill window" for clarity). There's a new way to specify cursor positions upon preset activation, you can even specify text selections, this is pretty cool stuff, read more about it here (http://avisynth.org/qwerpoi/Text.html#filter-presets). You can now keep macro variables in memory simply by declaring them as global, useful if you need to remember values between running macros, read more about it here (http://avisynth.org/qwerpoi/Macros.html#usage).

Anyway, since the display code went through some big changes, I'm anticipating potential stability issues with this release (although I'm hoping not, since I tested it on several machines with no problems). So be sure to report back with any crashes (remember all crashes are now logged to "avsp_error_log.txt") or any other inconsistencies.

Terranigma
24th April 2007, 23:51
Thanks for the update.
Hats off to you for your hard work :)

Dr.Khron
25th April 2007, 00:10
Yes, thank you very much.

Does this mean I can disable my FFDShow "raw video" VFW support now?


EDIT:
Yes, thats exactly what it means. :)
Thanks again for a cool program.

foxyshadis
25th April 2007, 02:27
One minor thing. I don't know if it's because of themes or what, but the automatic resize (which is improved in this release, now resizes after an error) is always just a couple of pixels too short for me, and creates a scroll bar. It's 6 or 7 pixels on mine.

qwerpoi
25th April 2007, 03:03
It would be nice if you could have another set of tabs for Sub-scripts, so that you didn't even have to save the SSA file to refresh the preview. Basically, if AvsP allowed you to handle and edit sub-scripts in the same way it handles AVS files, I'd be thrilled.
Sounds interesting, I'll give it some thought. I'm not sure what's the best way to approach it, though, having ssa files in the same tabs as avs scripts might be problematic.

Thanks for the update.
Hats off to you for your hard work :)
Thanks :)

Does this mean I can disable my FFDShow "raw video" VFW support now?

EDIT:
Yes, thats exactly what it means. :)
Thanks again for a cool program.
The display code has been changed to always output rgb32 (whereas before the frames sent to AvsP were either rgb32 or rgb24), this must have resolved the issue. I never experienced the problem, and I didn't explicitly try to fix the problem, but if it works now then everyone's a winner :)

One minor thing. I don't know if it's because of themes or what, but the automatic resize (which is improved in this release, now resizes after an error) is always just a couple of pixels too short for me, and creates a scroll bar. It's 6 or 7 pixels on mine.
Yeah, the "fit inside window" zoom needs a bit of polishing. I blame the wxScrolledWindow class for inaccurate calculation of scrollbar and window sizes - there's a bit of a fudge factor since scrollbars themselves take up pixel space, resulting in scrollbars sticking around in some cases when they should be removed. You'll notice (I believe) that the problem only shows up when both the window width and height are about the same as the video width and height, ie it's the scrollbars themselves that causes the window not to fit. Anyway, I'll try and have these types of issues with the new zoom mode fixed up by the next release.

chipzoller
25th April 2007, 03:14
Question: would it be possible when in preview mode and adjusting the slider to have the current frame output displayed instead of having to release the slider in place to see the frame?