View Full Version : AviSynth Q&A


Wilbert
11th May 2002, 23:34
Most of you know that a lot is happening lately regarding AviSynth. Many plugins and filters were added, compressed audio support, better doc. support and AviSynth got its own website www.avisynth.nl (http://www.avisynth.nl). The AviSynth Q&A has moved to that website, it can be reached at AviSynth Q&A (http://avisynth.nl/index.php/AviSynth_FAQ).

This site is made with Wiki (http://tavi.sourceforge.net/) (a kind of html for lazy people), such that everyone can contribute to www.avisynth.nl (http://www.avisynth.nl) by updating docs, adding nice scripts and more. If you want to learn Wiki you should have a look at the command summary (http://tavi.sourceforge.net/FormattingRules) and practice these rules in the sandbox (http://tavi.sourceforge.net/SandBox).

If you want to add or change something to the FAQ, please respond to this thread (also in the case you decided to make the changes yourself). Do NOT use this thread for discussion of specific Avisynth problems you may have. Post those in a separate thread. This thread is for suggesting new FAQs and discussing existing ones.

If you got any problems using AviSynth please read the troubleshoot page (http://avisynth.nl/index.php/Troubleshooting) first before posting in this forum!

dividee
19th May 2002, 16:54
Edited Q6:

Added a link to the avisynth tutorial and a notice that reading the doc is mandatory before posting.

Wilbert
24th May 2002, 16:25
Corrected Q13.3:
How to read import mpeg2-files in AviSynth.

Removed Q36:
That was about the mpeg2enc.dll plugin, that had nothing to do with AviSynth.

Added Q35:
Q35: When i try to use SpatialSoftenMMX, it crashes in VirtualDub ?
A: You probably used this filter before resizing. Apperently SpatialSoftenMMX doesn't like resolutions that cannot be divided by 8 or 16. So if you use it after resizing it works, of course.

Rasqual
19th June 2002, 16:21
Q1:
http://www.lukesvideo.com/avisynth.html
Q9:
http://www.lukesvideo.com/frameserving.html

Wilbert
19th June 2002, 16:54
Thanks, I changed them. I also changed Q21: adding references to the "Smoother HiQ(uality) plugin" of Klaus Post (Shodan) and the "ImageSequence plugin" of Bzzz2.

Wilbert
29th June 2002, 17:14
Changed Q2, Q21 and Q27.

Q2: added:

There is also a version made by Poptones http://personal.ayrix.net/~poptones/avisynth.zip. There is a command which enables you to average multiple captures reducing noise and keeping detail. For a description see: http://arstechnica.infopop.net/Open...65&m=4020952194.

Q21: added the following plugins:

[list=1]
MergeLuma/MergeChroma plugin (by Klaus Post)
Soften/sharpen plugin (by Tom Barry)
MJPEGcorrect plugin
[/list=1]

Q27:

Pointer to the newest package containing VDub scripts called vdub_filtersv14.zip.

poptones
4th July 2002, 17:12
If you point people instead at the latest (avisynth2) project at sourceforge they can get the latest version with the "poptones" stuff in it. I don't mind hosting it there, and it'll remain for the folks who know that resource, but it may not always be the freshest version.

Wilbert
5th July 2002, 13:06
Thanks, I changed it (see Q2). I also added some external plugins in Q21.

pepsimaxx
17th July 2002, 23:47
Hi Wilbert,

Thanks alot for ur (and others?) hard work on this Q&A. I just wanted to post some constructive suggestion.

Could u make the questions appear in bold? That way it's easier to scroll down the page and find the "question" that is related to ur problem.

Don't take it the wrong way, it's meant in a positive way. :)

dividee
18th July 2002, 01:01
Nice suggestion. :)

Wilbert
22nd July 2002, 17:25
Changed Q21: added some new plugins and explanation.

Added Q40:
Q40: When frameserving I got the following message: "Script error, there is no function named "IPCSource"" ?

A: You probably used AviSynth v1.0b6. In this version the IPCSource is removed and put into a different dll (in avisynthEx.dll). Get this plugin or use another version of AviSynth.

There will be more changes after a few days...

Wilbert
2nd August 2002, 15:35
- Rewrote Q2 and updated Q5.
- Changed the links in Q19.
- Added the colorspace conversion problems in Q12.

sh0dan
2nd August 2002, 17:49
(Suggestion for update on colorspaces)

Q23: How do I convert between the colorspaces ?

A: Converting to YUY2:

ConvertToYUY2()

and for converting to RGB:

ConvertToRGB()

Note that converting between colorspaces isn't completely lossless, and doing several conversions back and forth may degrade your signal. The first conversion back and forth does not hurt your source, but if you use three or more, it may.

Q24: What/when do I care when filter X works in RGB- or YUV-space ?

A: The main reason why you should care is the improvement in speed you can obtain by not unnecessarily changing between colorspaces. If your source is YUV (when encoding DVD's for example, or captures from digital sources) try to use only filters/plugins which work in YUV-space. On the other hand if your source is in RGB (for example from analog captures) try to use only filters/plugins which work in RGB-space.

Speed is also quite different between the different colorspaces, because each colorspace takes up different amounts of memory. The slowest colorspace is usually RGB24, because every pixel has an odd alignment in memory, avoid using this mode. The fastest mode is usually YUY2, because data only takes up half as much space as RGB32. So if you have to process your video a lot, try using ConvertToYUY2() before you do your filtering. Note that ConvertToRGB converts to RGB32 if the source is YUY2 - use ConvertToRGB32 to force a RGB24 to RGB32 conversion.

You should also consider your destination colorspace. If you plan on converting to DivX/Xvid/HuffYUV in Virtual Dub without applying filters in Virtual Dub, "Fast Recompress" will deliver the YUY-data directly to the codec, saving you another colorspace conversion. On the other hand, if you plan using TMPGEnc or Virtual Dub in "Full Processing" mode, you may consider delivering the source as RGB.

Richard Berg
2nd August 2002, 22:52
sh0dan & Wilbert now have the necessary permissions to create/edit the documentation on SourceForge. You're doing great work here with the FAQ and the new function descriptions; if all you do is copy/paste over to SourceForge occasionally I'll be happy.

Wilbert
5th August 2002, 14:30
@Richard,

Done. The only thing there right now is Koepi's changelist; right now I'm working on adapting Wilbert's FAQ (e.g. adding

I've seen it, very nice!

sh0dan & Wilbert now have the necessary permissions to create/edit the documentation on SourceForge. You're doing great work here with the FAQ and the new function descriptions; if all you do is copy/paste over to SourceForge occasionally I'll be happy.

Sorry for this dumb question, but how/where can we do this?

@sh0dan,

I will update it, thanks!

Edit: Ahum, I have a small problem. I can't put more text in the faq :) Dividee you can insert an empty post between the faq and your post which I can edit?

Richard Berg
5th August 2002, 14:48
@Wilbert --
Start here (http://sourceforge.net/docman/?group_id=57023), you should be able to add/edit anything on this screen.

Read the end of this thread (http://forum.doom9.org/showthread.php?s=&threadid=30436) though -- we won't be using the SourceForge doc manager much longer, so I wouldn't bother. The changelist there is already out of date, in fact; I added a few lines to the one on the CVS (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/avisynth2/avisynth/docs/changelist.html?rev=1.2), which in turn should be replaced by a website something driven by Wikki (http://tavi.sourceforge.net).

dividee
5th August 2002, 15:10
Edit: Ahum, I have a small problem. I can't put more text in the faq :) Dividee you can insert an empty post between the faq and your post?


Not sure how to do that. I'll delete my post so you can reuse the next one, which is yours.

poptones
5th August 2002, 22:07
There is now an index on the front page. (http://www.avisynth.org/wiki/) This FAQ can be moved to the wiki simply by clicking the question mark and cutting and pasting.

Yeah, I know it's not exactly quick, but it really is simple. Took me about an hour to create what's there now. Filling in the command glossary now is just a matter of cut and paste as we (I?) get the time. You could do the same thing with the quesitons and links. I'll be glad to help out, but it'll be late this evening before I get back to it.

Wilbert
6th August 2002, 09:54
Nice, very nice! I have to figure out how it all works yet, because it is not entiry copy and paste (see http://tavi.sourceforge.net/FormattingRules). But I started ...

WarpEnterprises
6th August 2002, 10:14
@Wilbert: Do you too experience problems when accessing the wiki (as if the wiki-server has a very bad performance?)

Wilbert
6th August 2002, 10:30
I have no problems with it. It is not slow or anything like that.

edit: In the Tavi FAQ (http://tavi.sourceforge.net/TaviFAQ) I saw this:

Performance problems

Q: I just installed Tavi and some pages (in particular submitting a newly edited page) are taking a ridiculously long time to load. What's wrong?

A: This could well be a problem with Tavi using gethostbyaddr() in several places throughout the script, which on some servers causes a major performance hit. A "quick hack" solution is to remove all calls to gethostbyaddr($REMOTE_ADDR) and replace them with $REMOTE_ADDR on its own. In Tavi 0.22 you need to edit lib/category.php line 46, action/admin.php line 80 and action/save.php lines 32 and 53.

Richard, Sh0dan, can you have a look at this.

Richard Berg
6th August 2002, 20:09
I've made the suggested edits, let me know if that helps. I'll also be editing the templates sometime soon -- the guy behind Easytopicmaps.com sent me his PHP yesterday.

There's still work going on in the CVS /docs (http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/avisynth2/avisynth/docs/) so check to be sure you don't work too hard :)

WarpEnterprises
6th August 2002, 22:02
@RB:It seems the access is ok now.
THX

Wilbert
7th August 2002, 09:50
@poptones, Warpenterprises

Yeah, I know it's not exactly quick, but it really is simple. Took me about an hour to create what's there now. Filling in the command glossary now is just a matter of cut and paste as we (I?) get the time. You could do the same thing with the quesitons and links. I'll be glad to help out, but it'll be late this evening before I get back to it.

That would be very nice. Hopefully we can get it ready at the end of the week before I go on holidays. Maybe you can start at the end of the faq with the last three sections or so.

But it is not a simply matter of cut and paste :) If you look at what I did already you will know how it works.

poptones
8th August 2002, 00:39
I don't understand. It still looks like a matter of cut and paste. What am I missing here?

Your docs look awesome, BTW. A lot of work there I'm sure.

Wilbert
8th August 2002, 09:29
I don't understand. It still looks like a matter of cut and paste. What am I missing here?

I would say try and you will see, but I see that you already were editing stuff. Things like italic, bold, enumeration, urls, anchors, much be changed. Of course it is not too much work ...

But something happened to http://www.avisynth.org/index.php?page=AviSynthFaq. The layout is changed (personally I don't like the green bars on the left, especially if you want to print that page). But these docs can't be edited anymore. What happened?

Edit: when trying to reach that page I see now parse errors. I guess I much be patience.

Richard Berg
8th August 2002, 11:31
Ok, I'm done fiddling with the layout (for now, anyway). If the sidebar wastes too much space I can turn down the font size a bit, but consider it an inspiration to keep individual pages short :)

Wilbert
25th August 2002, 11:48
I removed the faq in this thread, and redirected to the faq on http://www.avisynth.org/index.php?page=AviSynthFaq. Several changes were made, the main ones:

updated Q2
Changed Q6; pointers to the "new" documentation
updated Q13; added Nics plugin (MPEGdecoder for loading vob/mpeg2 files)
updated Q15; about compressed audio support
updated Q21; added new plugins (MAM, Convolution3D, STMedianFilter, DNR2 (YUY2/RGB) and 2d_cleaner (YUY2))


If I've installed the stuff Shodan sent me, I will change it on the project page.

Wilbert
30th August 2002, 16:43
I made the following updates:


Q21: added description of MAM
Q32: starting from v2.05 it is possible to do auto-plugin loading
Q42: about the improved version of the import premiere plugin
minor updates of Q5 (Loop doesn't work in v2.05) and Q17 (compressed audio support)

Wilbert
13th September 2002, 19:51
Q21 and Q22: added plugins which were floating around recently (Chromashift, Lanczos, AntiBlink, Msharpen, Dub and Focus2)

added:
N1: Does AviSynth have a GUI (graphical user interface) ?

A: No, but: Belgador made a start for AviSynth support in VirtualDub ([have a look at this thread], just copy the exe in the VDub-dir). It acts like a menu where you can add filters, show a preview, edit the script manually, etc.

Wilbert
27th September 2002, 17:25
the main changes:

added (I have to do a renumbering when I have time):

N2: When frameserving I got the following message: "Script error, there is no function named "xxx (some filter)"" ?

A: You probably installed/registered a version of AviSynth which doesn't contain the filter. Make sure that there are no other versions floating around on your hard disc (there's a possibility that a version will be registered while it is not in your system directory). Check that the right version is registered, see also Q3.

Q43: How do I frameserve to Windows Media 9 Encoder using AviSynth ?

A: Download Nic's Windows Media 9 Encoder and make sure you also installed the Windows Media 9 codec. Both can be found [here].

changed Q33 into:

Q33: What is mpeg2dec.dll/mpeg2dec2.dll/mpeg2decpp.dll and where can I find those plugins ?

A: mpeg2dec.dll/mpeg2dec2.dll/mpeg2decpp.dll are plugins (if you experiences crashes try the latter which is more robust) which enable AviSynth to import MPEG2 files. Mpeg2source returns the frames in YUV format.

mpeg2dec.dll is available (including some filters) at [Dividees homepage], mpeg2dec2.dll is available at [trbarry homepage] and Marc FD's plugin mpeg2decpp.dll is available at [1].

The main difference is that mpeg2dec2.dll is more rubust than mpeg2dec.dll and mpeg2decpp.dll (which is based on Dividees mpeg2dec.dll) contains Nics post processing (like deblocking and deringing).

added two plugins to Q21:

30.[BorderControl plugin (by Simon Walters)]: After capturing video you might want to crop your video to get rid of rubbish. BorderControl enables you to smear added borders instead of adding solid borders preventing artefacts between picture and border.

31.[WarpSharp, Xsharpen, SmartSmoothHiQ, UnsharpMask, UVTimingH, UVTimingV, LoadAviUtlInputPlugin, Auto24FPS, AutoDeint, FrameCache (by GuiltyX)]: Ported VirtualDub filters.

changed Q11 into:

Q11: How do I load my AVS-file AviSynth in encoder/application X ?

A: Just open your AVS-file in TMPGEnc, CCE SP, VirtualDub or whatever encoder/application you use. For VFAPI you need to install the [ReadAVS] plugin. Just copy ReadAVS.dll to the VFAPI reader directory and open the reg-file ReadAVS.reg in notepad and change the corresponding path. Save it, and doubleclick on it to merge it with your registry-file.

Wilbert
18th October 2002, 17:44
I reorganized the faq and made some changes, briefly:

- added Q6: How do I install AviSynth ?
- added a link to [VirtualDubAVS&OGM] in Q10
- added Q19: I get an unrecognized exception error trying to load an avs file with VirtualDub, using dvd2avi v1.77.3 ?
- added Q28: SmoothDeinterlacer (by Xesdeeni)
- added Q28: a link to MAM
- added Q28: Wavelet Noise Reduction (by thejam)
- added Q28: Ghostbuster (by SansGrip)
- some other minor corrections/additions

I hope it is a bit better now ...

Richard Berg
28th October 2002, 11:20
I consolidated AviSynthPlugins into Q28 and cleaned things up a bit, adding the Peach while I was at it. Not FAQ-related, but I also added some stuff to ShareFunctions.

Richard Berg
29th October 2002, 18:46
Thanks for adding the VDub collections; I added direct download links. BTW, if you ever want text files (or anything else -- we've got 100MB) uploaded, just email me.

Wilbert
8th November 2002, 16:16
Ok, thanks Richard.

The main changes (briefly summarized):

- Changed Q10 about VirtualDubMod (especially the avs preview and the command line processor). I also added AVSGenie. Tell me if the description is ok.

- In Q28 I added the following plugins: Blockbuster, GrapeSmoother, msoften (a good two line description is still lacking) and Guava comb.

High Speed Dubb
20th November 2002, 04:59
Thank you to Richard and Wilbert for putting in the links the filters I wrote up. I notice that Peach Smoother got its silly explanation onto the page. ;)

Is it okay if I make some changes to the filter explanations? I’d like to include the Peach’s need for SSE, remove the reference to the green dot (since that’s no longer on by default), and move Guava Comb into the miscellaneous section. (Technically it does average temporally, but it’s much more special purpose than a temporal smoother. Its closest relative is probably AntiBlink.)

While I’m at it — Shouldn’t TemporalSoften2 be in the temporal smoother section?

Richard Berg
20th November 2002, 07:57
Yes, I was still laughing at your description when I added Peach and decided to be silly ;) Change whatever you feel appropriate, that's the whole idea.

PS check your Guava thread

High Speed Dubb
20th November 2002, 08:53
Okay, I entered a few changes. They’re mostly to my own filters, but I also added TemporalCleaner and moved a couple other filters around (TemporalSoften2 and CopySame).

High Speed Dubb
20th November 2002, 09:43
... And I’ve also added in NoMoSmooth. I’ll leave it to SansGrip to fill in exactly what it does, since I think it’s a work in progress.

Here’s another idea: Would anyone mind if I collected together a bunch of filters into a “Capture Artifact Removal” category? Guava Comb, Antiblink, GhostBuster, and BorderControl could probably go into it. The category is a little shaky, since noise and interlace are also capture artifacts — but it’s probably better than dropping them all into “misc.”

Also, I think ViewFields probably belongs in the deinterlacing section.

Richard Berg
20th November 2002, 10:38
Other possible names: "analog cleanup" or "broadcast video" or "capture helpers"...some combination of those will work perfectly, but I can't think of it right now...

BTW -- I've borrowed some PHP/MySQL code from a friend in the hopes of making it simpler for others to upload things to the webserver. The application that came immediately to mind was to give filter authors an easy place to list their wares; less maintainance work to keep the Wiki up to date ultimately means happier users. Thoughts?

Obligatory screenshot (that happens to use said service in its original form -- I'd modify it to accept non-images, of course):
http://members.arstechnica.com/subscriptors/x/richard_berg/kurt_hosting.png

High Speed Dubb
21st November 2002, 06:36
I went with “broadcast video” — I think that’s a good description of the filters’ target.

On top of that, I gave the list a fairly general edit. Feel free to change any of it back if you don’t like the alterations, or you can just ask me to fix it.

The docs refer to YUY2 and YUV without explaining their relationship. Should we wait until YV12 is generally available before fixing that up?

Wilbert
21st November 2002, 10:48
I went with “broadcast video” — I think that’s a good description of the filters’ target.

On top of that, I gave the list a fairly general edit. Feel free to change any of it back if you don’t like the alterations, or you can just ask me to fix it.

Thanks for your improvements!

The docs refer to YUY2 and YUV without explaining their relationship. Should we wait until YV12 is generally available before fixing that up?

We can already start with that. I don't know when Sh0dan is planning the first beta release of v2.5, but the docs should be adapted at that time.

Wilbert
20th December 2002, 10:54
The past days I did a major update of the faq. A very brief summary:

1) included most of the YV12 stuff from the YV12 faq:
- Q7-Q11: how to encode in YV12?
- Q16: about avs2avi
- Q35: list of all the v2.5-plugins

2) Q32: Improved description of RGB/YUV colorspace.

3) Q31: DirectShowSource and VobSub.

4) Q27-Q28: MP2-audio

5) Q34: Added v2.0x plugins, but I forgot which ones.

Regarding to www.avisynth.org I added descriptions of new internal filters which will be available in v2.5. (Except ColorYUV, because I don't know that filter very well.)

sh0dan
27th December 2002, 01:41
ColorYUV information has been added!
Also modified some information on SwapUV and sample conversion.
Also limiter only accepts yuv data.

Antimon
28th December 2002, 19:14
there is a problem with teh q&a

vob-files

Make a DVD2AVI project file and save it (filename.d2v) and load this clip into AviSynth:

LoadPlugin("d:\mpeg2dec.dll")

mpeg2source("d:\filename.d2v")

or

download the [MPEGdecoder (by Nic)] and make the following script (no audio support yet):

LoadPlugin("d:\MPEGdecoder.dll")

mpeg2source("d:\filename1.vob+d:\filename2.vob")


acording to the mpegdecoder i downloaded today mpeg2source is not a recognized command, if i make it mpegsource it works with vob's and likely all examples you give

Wilbert
29th December 2002, 00:59
Thanks, I will change that soon!

sh0dan
5th January 2003, 17:11
I've been doing some updates on avisynth.org - and I'm beginning to love wiki very much.

I would encourage everybody to start creating some guides. Topics could cover:

MPEG2 -> XviD
MPEG2 -> VCD / SVCD
AVI -> MPEG
DV -> DVD
CleaningCaptures
CleaningDV
AdjustingColors

Edit: Hmmm.. about the wiki love. Is there a way to undo changes completely. I mean - the hsitory allows you so see what have changed, but it doesn't show any formatting. Is there a way to make wiki give you the unformatted text, when some dopehead has deleted it?

HarryM
8th January 2003, 09:43
@Sh0dan:

Can you implement into Avisynth 2.5 fast version of ReduceBy2 (maybe FastReduceBy2 named), based on simple 2x2 matrix resize (such like in Virtualdub)?


@Virtualdubmod makers:

It is possible make any modification, which can allow insert AVS script direct into video capturing process?
Pure Virtualdub allows only own RGB processing at capturing process (it is dammly slow)...

Script for on-fly capturing into XviD (full in YV12) can be (e.g.):

(YV12, 768x576 px PAL)

ReduceBy2
TemporalSoften(1,5,6)

(YV12, 384x288 px XviD)

I think, that actual CPU's are competent fast for implementing this...

hakko504
8th January 2003, 10:14
Originally posted by sh0dan
Edit: Hmmm.. about the wiki love. Is there a way to undo changes completely. I mean - the hsitory allows you so see what have changed, but it doesn't show any formatting. Is there a way to make wiki give you the unformatted text, when some dopehead has deleted it? Just click on 'edit document'. Then choose 'view history'. Then click on the date that you think is the last correct one, usually one with a known author (Like sh0dan, hakko504, wilbert...). Then you (re-)save that document and voila.

sh0dan
8th January 2003, 10:37
Nice! Thanks!

sh0dan
8th January 2003, 10:38
Originally posted by HarryM
@Sh0dan:
Can you implement into Avisynth 2.5 fast version of ReduceBy2 (maybe FastReduceBy2 named), based on simple 2x2 matrix resize (such like in Virtualdub)?

I seriouslu doubt it will be any faster than the 121 matrix currently being applied, and quality is more exact.

scmccarthy
8th January 2003, 15:25
@sh0dan&HarryM

Yes, a 121 kernel sites the resize over the right line and a 22 kernel would shift the image a half line. It's analogous to the siting issues for chroma.

Stephen

Wilbert
23rd January 2003, 18:27
I renumbered the questions in the faq. I'm sure you will get used to it :) This way it is much easier to add and delete questions!

What I'm also sure of is that I broke some links on www.avisynth.org. I will restore them and add some other stuff tomorrow.

cweb
25th January 2003, 15:26
I should write a guide on MPEG2 to KVCD. ;)

Originally posted by sh0dan
I've been doing some updates on avisynth.org - and I'm beginning to love wiki very much.

I would encourage everybody to start creating some guides. Topics could cover:

MPEG2 -> XviD
MPEG2 -> VCD / SVCD
AVI -> MPEG
DV -> DVD
CleaningCaptures
CleaningDV
AdjustingColors

hakko504
25th January 2003, 15:33
I have started with the MPEG2 -> AVI guide, and I intend to cover DVD-decryptor(done), DVD2AVI(done), GordianKnot(done), manual encodes with DivX 3.11, 5.02, 5.03 (Mostly done, minor adjustments might be necessary).

Xvid guide still not done. I'll take a look at it, but I still might need help with it. I also added a quick guide for DivX5Enc, and I've asked Dolemite to write something about DVX.

Wilbert
7th February 2003, 17:16
I added a bunch of stuff to the faq last week:


added Q1.13: I got the message "LoadPlugin: unable to load "xxx" is not an AviSynth 1.0 plugin ?
added Q1.14: How do I know which colorspace I'm using at a given place in my script ?
added Q1.21: Where can I find VCF2AVS ?
Restyled Q2.10, added: how to open ATSC/PVA transport streams in AviSynth. I hope Nic/Tom will correct it if necessary :)
updated our filter list in Q3.3 and Q3.4.
Several other little things.

Wilbert
8th June 2003, 21:34
I reorganized the faq:


removed outdated stuff related to old AviSynth/DVD2SVCD/TMPGEnc versions
replaced link2 by makeAVIS
added the PluginPace frameserver (Vegas, Premiere, Ulead -> AVS)
removed chapter 5
a lot of other minor improvements

Loul
21st June 2003, 21:46
Looks like some idiot erased the faq.

http://www.avisynth.org/index.php?page=Section+3%3A+Filters%2C+plugins+and+colorspaces

http://www.avisynth.org/index.php?page=Section+3%3A+Filters%2C+plugins+and+colorspaces

Well the good thing is that we can still access the old pages through http://www.avisynth.org/index.php?page=RecentChanges

Edit : looks like wilbert repaired it all, thanks !

Wilbert
23rd June 2003, 10:08
Edit : looks like wilbert repaired it all, thanks !
Someone else repaired it. Thanks, nkotb!

arlsair
23rd July 2003, 22:34
The FAQ is now available in german.

German AviSynthFAQ (http://www.avisynth.org/index.php?page=AviSynthFAQ+Deutsch)

Just for info.

Wilbert
23rd July 2003, 23:19
Great work. I'm sure German people will appreciate this!

Selur
24th July 2003, 15:55
hail to arlsair :D

coaa
8th July 2004, 03:58
Originally posted by Wilbert
Corrected Q13.3:
How to read import mpeg2-files in AviSynth.

Removed Q36:
That was about the mpeg2enc.dll plugin, that had nothing to do with AviSynth.

Added Q35:
Q35: When i try to use SpatialSoftenMMX, it crashes in VirtualDub ?
A: You probably used this filter before resizing. Apperently SpatialSoftenMMX doesn't like resolutions that cannot be divided by 8 or 16. So if you use it after resizing it works, of course.

Hey guys.. Where exactly is this FAQ posted? I can't find these questions listed anywhere on http://www.avisynth.org/index.php?action=history&page=AviSynthFaq

Wilbert
8th July 2004, 09:31
Those are questions from a faq which is a dozen times updated.

How to read import mpeg2-files in AviSynth.
Is listed in Q3.5: MPEG Decoder (source) Plugins: (...). (and also in Q2.8).

SpatialSoftenMMX
Nobody uses this plugin anymore. I thought it was a filter from mpeg2dec.dll, but looking at http://users.win.be/dividee/avisynth.html I guess I'm wrong. Anyone?

esby
12th January 2005, 16:50
I don't know if it is mentionned anywhere...

But there is a bug that scarface encountered on a script he copy pasted from the forums..

the script was saved in unicode:
so when you open it with notepad, nothing seems wrong...
but when you try to load it, it will throw an exception.

check http://esby.free.fr/perso/scarface/
for a working and non working script...

esby

ilovejedd
11th September 2006, 00:32
I didn't find this in the FAQ so I'm asking here regarding function name precedence. The AviSynth website has the following information:
The order in which function names take precedence is as follows:

1. user-defined function (always have the highest priority)
2. plugin-function (have higher priority than built-in functions - they will override a built-in function)
3. built-in function

Inside those groups the function loaded at last takes precedence, there is no error in a namespace conflict.

What is the order in which AviSynth loads functions? For example, I have the following plugins in the AviSynth plug-ins directory: dgdecode.dll, mpeg2dec.dll, mpeg2dec3.dll and I use the following script:
mpeg2source("test.d2v")
Which mpeg2source() function will AviSynth use?

Also, say I have DGDecode.dll v1.4.8 in the AviSynth plug-ins directory. However, a particular project requires DGDecode.dll v1.1.0 which I have saved in C:\DVD-RB\. If I use the following script:
LoadPlugin("C:\DVD-RB\DGDecode.dll")
mpeg2source("test.d2v")
Will AviSynth use v1.4.7 (auto-loaded) or v1.1.0?

Thanks!

foxyshadis
11th September 2006, 03:51
Precedence of autoloading is alphabetical; the last loaded is the one that wins, but you can still use dgdecode_mpeg2source() even if mpeg2dec3 takes the unspecified name over. Giving them new names so they load before dgdecode is wise; but I'd keep them in a manually loaded "obselete" folder anyway, especially since mpeg2dec3 doesn't play nicely with 2.5.7 at all.

In the second question, you're manually loading one, which always takes precedence over an autoloaded function.

ilovejedd
11th September 2006, 07:35
Thanks for the very helpful info! I know that AviSynth supports DLLname_function() but since the script is automatically generated, I wanted to know which function will be used. I don't really have mpeg2dec.dll or mpeg2dec3.dll as I'm very happy with DGDecode. I just used them as an example. I kinda thought it might be alphabetical but I just wanted to make sure. :)

Ð.Sp!dér
20th February 2007, 14:11
Why does Avisynth show "fps=23.9759856527702" while GSpot only sees 23.976 ? :|

foxyshadis
20th February 2007, 20:00
The internal fps is an arbitrary precision division of two numbers, and usually isn't exact. The gspot one just rounds it off to three places to make it look nice (and possibly fits it to the nearest "normal" ratio). The exact one would be 24000/1001.

Gilgamesh83
27th February 2007, 12:45
I recently posted something like this in another thread but if you wanna solve the problem with the fps in avisynth is to in my case with convertfps is to write not convertfps=23.976 which results in a 23.975 encode and playback of that avis but to enter convertfps=23.9762 thats right just a simple 2 after the 23.976 crazy eh! But not really since I came up with the idea of entering 23.9762 after I looked into a statsfile created by x264.exe and saw that it uses the division 250000/10427=23,976215594130622422556823630958

Anyway this solved my problem with my fps in avisynth, oh and this also applies to 119.880 fps which must be entered as 119.881=correct.

IanB
27th February 2007, 13:59
Read this thread! ... nicefps() into changefps()/assumefps() (http://forum.doom9.org/showthread.php?t=104681)

abood-conan
20th April 2007, 21:27
Hi everybody,

i Don't write a lot in this forum maybe because I still need the experience ...
anyway, I will not take too long time from you
but I want to ask a question .. encoding an anime ( avi ) .. how can i use avisynth to help me improve the overall look of the video .. i don't want you to explain .. just suggest some plugins that can be useful and i will search about the rest ^^
please help me guys.

anahita
23rd May 2007, 11:18
Ok, thanks Richard.

abood-conan
6th August 2007, 06:12
guys .. i'm trying to encode anime in avi which is DVD originally .. but i don't know how to deinterlace it .. dvd2avi says it's interlaced .. so can you give me any way to deinterlace ..

Leak
6th August 2007, 08:20
guys .. i'm trying to encode anime in avi which is DVD originally .. but i don't know how to deinterlace it .. dvd2avi says it's interlaced .. so can you give me any way to deinterlace ..
If it's anime, it's most definitely telecined which usually means that the original progressive video can be restored.

Don't just deinterlace it, since that'll ruin it. Search for the TIVTC AviSynth filter and give it a try.

Guest
27th August 2007, 14:44
From Avisynth documentation:

It turns variable framerate video (vfr) into constant framerate video (cfr) by duplicating or skipping frames. This is useful when you want to open vfr video (for example mkv, rmvb, mp4, asf or wmv with hybrid video) in AviSynth. It is most useful when the fps parameter is set to the least common multiple of the component vfr rates, e.g. 120 or 119.880.

Guest
27th August 2007, 15:04
Set it to true.

Wilbert
27th August 2007, 18:06
Both false and true will result in cfr. The difference is that setting it to false, it will load the video with fps=25. If the frame rate is different, or variable, you will get video and audio which is not in sync. When setting it to true it will add/delete frames (to match the specified fps), with the result that the video and audio is in sync.

Since asf is vfr, yes, you should use it.

Wilbert
29th August 2007, 19:58
Ok thanks! That explains a lot! What exactly is happening if I don't specify any fps parameters? If I just have a script like this:
It tries to guess the fps, but i forgot how that works. Perhaps someone else knows?

Would this result in audio sync errors too?
Yes. Arguments have a default value (which is false for convertfps), which are used if you don't specify the arguments.

foxyshadis
29th August 2007, 21:30
It uses whatever framerate the splitter reports back. Since directshow is based on timecodes, there's no harm in returning totally off-the-wall framerates, or one framerate for everything, so some do. Others will report the average duration, the framerate muxed into the container (which can anything for the same reason, but muxers are better in this respect), the duration of the first frame, and so on. Obviously a completely unreliable value, you're better off never trusting the splitter.

AkumaX
27th September 2007, 17:16
i'm looking to use a built in filter (logo, specifically) from vdm, in avisynth. is there a way i can do that? (i'd use donald graft's logo 1.34a but it doesn't give me the intended results)

thanks in advance!

foxyshadis
27th September 2007, 18:08
Not without breaking it out as an external plugin, unfortunately.

For logo, you can use Overlay or Layer to get the same effect in avisynth. You can also try the xlogo plugin for more options.

Guest
9th October 2007, 04:19
Guys, you won't get specific help on problems in this thread. Please start a new thread for your problems.

video
3rd January 2008, 14:23
have anybody have/seen the sources of the pixiedust (dust.v5.dll) avisynth plugin?
thx.

unskinnyboy
3rd January 2008, 15:19
have anybody have/seen the sources of the pixiedust (dust.v5.dll) avisynth plugin?
thx.Nope. Steady never released the source.

KG6ZVP
17th December 2008, 00:54
I have been developing software for use on PSP: PSP_Converter (http://pspslimhacks.com/forum/index.php/topic,4479.0.html)

This software automatically performs the following tasks via AVIsynth:
> automatic resizing of video clips to a maximum size of 480x272, but retains their original aspect ratio

> If framerate contains more than 3 decimal places, it is rounded (ex. 23.976043 to 23.976) and converted to that rate.

> If framerate is above 30 fps, it changes it to 29.970 fps

> Loads any file that can be converted in ffmpeg without that video codec being installed



I have two problems:

> Cannot handle variable framerate video files. Audio is very far out of sync. Is there a way to tell avisynth to change the framerate to one that is in sync with the audio before it is rounded?

> Cannot convert any input file which uses DAR, SAR or PAR in it's display. Is there a way to retrieve one of those values in order to calculate the output video size?


Below is my script. I have included brief explainations along with each section. I am a developer. This script must work for ANY input file and cannot be engineered for specific files.


#Load necessary plugins
LoadPlugin("FFmpegSource.dll")
LoadPlugin("Autocrop.dll")

#Load and crop input clip
Input_Clip = FFmpegSource("C:\Users\Jim\Videos\Clip.avi", vtrack=-1, atrack=-1).autocrop(mode=0)

#Calculate video width and height based on the autocropped Input_Clip and a maximum output resolution of 480x272
i_width = Input_Clip.Width
i_height = Input_Clip.Height
d_a_r = float(i_width) / float(i_height)
p_o_height = (d_a_r < 1.7647058823529411764705882352941) ? 272 : 480/float(d_a_r)
p_o_width = (d_a_r < 1.7647058823529411764705882352941) ? 272*d_a_R : 480

#Sets output width and height to numbers divisible by 4
p2_o_width = Round(p_o_width/4)*4
p2_o_height = Round(p_o_height/4)*4
o_width = Round(float(p2_o_width))
o_height = Round(float(p2_o_height))

#Retrieve framerate of input_clip, multiply by 1000 (this will be framerate denominator) and round it to a whole number
first = Input_Clip.Framerate*1000
second = Round(Float(first))
FPS_oi = int(second)

#If the rounded framerate is greater than 30.000fps, then set it equal to 29.97 fps
FPS = (FPS_oi > 30000) ? 29970 : FPS_oi

#Output is input clip, changed to the desired framerate numerator (whole number) and a denominator of 1000. The clip is also resized maintaining aspect ratio.
Output = Input_Clip.changefps(int(FPS), 1000).LanczosResize(o_width,o_height).converttoyv12()
Return Output



I'm a noob, I'm probably missing something obvious.

Guest
17th December 2008, 04:59
You're breaking two rules with this post.

1. You can't repost an issue that was closed for a rule violation in another thread. That's a 16 strike.

http://forum.doom9.org/showthread.php?p=1224905#post1224905

2. You shouldn't be posting in this thread. Didn't you get the idea when I moved your other posts? This thread is for discussion of FAQs, not for specific problems. That's a rule 3 strike.

http://forum.doom9.org/showthread.php?p=1053536#post1053536

Do not bring up this issue again. You can't change history. And don't start debating me here either. Send a PM if you want to challenge a moderating decision.

peter71
2nd June 2010, 15:39
Hi,

The avisynth documentation mentions operator precedence, but does not say anything about the '.' operator.

I mean, experience shows that

v1+v2.bob() means v1+(v2.bob()) and not (v1+v2).bob()

but is this actually a defined behaviour ?

thanks,
Peter

Gavino
2nd June 2010, 18:45
experience shows that
v1+v2.bob() means v1+(v2.bob()) and not (v1+v2).bob()
but is this actually a defined behaviour ?
Yes, it is.
'.' is not really an operator (what would its right operand be?), just a syntactic element, but in effect it binds more tightly than any operator.

http://avisynth.org/mediawiki/The_full_AviSynth_grammar#Expressions

ProDigit
4th January 2011, 00:56
request a clear wiki page for older anime! (low bitrate,low motion encoding).

mastrboy
26th August 2012, 21:47
I guess this question does not need it's own thread, but fits right into this one.
Is there a bug with the behavior of Eval()?

This works:
Clip
Eval("filter_string")

This does not work, which to me is kind of weird...:
Clip.Eval("filter_string")

IanB
26th August 2012, 23:56
Eval is a little strange, it parses the expression in place where the eval call is. So case 1 isLast=Clip
Filter(Last, _string) # Implicit last handling for Arg[0]if "filter_string" need a clip source orLast=Clip
Filter_string # Implicit last not required for Arg[0]if it does not take a clip source.

And for case 2Filter(Clip, _string) # Explicit Clip as Arg[0]i.e. "filter_string" is expected to take a clip source.

The implicit last handling can make thing a little tricky e.gBlankClip(Height=420)
BlankClip(Height=240).Eval("Subtitle(String(Height()))")Which evaluates toLast=BlankClip(Height=420)
BlankClip(Height=240).Subtitle(String(Height(Last)))So you end up with a 240 high clip with the number 420 stencilled over it.

mastrboy
27th August 2012, 01:41
So it's not a bug, but "intended" behavior.

btw, the Eval entry in the wiki could probably use a little more documentation, it basically only says "Eval evaluates a string as if it was part of the script. " and gives a example...

Gavino
7th September 2012, 09:15
The implicit last handling can make thing a little tricky e.gBlankClip(Height=420)
BlankClip(Height=240).Eval("Subtitle(String(Height()))")Which evaluates toLast=BlankClip(Height=420)
BlankClip(Height=240).Subtitle(String(Height(Last)))So you end up with a 240 high clip with the number 420 stencilled over it.

No it doesn't, it produces the error 'Invalid arguments to function "Eval"'.
Just like any other use of the '.' notation, clip.Eval(filter_string) is the same as Eval(clip, filter_string).
This can never be correct since Eval does not have a clip argument.

The original intent can be achieved by writing
Eval("clip."+filter_string)

kotuwa
12th April 2015, 14:12
What is the difference between putting two functions in two lines vs in one line with a period/dot (.)
!?


For an example,


crop(0,10,0,-10)
Spline64Resize(1280,720)

vs

crop(0,10,0,-10).Spline64Resize(1280,720)


Performance-wise differences,
And differences in Qulaity and Lossyness...
:)

Reel.Deel
12th April 2015, 14:19
What is the difference between putting two functions in two lines vs in one line with a period/dot (.)
!?
.....
Performance-wise differences,
And differences in Qulaity and Lossyness...
:)

There should be no difference. It's just 2 different ways of achieving the same thing.

creaothceann
12th April 2015, 16:26
The first version is the short form of

last = Crop(last, 0, 10, 0, -10)
last = Spline64Resize(last, 1280, 720)

...and the second version is the short form of

last = Spline64Resize(Crop(last, 0, 10, 0, -10), 1280, 720)

The difference is that in the second version, the implied (hidden) variable "last" is not modified between the lines. Consider this example:

Version
PointResize(Width * 2, Height * 2)
PointResize(Width / 2, Height / 2)
Result_1 = last

Version
PointResize(Width * 2, Height * 2).PointResize(Width / 2, Height / 2)
Result_2 = last

Clip "Result_1" will have the same content as the result of "Version", but clip "Result_2" will be half the size of "Version" because "Width" and "Height" refer to clip "last" when not prefixed with a clip variable name.

Expanded to its full form the example looks like this:

a = Version
b = PointResize(a, a.Width * 2, a.Height * 2)
c = PointResize(b, b.Width / 2, b.Height / 2)
Result_1 = c

d = Version
e = PointResize(PointResize(d, d.Width * 2, d.Height * 2), d.Width / 2, d.Height / 2)
Result_2 = e

Btw. an easy way to add a blur effect would be this:

BilinearResize(int(Width * 0.75), int(Height * 0.75)).BilinearResize(Width, Height)

ale_x
16th October 2017, 21:30
Hi.

I used this function recently

ExtractU().dither_resize16()

But I got an error "there is no function named ExtractU"

by the way, I'm using Avynth + .

Thanx =)

Groucho2004
16th October 2017, 21:52
But I got an error "there is no function named ExtractU"
You're probably using an older version of AVS+ that does not have that function. Update to the latest version (r2508).

ale_x
17th October 2017, 10:40
You're probably using an older version of AVS+ that does not have that function. Update to the latest version (r2508).

Thank u very much =).

real.finder
17th October 2017, 15:13
I think last posts should move to https://forum.doom9.org/showthread.php?t=174120

ilko
26th December 2017, 07:25
Q : is there a way to enumerate variables in avs ?

I'm trying to do something similar to the following batch script :
set /a count=1
set var=video%count%
echo the resulting var is "video1"

set /a count+=1
echo we add 1 to the initial count so it's now 2
echo then we set the var gain

set var=video%count%
echo the var is now "video2"

pause

StainlessS
26th December 2017, 10:39
RT_Stats:- https://forum.doom9.org/showthread.php?t=165479&highlight=RT_Stats


RT_VarExist(string)
Given the name (string) of the variable that you want to test for existence, returns true if exists, else false.
Eg, #a=32
RT_Debug(string(RT_VarExist("a"))) # would output 'false' to debugview unless '#a=32' uncommented. {Defined(a) would fail with error}.
return colorbars()


Could also simulate (for Globals) with Try/Catch in script (within a function, and return as result).

EDIT:


Function VarType(String GlobalName) {
Try {
g = Eval(GlobalName) # Fail here if not exist
res= g.IsBool ? 1
\ : g.IsInt ? 2
\ : g.IsFloat ? 3
\ : g.IsString ? 4
\ : g.IsClip ? 5
\ : 0
} Catch (msg) {
res = 0 # Not Exist
}
return res
}

Function VarTypeName(Int TypIx) {Assert(0 <= Typix <= 5,"VarTypeName: Bad Typix") Return Select(TypIx,"NOT_EXIST","Bool","Int","Float","String","Clip")}

Global G_i = 666 # Comment Me Out

Type = VarType("G_i")

TypeName=VarTypeName(Type)

MessageClip("Global G_i Type = "+String(Type) + " : TypeName='"+TypeName+"'")

EDITED:

EDIT: RT_VarExist just returns result of an Avisynth function, would do equivalent of VarExist on local of that name, and if failed then on Global of that name.
We cant test locals in script within a separate function, you would need to inline script try/catch in-situ if required for local.

EDIT: Something like

Try {Dummy=Eval(LocalName) LocalExist=True} Catch(msg) {LocalExist=False} # Dummy, avoid assign anything to Last

ShogunGino
18th April 2018, 08:04
Was looking through the guides and the wiki and seemed to find that the Force Film, IVTC, and Deinterlacing tutorial link seems to be dead. Does anyone have a zip file of it? It looks like its the main tutorial that I need for my current situation.

Seedmanc
29th August 2018, 18:34
Do we have a definitive guide for MVTools options that does a better job at explaining what the more obscure settings do than the official page? I'm particularly interested in what typical situations the options like divide, trymany, temporal, rfilter and so on should be used.
You'd think after all this time somebody would have done a proper analysis and comparison the way they're done for videocodecs. For example, by taking a source video, halving its framerate then upsampling it back and comparing with the original using tools like MSU VQM or other stuff with metrics like PSNR. This is the way I'm trying to do it, but there's only so much you can derive from metrics you don't know comparing options you don't understand.
For example I was surprised to find out that a combination of block size 32 and truemotion=true gives results a lot worse than most other combinations of sizes and values. Another counter-intuitive discovery was that the search method 3 (which is claimed to be similar to x264's ESA) is actually faster and not better than 5 (UMH).
What options should be tweaked first when dealing with 2K video with lots of flickering? I'm under the impression that most of Avisynth's filters were written in the DVD era and might have SD resolution dependency hardcoded in one way or another somewhere.

imsrk48
28th April 2019, 06:30
I want to learn about this plugin more better

http://www.infognition.com/super_resolution_avisynth/

FranceBB
29th April 2019, 07:49
I want to learn about this plugin more better

http://www.infognition.com/super_resolution_avisynth/

According to the comparison screenshots they posted on their websites, it looks like a decent upscaling kernel vs PointResize.

https://i.imgur.com/eJNozWF.png

I think that you can achieve something like this by using a decent upscaling kernel yourself, especially in combination with NNEDI and 16bit precision to get better results.

Start with something like:


nnedi3_rpow2(cshift="Spline64Resize", rfactor=2, fwidth=1920, fheight=1080, nsize=4, nns=4, qual=1, etype=0, pscrn=2, threads=0, csresize=true, mpeg2=true, threads_rs=0, logicalCores_rs=true, MaxPhysCore_rs=true, SetAffinity_rs=false, opt=3)


for 8bit.
If you want more precision, you can use:


nnedi3_resize16(target_width=1920, target_height=1080, mixed=true, thr=1.0, elast=1.5, nns=4, qual=2, etype=0, pscrn=4, threads=0, tv_range=true, kernel_d="Spline", kernel_u="Spline", taps=6, f_d=1.0, f_u=2.0, sharp=0, lsb_in=true, lsb=true)


It will use more taps for Spline so it will be very sharp, but it will also try to preserve edges and avoid ringing and aliasing thanks to the trained neural netowk; it's also gonna work with 16bit precision and since it works in 16bit stacked, it's compatible with the normal Avisynth 2.6.1 from 2016.

Cheers,
Frank.

imsrk48
16th May 2019, 07:28
According to the comparison screenshots they posted on their websites, it looks like a decent upscaling kernel vs PointResize.

https://i.imgur.com/eJNozWF.png

I think that you can achieve something like this by using a decent upscaling kernel yourself, especially in combination with NNEDI and 16bit precision to get better results.

Start with something like:


nnedi3_rpow2(cshift="Spline64Resize", rfactor=2, fwidth=1920, fheight=1080, nsize=4, nns=4, qual=1, etype=0, pscrn=2, threads=0, csresize=true, mpeg2=true, threads_rs=0, logicalCores_rs=true, MaxPhysCore_rs=true, SetAffinity_rs=false, opt=3)


for 8bit.
If you want more precision, you can use:


nnedi3_resize16(target_width=1920, target_height=1080, mixed=true, thr=1.0, elast=1.5, nns=4, qual=2, etype=0, pscrn=4, threads=0, tv_range=true, kernel_d="Spline", kernel_u="Spline", taps=6, f_d=1.0, f_u=2.0, sharp=0, lsb_in=true, lsb=true)


It will use more taps for Spline so it will be very sharp, but it will also try to preserve edges and avoid ringing and aliasing thanks to the trained neural netowk; it's also gonna work with 16bit precision and since it works in 16bit stacked, it's compatible with the normal Avisynth 2.6.1 from 2016.

Cheers,
Frank.Thanks a Lot [emoji4]

imsrk48
25th May 2019, 12:14
Please suggest me script for add .png logo on a video.

imsrk48
4th September 2019, 08:00
Please suggest me script for add .png logo on a video.Anyone Answer Please [emoji120]

Sent from my LG-M700 using Tapatalk

imsrk48
4th September 2019, 08:02
According to the comparison screenshots they posted on their websites, it looks like a decent upscaling kernel vs PointResize.

https://i.imgur.com/eJNozWF.png

I think that you can achieve something like this by using a decent upscaling kernel yourself, especially in combination with NNEDI and 16bit precision to get better results.

Start with something like:


nnedi3_rpow2(cshift="Spline64Resize", rfactor=2, fwidth=1920, fheight=1080, nsize=4, nns=4, qual=1, etype=0, pscrn=2, threads=0, csresize=true, mpeg2=true, threads_rs=0, logicalCores_rs=true, MaxPhysCore_rs=true, SetAffinity_rs=false, opt=3)


for 8bit.
If you want more precision, you can use:


nnedi3_resize16(target_width=1920, target_height=1080, mixed=true, thr=1.0, elast=1.5, nns=4, qual=2, etype=0, pscrn=4, threads=0, tv_range=true, kernel_d="Spline", kernel_u="Spline", taps=6, f_d=1.0, f_u=2.0, sharp=0, lsb_in=true, lsb=true)


It will use more taps for Spline so it will be very sharp, but it will also try to preserve edges and avoid ringing and aliasing thanks to the trained neural netowk; it's also gonna work with 16bit precision and since it works in 16bit stacked, it's compatible with the normal Avisynth 2.6.1 from 2016.

Cheers,
Frank.How Can I Use This in MeGUI?

Sent from my LG-M700 using Tapatalk

StainlessS
4th September 2019, 10:03
How Can I Use This in MeGUI?
Learn how to use Avisynth, then most of your requests could be done by yourself.

StainlessS
4th September 2019, 11:07
Please suggest me script for add .png logo on a video.

you could try this


# SomeLogo.avs
# with Avisynth installed, play avs in most any player except VLC. # ie, get it working BEFORE try use in MeGUI
Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line]
#AviSource("D:\Parade.avi").ConvertToYV12

I=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path)

##### CONFIG #####
I_Width = 128 # Your required width of Logo, multiple of 2
I_HEIGHT = 96 # Your required Height of Logo, multiple of 2
LOGO_X = -20 # Logo X position
LOGO_Y = -20 # Logo Y position
RGT_REL = True # If True then LOGO_X adjusts right aligned, ie LOGO_X=0 is hard against Right hand side)
BOT_REL = True # If True then LOGO_Y adjusts Bottom aligned, ie LOGO_Y=0 is hard against bottom)
OPACITY = 0.5 # 0.0 -> 1.0, 0.0=NO LOGO, 1=ALL LOGO
START_FRAME = 25
END_FRAME = 100 # 0 = Do Till End of clip
### END CONFIG ###

Assert(I_WIDTH%2==0 &&I_HEIGHT%2==0,"SomeLogo: I_Width and I_Height have to be multiple of 2")
I=(I.Width!=I_WIDTH || I.Height != I_HEIGHT) ? I.Spline36Resize(I_WIDTH,I_HEIGHT) : I # Resize to required
I=I.ConvertToYV12 # Same As Source clip
END_FRAME = (END_FRAME==0) ? Framecount-1 : END_FRAME
LOGO_X = (RGT_REL) ? (Width -I.Width + LOGO_X) : LOGO_X
LOGO_Y = (BOT_REL) ? (Height-I.Height + LOGO_Y) : LOGO_Y
MASK=I.BlankClip(Color_YUV=$FF8080) # Solid White (just dummy for ApplyRange really)

(START_FRAME==0 && END_FRAME==FrameCount-1)
\ ? Last.Overlay(I,x=LOGO_X,y=LOGO_Y,Opacity=OPACITY)
\ : Last.ApplyRange(START_FRAME,END_FRAME,"Overlay",I,LOGO_X,LOGO_Y,MASK,OPACITY)

#return last.info # Uncomment for TESTING



EDIT: Mod

# SomeLogo.avsi # Put in Avisynth Plugins AND MeGUI Plugins (NOTE, AVSI)
Function SomeLogo(clip c,clip Img,Int "I_Width",Int "I_Height",Int "Logo_X",Int "Logo_Y",Bool "Rgt_Rel",Bool "Bot_Rel",Float "Opacity",Int"Start_Frame",Int "End_Frame") {
c # Last = c
I_Width = Default(I_Width, img.Width) # Default original Image Width
I_Height = Default(I_Height,img.Height) # Default original Image Height
Logo_X = Default(Logo_X,0) # Default 0
Logo_Y = Default(Logo_Y,0) # Default 0
Rgt_Rel = Default(Rgt_rel,False) # Default False
bot_Rel = Default(bot_rel,False) # Default False
Opacity = Default(Opacity,1.0) # Default 1.0, ALL image
Start_Frame = Default(Start_Frame,0) # Default frame 0
End_Frame = Default(End_Frame,0) # Default 0 = LAST FRAME
Assert(I_WIDTH%2==0 &&I_HEIGHT%2==0,"SomeLogo: I_Width and I_Height have to be multiple of 2")
Img=(Img.Width!=I_WIDTH || Img.Height != I_HEIGHT) ? Img.Spline36Resize(I_WIDTH,I_HEIGHT) : Img # Resize to required
Img=Img.ConvertToYV12 # Same As Source clip
END_FRAME = (END_FRAME==0) ? Framecount-1 : END_FRAME
LOGO_X = (RGT_REL) ? (Width -Img.Width + LOGO_X) : LOGO_X
LOGO_Y = (BOT_REL) ? (Height-Img.Height + LOGO_Y) : LOGO_Y
MASK=Img.BlankClip(Color_YUV=$FF8080) # Solid White (just dummy for ApplyRange really)

(START_FRAME==0 && END_FRAME==FrameCount-1)
\ ? Last.Overlay(Img,x=LOGO_X,y=LOGO_Y,Opacity=OPACITY)
\ : Last.ApplyRange(START_FRAME,END_FRAME,"Overlay",Img,LOGO_X,LOGO_Y,MASK,OPACITY)
Return Last
}
# END SomeLogo.avsi # For initial testing, can have above function in this test script, when move above to avsi in plugins, then remove above from this script.


# Your script calling the function in plugins [ someLogo.avsi : SomeLogo() ]
# with Avisynth installed, play avs in most any player except VLC. # ie, get it working BEFORE try use in MeGUI
Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line]
#AviSource("D:\Parade.avi").ConvertToYV12

Img=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path)

##### CONFIG #####
I_Width = 128 # Your required width of Logo, multiple of 2
I_HEIGHT = 96 # Your required Height of Logo, multiple of 2
LOGO_X = -20 # Logo X position
LOGO_Y = -20 # Logo Y position
RGT_REL = True # If True then LOGO_X adjusts right aligned, ie LOGO_X=0 is hard against Right hand side)
BOT_REL = True # If True then LOGO_Y adjusts Bottom aligned, ie LOGO_Y=0 is hard against bottom)
OPACITY = 0.5 # 0.0 -> 1.0, 0.0=NO LOGO, 1=ALL LOGO
START_FRAME = 25
END_FRAME = 100 # 0 = Do Till End of clip
### END CONFIG ###

SomeLogo(Img,I_Width=I_WIDTH,I_Height=I_HEIGHT,Logo_X=LOGO_X,Logo_Y=LOGO_Y,Rgt_Rel=RGT_REL,Bot_Rel=BOT_REL,Opacity=OPACITY,Start_Frame=START_FRAME,End_Frame=END_FRAME)
#SomeLogo(Img,128,96,Opacity=0.5,Start_Frame=25,End_Frame=100) # Logo_X, Logo_Y,Rgt_Rel, Bot_rel, ALL DEFAULT ::: ALL CONFIG part can be missed out
#SomeLogo(Img,128,96,-20,-20,true,true,0.5,0,100) # ALL CONFIG part can be missed out

#return last.info # Uncomment for TESTING


EDIT: So with SomeLogo.avsi in plugins, can use just like so:-

Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line]
Img=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path)
SomeLogo(Img,128,96,-20,-20,true,true,0.5,0,100) # ALL CONFIG part can be missed out
#SomeLogo(Img,I_Width=128,I_Height=96,Logo_X=-20,Logo_Y=-20,Rgt_Rel=True,Bot_Rel=True,Opacity=0.5,Start_Frame=0,End_Frame=100) # ALL CONFIG part can be missed out

VoodooFX
5th September 2019, 02:44
Is it possible to get path to avisyth.dll in use from avs script? Maybe invoke some error with try and catch?

StainlessS
5th September 2019, 14:32
VDX, Think that is best in realm of Groucho2004 SysInfo plug [if/when implemented], G2K4 has code to get real path to system32/sysWOW64, and I think it was a bit tricky to achieve
as system tries to make everything [x86 or x64] seem to appear in system32. (Of course it may not even be in system32, could be in eg MeGUI folder or whatever).

Maybe ask G2K4 bout it, he's a nice fella and if you beg sufficiently well [bit of praise also works I hear], then maybe he do it. [EDIT: Refer to him as "My Leader", I believe he likes that]

EDIT: Also note, RT_Stats GetSystemEnv thing (or other GetSystemEnv type plugs) for eg "COMSPEC" return path to eg "d:\Windows\system32\Cmd.exe",
as that is how is set in system environment, even though it may really be in sysWOW64. So, if you need real path, G2K4 is the man that can.

Groucho2004
5th September 2019, 17:23
Maybe ask G2K4 bout it, he's a nice fella and if you beg sufficiently well [bit of praise also works I hear], then maybe he do it. [EDIT: Refer to him as "My Leader", I believe he likes that]Don't forget that I require a goat to be sacrificed before I start writing code.

@VoodooFX
I'll probably add that to the SysInfo() plugin.

VoodooFX
5th September 2019, 20:36
I was thinking about some trick without external plugin.
I have seen on other forums newbies have problems with standalone MeGUI's avs+ not auto-loading ImageSeq.dll, error is not very clear what is wrong. I'll just catch that and assert with more clear msg then.
Requesting them to get more plugins not good idea. :)

Groucho2004
5th September 2019, 22:06
I was thinking about some trick without external plugin.
I have seen on other forums newbies have problems with standalone MeGUI's avs+ not auto-loading ImageSeq.dll, error is not very clear what is wrong. I'll just catch that and assert with more clear msg then.
Requesting them to get more plugins not good idea. :)
It's not possible as far as I know without some code that digs into the parent process and enumerates loaded modules.

As for megui's "portable" mode and plugins that were externalized in AVSPlus - I don't understand how this is even a problem, it seems ridiculous.

imsrk48
7th October 2019, 04:39
you could try this


# SomeLogo.avs
# with Avisynth installed, play avs in most any player except VLC. # ie, get it working BEFORE try use in MeGUI
Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line]
#AviSource("D:\Parade.avi").ConvertToYV12

I=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path)

##### CONFIG #####
I_Width = 128 # Your required width of Logo, multiple of 2
I_HEIGHT = 96 # Your required Height of Logo, multiple of 2
LOGO_X = -20 # Logo X position
LOGO_Y = -20 # Logo Y position
RGT_REL = True # If True then LOGO_X adjusts right aligned, ie LOGO_X=0 is hard against Right hand side)
BOT_REL = True # If True then LOGO_Y adjusts Bottom aligned, ie LOGO_Y=0 is hard against bottom)
OPACITY = 0.5 # 0.0 -> 1.0, 0.0=NO LOGO, 1=ALL LOGO
START_FRAME = 25
END_FRAME = 100 # 0 = Do Till End of clip
### END CONFIG ###

Assert(I_WIDTH%2==0 &&I_HEIGHT%2==0,"SomeLogo: I_Width and I_Height have to be multiple of 2")
I=(I.Width!=I_WIDTH || I.Height != I_HEIGHT) ? I.Spline36Resize(I_WIDTH,I_HEIGHT) : I # Resize to required
I=I.ConvertToYV12 # Same As Source clip
END_FRAME = (END_FRAME==0) ? Framecount-1 : END_FRAME
LOGO_X = (RGT_REL) ? (Width -I.Width + LOGO_X) : LOGO_X
LOGO_Y = (BOT_REL) ? (Height-I.Height + LOGO_Y) : LOGO_Y
MASK=I.BlankClip(Color_YUV=$FF8080) # Solid White (just dummy for ApplyRange really)

(START_FRAME==0 && END_FRAME==FrameCount-1)
\ ? Last.Overlay(I,x=LOGO_X,y=LOGO_Y,Opacity=OPACITY)
\ : Last.ApplyRange(START_FRAME,END_FRAME,"Overlay",I,LOGO_X,LOGO_Y,MASK,OPACITY)

#return last.info # Uncomment for TESTING



EDIT: Mod

# SomeLogo.avsi # Put in Avisynth Plugins AND MeGUI Plugins (NOTE, AVSI)
Function SomeLogo(clip c,clip Img,Int "I_Width",Int "I_Height",Int "Logo_X",Int "Logo_Y",Bool "Rgt_Rel",Bool "Bot_Rel",Float "Opacity",Int"Start_Frame",Int "End_Frame") {
c # Last = c
I_Width = Default(I_Width, img.Width) # Default original Image Width
I_Height = Default(I_Height,img.Height) # Default original Image Height
Logo_X = Default(Logo_X,0) # Default 0
Logo_Y = Default(Logo_Y,0) # Default 0
Rgt_Rel = Default(Rgt_rel,False) # Default False
bot_Rel = Default(bot_rel,False) # Default False
Opacity = Default(Opacity,1.0) # Default 1.0, ALL image
Start_Frame = Default(Start_Frame,0) # Default frame 0
End_Frame = Default(End_Frame,0) # Default 0 = LAST FRAME
Assert(I_WIDTH%2==0 &&I_HEIGHT%2==0,"SomeLogo: I_Width and I_Height have to be multiple of 2")
Img=(Img.Width!=I_WIDTH || Img.Height != I_HEIGHT) ? Img.Spline36Resize(I_WIDTH,I_HEIGHT) : Img # Resize to required
Img=Img.ConvertToYV12 # Same As Source clip
END_FRAME = (END_FRAME==0) ? Framecount-1 : END_FRAME
LOGO_X = (RGT_REL) ? (Width -Img.Width + LOGO_X) : LOGO_X
LOGO_Y = (BOT_REL) ? (Height-Img.Height + LOGO_Y) : LOGO_Y
MASK=Img.BlankClip(Color_YUV=$FF8080) # Solid White (just dummy for ApplyRange really)

(START_FRAME==0 && END_FRAME==FrameCount-1)
\ ? Last.Overlay(Img,x=LOGO_X,y=LOGO_Y,Opacity=OPACITY)
\ : Last.ApplyRange(START_FRAME,END_FRAME,"Overlay",Img,LOGO_X,LOGO_Y,MASK,OPACITY)
Return Last
}
# END SomeLogo.avsi # For initial testing, can have above function in this test script, when move above to avsi in plugins, then remove above from this script.


# Your script calling the function in plugins [ someLogo.avsi : SomeLogo() ]
# with Avisynth installed, play avs in most any player except VLC. # ie, get it working BEFORE try use in MeGUI
Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line]
#AviSource("D:\Parade.avi").ConvertToYV12

Img=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path)

##### CONFIG #####
I_Width = 128 # Your required width of Logo, multiple of 2
I_HEIGHT = 96 # Your required Height of Logo, multiple of 2
LOGO_X = -20 # Logo X position
LOGO_Y = -20 # Logo Y position
RGT_REL = True # If True then LOGO_X adjusts right aligned, ie LOGO_X=0 is hard against Right hand side)
BOT_REL = True # If True then LOGO_Y adjusts Bottom aligned, ie LOGO_Y=0 is hard against bottom)
OPACITY = 0.5 # 0.0 -> 1.0, 0.0=NO LOGO, 1=ALL LOGO
START_FRAME = 25
END_FRAME = 100 # 0 = Do Till End of clip
### END CONFIG ###

SomeLogo(Img,I_Width=I_WIDTH,I_Height=I_HEIGHT,Logo_X=LOGO_X,Logo_Y=LOGO_Y,Rgt_Rel=RGT_REL,Bot_Rel=BOT_REL,Opacity=OPACITY,Start_Frame=START_FRAME,End_Frame=END_FRAME)
#SomeLogo(Img,128,96,Opacity=0.5,Start_Frame=25,End_Frame=100) # Logo_X, Logo_Y,Rgt_Rel, Bot_rel, ALL DEFAULT ::: ALL CONFIG part can be missed out
#SomeLogo(Img,128,96,-20,-20,true,true,0.5,0,100) # ALL CONFIG part can be missed out

#return last.info # Uncomment for TESTING


EDIT: So with SomeLogo.avsi in plugins, can use just like so:-

Colorbars(Pixel_Type="YV12").KillAudio # Testing subtstitute for your source video clip as YV12, ie delete line or comment out [insert '#' before line]
Img=ImageSource(".\Imagemagick-logo.png",END=0) # Your Logo in current directory (or specify path)
SomeLogo(Img,128,96,-20,-20,true,true,0.5,0,100) # ALL CONFIG part can be missed out
#SomeLogo(Img,I_Width=128,I_Height=96,Logo_X=-20,Logo_Y=-20,Rgt_Rel=True,Bot_Rel=True,Opacity=0.5,Start_Frame=0,End_Frame=100) # ALL CONFIG part can be missed out
Thanks a Lot [emoji4] and sorry for not replied

eobard
15th October 2019, 23:32
Is there a mirror of avisynth.nl? The site is down

StainlessS
16th October 2019, 02:50
Its up now.

imsrk48
21st November 2019, 10:46
i want to learn avisynth where i can start?

l00t
21st November 2019, 10:58
i want to learn avisynth where i can start?

http://avisynth.nl/index.php/Main_Page

-> New to AviSynth - Start here

imsrk48
21st November 2019, 11:32
http://avisynth.nl/index.php/Main_Page



-> New to AviSynth - Start hereThanks a Lot [emoji4]

imsrk48
24th December 2019, 14:06
i would like to ask can avisynth increase video quality or 240p video to 720p with some scripts?

https://tune.pk/video/7484297/hatim-episode-1

FranceBB
24th December 2019, 17:16
i would like to ask can avisynth increase video quality or 240p video to 720p with some scripts?

https://tune.pk/video/7484297/hatim-episode-1

Upscaling won't increase video quality as you can't create pixels out of nowhere.
Anyway, there are good upscaling kernels that can upscale a source quite nicely like Spline64 which you can use together with NNEDI.
Please note that - as I said - although you are gonna have more pixels, you won't have more definition as those new pixels are just gonna be "fake". Some argue that upscaling doesn't bring any benefit at all and it's just a waste of space, but on the other hand some other people argue that sometimes it's worth upscaling as it's better to do it with Avisynth than to let the TV or the player do it with something crappy like a FastBilinear. As to your source, it seems to be starved which basically means that whoever encoded it did it at a very low bitrate thus removing important details.
With a source like this, upscaling is the LAST thing I would do.
If you really wanna re-encode it, just do deblocking with Deblock_QED() or the built-in deblocker of x264/x265 if you're planning to re-encode it in H.264/H.265 and a bit of denoise with dfttest(). It will look flat, but at least you won't have macroblocks and ringing everywhere.



By the way...

You linked a streaming website that I don't know, but I highly doubt that it's legal, so if it isn't, moderators will remove your link and you won't receive any further help as piracy is forbidden!

I just did a google search of the series and the first thing I found is a website with the DVDs of the series you linked. I strongly suggest you to get the official DVDs which are gonna be a relatively high bitrate MPEG-2 encodes at 720x480i which are far better than the crappy starved 240p source you linked.

StainlessS
24th December 2019, 18:07
+1 for what FranceBB said, tis truly garbage.

imsrk48
24th December 2019, 19:06
Upscaling won't increase video quality as you can't create pixels out of nowhere.
Anyway, there are good upscaling kernels that can upscale a source quite nicely like Spline64 which you can use together with NNEDI.
Please note that - as I said - although you are gonna have more pixels, you won't have more definition as those new pixels are just gonna be "fake". Some argue that upscaling doesn't bring any benefit at all and it's just a waste of space, but on the other hand some other people argue that sometimes it's worth upscaling as it's better to do it with Avisynth than to let the TV or the player do it with something crappy like a FastBilinear. As to your source, it seems to be starved which basically means that whoever encoded it did it at a very low bitrate thus removing important details.
With a source like this, upscaling is the LAST thing I would do.
If you really wanna re-encode it, just do deblocking with Deblock_QED() or the built-in deblocker of x264/x265 if you're planning to re-encode it in H.264/H.265 and a bit of denoise with dfttest(). It will look flat, but at least you won't have macroblocks and ringing everywhere.



By the way...

You linked a streaming website that I don't know, but I highly doubt that it's legal, so if it isn't, moderators will remove your link and you won't receive any further help as piracy is forbidden!

I just did a google search of the series and the first thing I found is a website with the DVDs of the series you linked. I strongly suggest you to get the official DVDs which are gonna be a relatively high bitrate MPEG-2 encodes at 720x480i which are far better than the crappy starved 240p source you linked.my question according to super resolution plug-in and this is a tv show there's official DVDs not available anywhere. that's why I'm asking btw I'm sorry for using increase quality basically I'm try to asking "how upscale pixels" that you answered [emoji3526]

StainlessS
24th December 2019, 20:36
On Amazon, Currently Unavailable:- https://www.amazon.in/Hatim-Star-Plus-serial-epsiodes/dp/B07RNCKZP5

Bad quality,plz fix it...

I was searching for it for last 5-6 years,but i didn't find any CD or DVD of it.
And at last i got it from amazon.
I was searching for it for better video quality like HD 720p but there is only in 244p which i already have in 360p.
Plz bring it in high resolution, then i will again buy it
Plz plz plz plz plz plz bring it in HD.
THANKS

Price is high

Here on SnapDeal (seems available, Rs 5000 rupees):- https://www.snapdeal.com/product/the-adventures-of-hatim-dvd/627087430366
Given prev quotes, might also be rubbish.

Google Search "Hatim DVD"
https://www.google.com/search?ei=QmYCXuLDHc_OgQb7wpzYAQ&q=Hatim+dvd&oq=Hatim+dvd&gs_l=psy-ab.3..0j0i22i30l8.10234.10771..10949...0.2..0.142.453.1j3......0....1..gws-wiz.......0i71j0i67.6Hgj7B3NDsA&ved=0ahUKEwji7O_mgc_mAhVPZ8AKHXshBxsQ4dUDCAo&uact=5

Good Luck.

EDIT: @ 1 Rupee = £0.011, I make it about £55.00 on Snapdeal, for a garbage DVD [assuming previous quotes also apply to SnapDeal DVD].
Suggest dont waste your money.

imsrk48
25th December 2019, 16:51
On Amazon, Currently Unavailable:- https://www.amazon.in/Hatim-Star-Plus-serial-epsiodes/dp/B07RNCKZP5







Here on SnapDeal (seems available, Rs 5000 rupees):- https://www.snapdeal.com/product/the-adventures-of-hatim-dvd/627087430366
Given prev quotes, might also be rubbish.

Google Search "Hatim DVD"
https://www.google.com/search?ei=QmYCXuLDHc_OgQb7wpzYAQ&q=Hatim+dvd&oq=Hatim+dvd&gs_l=psy-ab.3..0j0i22i30l8.10234.10771..10949...0.2..0.142.453.1j3......0....1..gws-wiz.......0i71j0i67.6Hgj7B3NDsA&ved=0ahUKEwji7O_mgc_mAhVPZ8AKHXshBxsQ4dUDCAo&uact=5

Good Luck.

EDIT: @ 1 Rupee = £0.011, I make it about £55.00 on Snapdeal, for a garbage DVD [assuming previous quotes also apply to SnapDeal DVD].
Suggest dont waste your money.[emoji16][emoji16][emoji16][emoji16]

StainlessS
26th December 2019, 02:57
Imsrk48,

Below is auto generated from a much bigger script.
Source has a weird ripple effect, I think may have been in XVID/DIVX at some point.
Also sections have duplicates where seems to be about 2/3 framerate of the source 24FPS, this messes with motion compensation stuff.
Could stand getting rid of the logos at bottom [see InPaintDelogo thread].
About as much time as I would be prepared to spend on it [although many have spent a long time trying to repair worse clips]


V=LSmashVideoSource(".\Hatim Episode 1 - Tunepk.mp4") # LSmash Plugin
A=LSmashAudioSource(".\Hatim Episode 1 - Tunepk.mp4")
AudioDub(V,A)
ORG=Last

# Below auto generated from Manual settings
Deblock(28) # Plugin (might want to adjust this value)

Cropped=Crop(0,0,0,0,align=true)

# AutoLevels from my MediaFire account, v0.12Beta3_20190711
Cropped.AutoLevels(
\ FilterRadius=12,
\ gamma=UnDefined,
\ AutoGamma=False,
\ midpoint=0.500000,
\ input_low=UnDefined,
\ input_high=UnDefined,
\ ignore_low=0.001953,
\ ignore_high=0.001953,
\ border_l=0,
\ border_r=0,
\ border_t=0,
\ border_b=0,
\ Debug=False,
\ sc2Th=8,
\ sc2Perc=33.333332,
\ gammax=1.500000,
\ gammin=0.666667,
\ MinRng=100)

McDegrainSharp(frames=2,csharp=0.333000,Precise=False) # http://forum.doom9.org/showthread.php?p=1737045#post1737045 [Might want to adjust frames (1->3)]
nnedi3_rpow2(rfactor=4,cshift="Spline36Resize",fwidth=960,fheight=720) # Plugin (960x720=4:3)

Limiter(16,235,16,240)

AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1))) # Make 2 channel
ResampleAudio(44100) # from 22.50 KHz

MeGUI_DarX=4 MeGUI_DarY=3 # Auto set Megui DAR : SnapDeal says DAR is 16:10, looks more like 4:3 to me.

Trim(0,0) # chop/pad audio to match video length
Return Last
Return StackHorizontal(ORG.Spline36Resize(960,720),Last) # Original on left, Doctored on right. # COMMENT OUT Above Return Last


Again, Good Luck.

EDITED as per later post.

imsrk48
26th December 2019, 04:03
Imsrk48,

Below is auto generated from a much bigger script.
Source has a weird ripple effect, I think may have been in XVID/DIVX at some point.
Also sections have duplicates where seems to be about 2/3 framerate of the source 24FPS, this messes with motion compensation stuff.
Could stand getting rid of the logos at bottom [see InPaintDelogo thread].
About as much time as I would be prepared to spend on it [although many have spent a long time trying to repair worse clips]


V=LSmashVideoSource(".\Hatim Episode 1 - Tunepk.mp4") # LSmash Plugin
A=LSmashAudioSource(".\Hatim Episode 1 - Tunepk.mp4")
AudioDub(V,A)


# Below auto generated from Manual settings
Deblock(28) # Plugin (might want to adjust this value)

Cropped=Crop(0,0,0,0,align=true)

# AutoLevels from my MediaFire account, v0.12Beta3_20190711
Cropped.AutoLevels(
\ FilterRadius=12,
\ gamma=UnDefined,
\ AutoGamma=False,
\ midpoint=0.500000,
\ input_low=UnDefined,
\ input_high=UnDefined,
\ ignore_low=0.001953,
\ ignore_high=0.001953,
\ border_l=0,
\ border_r=0,
\ border_t=0,
\ border_b=0,
\ Debug=False,
\ sc2Th=8,
\ sc2Perc=33.333332,
\ gammax=1.500000,
\ gammin=0.666667,
\ MinRng=100)

McDegrainSharp(frames=2,csharp=0.333000,Precise=False) # http://forum.doom9.org/showthread.php?p=1737045#post1737045 [Might want to adjust frames (1->3)]
nnedi3_rpow2(rfactor=4,cshift="Spline36Resize",fwidth=960,fheight=720) # Plugin (960x720=4:3)

Limiter(16,235,16,240)

AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1))) # Make 2 channel
ResampleAudio(44100) # from 22.50 KHz

MeGUI_DarX=4 MeGUI_DarY=3 # Auto set Megui DAR : SnapDeal says DAR is 16:10, looks more like 4:3 to me.

Trim(0,0) # chop/pad audio to match video length
Return Last


Again, Good Luck.Thanks a lot sir for your huge kind and hard work[emoji3531]

StainlessS
26th December 2019, 04:14
imsrk48,

There is not a huge difference, but there is some.
Can compare with simple Spline36Resize using below.

After AudioDub line add

ORG=Last


Replace Return last line with

Return StackHorizontal(ORG.Spline36Resize(960,720),Last) # Original on left, Doctored on right.


View in VirtualDub2
[EDIT: See my prev post, marked in Blue]
Could use above to adjust eg Deblock() arg whilst seeing before and after frames.

MysteryX did some supposed SuperRez thing [EDIT: in devs forum] , dont know if would produce any great improvement [never used it].

EDIT:
Also, in future, might be better to start your own thread [its quite easy], this thread is really about eg changes in avisynth itself [or questions about avisynth], rather than processing video.
People may be more reluctant to answer video processing questions when posted in the wrong thread.

EDIT: You might want to try with deblock() lowered or completely removed, see what it looks like (DeBlock can fix some types of blocking, but can also cause damage, its a balancing act).
Also, it may be that some of the blocking is from before 1 or more resizes to the source, if so then using deblock cannot help for that blocking, its burned in.
The Baby Face, near beginning does benefit from deblock , maybe use those frames to get best setting, try not to go too high, I think max is about 30 or 32.

csharp adjusts sharpness in McDegrainSharp [McDegrainSharp(frames=2,csharp=0.333000,Precise=False)], default is 0.6 but I tend to
use 0.3 or thereabouts for MY default, suggest dont go above 0.6.

EDIT: Another version to try. Switched on NonLinUSM in script generator, & slight mods to script generator defaults.

V=LSmashVideoSource(".\Hatim Episode 1 - Tunepk.mp4") # LSmash Plugin
A=LSmashAudioSource(".\Hatim Episode 1 - Tunepk.mp4")
AudioDub(V,A)
ORG=Last

# Below auto generated from Manual/Auto_detected, settings

Deblock(20) # Reduced from 24

Cropped=Crop(0,0,0,0,align=true) # QueryBorderCropped And/Or Remove Padding for prev DeBlock filter
Cropped.AutoLevels(
\ FilterRadius=12,
\ gamma=UnDefined,
\ AutoGamma=False,
\ midpoint=0.500000,
\ input_low=UnDefined,
\ input_high=UnDefined,
\ ignore_low=0.001000,
\ ignore_high=0.001000,
\ border_l=0,
\ border_r=0,
\ border_t=0,
\ border_b=0,
\ Debug=False,
\ sc2Th=8,
\ sc2Perc=33.333332,
\ gammax=1.100000,
\ gammin=0.909091,
\ MinRng=100)

McDegrainSharp(2,csharp=0.300000,Precise=False) # Pre-Upsize # have reduced (a little) to 0.3, sharpness csharp, 0.0 -> 0.6

nnedi3_rpow2(rfactor=4,cshift="Spline36Resize",fwidth=960,fheight=720) # Upsize

NonlinUSM(z=3, pow=1.100000, str=0.250000, rad=9) # ADDED: Search NonlinUSM script : Can Mod local contrast, suggest str 0.2 - 0.33

Limiter(16,235,16,240) # Limit to TV_Levels range

AudioDub(Last,MergeChannels(GetChannel(1),GetChannel(1))) # Matching to required output, 2 audio channels
ResampleAudio(44100) # Match to required Audio SampleRate

MeGUI_DarX=4 MeGUI_DarY=3

Trim(0,0) # chop/pad audio to match video length
#Return Last # End of Generated Script
Return StackHorizontal(ORG.Spline36Resize(960,720),Last)

NonlinUSM is a sort of local contrast, pixel luma contrast adjusted with respect to pixels near to it, will look somewhat like sharpening and probably be
most evident in eg hair. If I use it, I usually use 0.25 or 0.33. Can just comment out that line if you dont like it.

EDIT: From the clip, seems to be a Hindi, "Lord Of The Rings" clone.
EDIT: Added some comments in script generator, marked above in RED

imsrk48
27th December 2019, 05:33
Okay Sir,

Please someone suggest me all Softwares that working with Avisynth.

I'm trying to learn Avisynth.

StainlessS
27th December 2019, 06:15
See Wiki [see everything on wiki homepage] :- http://avisynth.nl/index.php/Main_Page

Internal filters:- http://avisynth.nl/index.php/Internal_filters
External Filters:- http://avisynth.nl/index.php/External_filters

imsrk48
27th December 2019, 06:26
See Wiki [see everything on wiki homepage] :- http://avisynth.nl/index.php/Main_Page

Internal filters:- http://avisynth.nl/index.php/Internal_filters
External Filters:- http://avisynth.nl/index.php/External_filtersThanks Sir

Mertiz88
31st March 2020, 11:01
Hi there,
Iv'e searched many times but couldn't find what I'm looking for. My question is, can I use any filter of Avisynth separately. For example, someone gave me an encoded video and I wanna apply some filter on it without encoding it again? is that possible by command line or any other way?
Thanks.

stax76
31st March 2020, 11:29
Hi there,
Iv'e searched many times but couldn't find what I'm looking for. My question is, can I use any filter of Avisynth separately. For example, someone gave me an encoded video and I wanna apply some filter on it without encoding it again? is that possible by command line or any other way?
Thanks.

mpv allows ffmpeg and vapoursynth filters:


ffmpeg filters:

https://mpv.io/manual/master/#video-filters


vapoursynth filters:

https://mpv.io/manual/master/#video-filters-vapoursynth


per file configuration:

https://mpv.io/manual/master/#file-specific-configuration-files

hello_hello
31st March 2020, 11:38
Mertiz88,

If you have ffdshow installed it has an Avisynth filter and you can add most things to it. "Add ffdshow video source" usually needs to be checked near the top of the Avisynth filter section.

You can probably install only the ffdshow raw video filter and add it to MPC-HC as an external filter and add Avisynth stuff to it.

I don't use Potplayer, but it has an Avisynth section in it's options so it should do much the same.

Or you could create a script to open the video and audio, add filters to it, then open the script with a media player such as MPC-HC. ie

LoadPlugin("C:\Program Files\MeGUI\tools\ffms\ffms2.dll")
FFMS2("E:\Episode 7.mkv")
SomeFilter()

You'll probably have to be careful not to use any filtering that's too slow to allow real-time playback.

StainlessS
31st March 2020, 12:14
There is also a new-ish video source for VLC [ VLC - AviSynth plugin ]:- https://forum.doom9.org/showthread.php?t=178531

Mertiz88
31st March 2020, 17:05
Thanks guys for great information, much appreciated!!
I'm still newbie for these stuff (like using or adding filters of (avisynth/vapoursynth) to other softwares). I just used handbrake to encode some videos and found out they need to be denoised (slightly) but couldn't do that with its filters (NLMeans & HQDN3D). So, I intended to filter them with staxrip at first and then thought about doing that separately by (avisynth/vapoursynth). What I meant, I want a new video to be created (like 'render' in some video editors) but with exactly the same encode settings (CRF, subme, ref, ....etc) i.e. only the filter will be applied. Is that even possible with the methods you mentioned above OR the filter's effect will remain only in the media player (VLC/mpv/MPC). If you can explain with some details, I'll be thankful!

Selur
2nd April 2020, 04:54
Filtering interlaced content:
Reading: http://avisynth.nl/index.php/FAQ_different_types_content#How_do_I_process_interlaced_content.3F
I'm wondering whether:
AssumeXY().Bob().Filter(...).AssumeXY().Separatefields().Selectevery(4,0,3).Weave()
would be better than:
SeparateFields()
even = SelectEven(last).Filter(...)
odd = SelectOdd(last).Filter(...)
Interleave(even, odd)
Weave()
thinking about temporal filters I thought the second one would be better suited,...

What do you think is 'better' and why? Is it depended on the following filter or is one always better than the other.
Note: that I don't care that the first method adds an additional bobber and the time it takes,...

Cu Selur

poisondeathray
2nd April 2020, 07:03
Filtering interlaced content:
Reading: http://avisynth.nl/index.php/FAQ_different_types_content#How_do_I_process_interlaced_content.3F
I'm wondering whether:
AssumeXY().Bob().Filter(...).AssumeXY().Separatefields().Selectevery(4,0,3).Weave()
would be better than:
SeparateFields()
even = SelectEven(last).Filter(...)
odd = SelectOdd(last).Filter(...)
Interleave(even, odd)
Weave()
thinking about temporal filters I thought the second one would be better suited,...

What do you think is 'better' and why? Is it depended on the following filter or is one always better than the other.
Note: that I don't care that the first method adds an additional bobber and the time it takes,...

Cu Selur





It depends on source, and what you are doing, obviously

Not bob() for the first case - use a smarter double rate deinterlacer that corrects for the up/down field shift.

It's pros /cons -

In the 1st case you have to deinterlace, but you can use temporal filter more effectively

In the 2nd case, you don't get temporal filtering between even/odd fields, only within each group. Motion vectors don't cross between even/odd because they are grouped separately. This can induce a type of flicker on some sources.

But on the other hand some sources may require separate filtering (eg. some defect occurs on even fields, maybe more noise or more saturated etc...) . Using the 1st method will "contaminate" the good fields in those cases

Selur
2nd April 2020, 14:02
Not bob() for the first case - use a smarter double rate deinterlacer that corrects for the up/down field shift.
Just wrote bob not having to start a discussion which bobber might be better suited in this case. :)

It's pros /cons -
In the 1st case you have to deinterlace, but you can use temporal filter more effectively
In the 2nd case, you don't get temporal filtering between even/odd fields, only within each group. Motion vectors don't cross between even/odd because they are grouped separately. This can induce a type of flicker on some sources.
But on the other hand some sources may require separate filtering (eg. some defect occurs on even fields, maybe more noise or more saturated etc...) . Using the 1st method will "contaminate" the good fields in those cases
Thanks for the clarification. :)

Sharc
2nd April 2020, 16:43
And how is it for spatial filtering?
In the 'bob' case the spatial filtering is basically done for the original field and the synthesized other field.
In the 'even/odd' case the spatial filtering is done intra-field (the original fields) only.
Is this correct? Is one method better than the other, or does it also depend on the source?
Some noise filters are spatial-temporal; is there a clear preference for these, or is it also source dependent (I tend to believe so).

FranceBB
7th July 2020, 23:51
Question about the wiki.
In the VapourSource (http://avisynth.nl/index.php/VapourSource) page it says: "*Y8/YV12/16/24 allow bit depths >8 using the Stack16 format." however when I look at the color spaces themselves like YUV420P16 it says "YV12 (x2 width)".
I haven't tried to output anything through VapourSource 'cause I don't have VapourSynth installed, but to me "x2 width" means DoubleWidth which is 16bit interleaved NOT 16bit stacked (which is double height).
Is it outputting 16bit stacked or interleaved? Is it 2x height so 16bit stacked or 2x width so 16bit interleaved?
I'm asking 'cause I generally correct the wiki when I find boo boos and I like everything to be right. :)


p.s yes, wiki maintainers, if you found out some pages (like this (http://avisynth.nl/index.php/ConvertStacked#Notes)) silently and "auto-magically" updating themselves, it wasn't dark magic, it was me xD

feisty2
8th July 2020, 14:35
you won't be needing the stack16 format, my filters/scripts are exclusive to fp32 precision and you will be dealing with YUV444PS or YV24 x4 height (what is this?).

real.finder
8th July 2020, 15:59
Question about the wiki.
In the VapourSource (http://avisynth.nl/index.php/VapourSource) page it says: "*Y8/YV12/16/24 allow bit depths >8 using the Stack16 format." however when I look at the color spaces themselves like YUV420P16 it says "YV12 (x2 width)".
I haven't tried to output anything through VapourSource 'cause I don't have VapourSynth installed, but to me "x2 width" means DoubleWidth which is 16bit interleaved NOT 16bit stacked (which is double height).
Is it outputting 16bit stacked or interleaved? Is it 2x height so 16bit stacked or 2x width so 16bit interleaved?
I'm asking 'cause I generally correct the wiki when I find boo boos and I like everything to be right. :)


p.s yes, wiki maintainers, if you found out some pages (like this (http://avisynth.nl/index.php/ConvertStacked#Notes)) silently and "auto-magically" updating themselves, it wasn't dark magic, it was me xD

I think it's like the old LSMASHSource, it will out in interleaved unless you set stacked=true

but in avs+ it will output HBD

I think you should re-stated that lsb in most filters mean stacked in http://avisynth.nl/index.php/ConvertStacked since there are many n00bs users

FranceBB
9th July 2020, 09:03
I think it's like the old LSMASHSource, it will out in interleaved unless you set stacked=true

but in avs+ it will output HBD


Ok, got it. Corrected on the wiki ;)


I think you should re-stated that lsb in most filters mean stacked in http://avisynth.nl/index.php/ConvertStacked since there are many n00bs users

Done. ;)

DTL
8th December 2020, 22:16
It is possible to insert Unicode char into text, rendered by Subtitle() function ?

Trying
Subtitle(c, +Chr($2022),font="Arial",size=isize,x=10,y=20,halo_color=$FF000000, text_color=$00e0e0e0,utf8=true) to rasterize 'bullet' char with code 0x2022 and it prints " - symbol with code 0x22. I.e. it ignores first byte. May I need somehow StrToUTF8() ? I set font to Arial and looks for the char code in the Insert->Symbol window.

Using Avisynth+.

wonkey_monkey
8th December 2020, 22:50
Not in general, it seems (edit: wrong, see below), but that particular character does exist in whatever the default Windows ASCII character set is these days, and can be typed directly into your script with "ALT+7".

EDIT: Got it. You can do it, but you have to use the full UTF-8 encoding spelled out in bytes, and specify utf8 = true:

subtitle(chr($E2) + chr($80) + chr($A2), utf8 = true)

Or you change the encoding of your script in your text editor to "UTF-8 no BOM" and type or copy/paste directly into your script:

subtitle("•", utf8 = true)

StainlessS
8th December 2020, 23:08
Try Chr($95)


Function SubtitleCharSet() {
S=""
for(y=0,15) {
s=s+"$"+RT_Hex(y*16,2)+ " "
for(x=0,15) {
n=y*16+x
c=(n<32) ? "." : Chr(n)
s=s+c
}
s=s+"\n"
}
S
}

colorbars(width=360,height=512).Trim(0,-1).KillAudio
s=RT_StrReplace(SubtitleCharSet,Chr(10),"\n")
Subtitle(s,font="Courier New",size=32,lsp=0)
return Last


EDIT:
https://i.postimg.cc/hjkvX4nK/subs-00.jpg (https://postimages.org/)

EDIT

BlankClip(Length=1,width=20,height=20)
Bullet=Chr($95)
Subtitle(Bullet)
return last

https://i.postimg.cc/WpSbR7F2/subs-01.jpg (https://postimages.org/)


BlankClip(Length=1,width=20,height=20)
Bullet=Chr($95)
Subtitle(Bullet)
BilinearResize(80,80)
return last

https://i.postimg.cc/jq8K3dm2/subs-02.jpg (https://postimages.org/)

wonkey_monkey
8th December 2020, 23:37
Wait, something's not right there... $80 is the Euro symbol, that's correct, but the ellipsis (…) should be $85. Your graphic shows it at position 84.

Likewise the • symbol sould be $95, but it's at position $94.

Characters $90 and $81 do not encode to anything. There are other missing characters too.

StainlessS
8th December 2020, 23:49
It depends upon Character Set [EDIT: Font] , I used Courier New [which is MonoSpaced to maintain format of the hex/ascii block]

StainlessS
8th December 2020, 23:56
WingDings

Function SubtitleCharSet() {
S=""
for(y=0,15) {
s=s+"$"+RT_Hex(y*16,2)+ " "
for(x=0,15) {
n=y*16+x
c=(n<32) ? "." : Chr(n)
s=s+c
}
s=s+"\n"
}
S
}

colorbars(width=880,height=512).Trim(0,-1).KillAudio
s=RT_StrReplace(SubtitleCharSet,Chr(10),"\n")
#Subtitle(s,font="Courier New",size=32,lsp=0)
Subtitle(s,font="Wingdings",size=32,lsp=0)
return Last

https://i.postimg.cc/pL3KfvR1/subs-03.jpg (https://postimages.org/)

EDIT:
Default Character sets of Subtitle(), RT_Subtitle() and RT_DebugF() are all different outside of $20 -> $7E range.

EDIT: The Hex/Ascii block prints out chars below 32($20) as '.' as they are usually control characters,
some Subtitle() fonts may actually have valid characters for those chars, but we just printed same as '.',
as in Hex/ASCII block.
Also, the similar-ish stuff on the Left above in Windigs block, are Digits in the hex/ascii block.

EDIT:
Wait, something's not right there... $80 is the Euro symbol, that's correct, but the ellipsis (…) should be $85.
You miscounted the characters, There is a comma after Euro symbol which you failed to count, and same on line below it.
[Mentally align with the characters above the euro line]
EDIT: hang on. you're right, maybe something strange there.
I reccon that something on $80 line prints nothing, dont offhand know which character. [there are spaces at end of line]

StainlessS
9th December 2020, 00:35
Here is the answer,


SZ=20
BlankClip(width=80,height=360).Trim(0,-1)
For(n=$80,$8F) {
s = RT_String("$%02X %s",n,Chr(n))
RT_DebugF("%s",S)
Subtitle(s,font="Courier New",size=SZ,y=(n-$80)*SZ)
}

Return Last

https://i.postimg.cc/KcsW6KNK/subs-Copy-00.jpg (https://postimages.org/)

StainlessS
9th December 2020, 03:26
OK, This should produce (more or less) good results whatever charset.
We have fixed numbers (sizes) so that both Courier New and WingDings fonts look OK-ish.


########
# Mod ADD_Y and ADD_X to give more or less spacing to characters in Characterset grid (at least 0)

############### Try eg SIZE_Y=40 SIZE_X=32 ADD_Y=0 ADD_X=32
SIZE_Y = 20 # Font size (For Hex Numbers)
SIZE_X = 16 # Font size (For Hex Numbers [actually spacing allotted])
ADD_Y = 0 # Additional vertical spacing for character grid (over and above hex number font)
ADD_X = 16 # Additional horizontal spacing for character grid (over and above hex number font)
CELL_H = SIZE_Y+ADD_Y # Character Box Height
CELL_W = SIZE_X+ADD_X # Character Box Width (Adjust for font)
VLINE_W = 2 # Vertical grid lines thickness
HLINE_H = 2 # Horizontal grid lines thickness
LINECOL =$808080 # grid color
BORDCOL= $FF0000 # outer lines color
#Font = "Courier New" # Character set Font name (Numbers always done in "Courier New")
Font = "WingDings"
#Font = "Symbol"
#Font = "OpenSymbol"
#Font = "Times New Roman"
#Font = "WebDings"
#######################
HexDigit = "0123456789ABCDEF"
T=BlankClip(Length=1,width=CELL_W,height=CELL_H)

# Do Character Set grid
for(y=0,15) {
For(x=0,15) {
n = y * 16 + x
char = Chr(n)
charC = T.Subtitle(char,font=FONT,size=SIZE_Y)
xclip = (x==0) ? charC : xclip.StackHorizontal(charC.AddBorders(VLINE_W,0,0,0,LINECOL))
}
CHARSET = (y==0) ? xclip : CHARSET.StackVertical(xclip.AddBorders(0,HLINE_H,0,0,LINECOL))
}
#return charset

# Vertical Hex Numbers
TV=T.BlankClip(Width=SIZE_X*3)
for(y=0,15) {
numC = TV.Subtitle("$"+HexDigit.MidStr(y+1,1)+"0",font="Courier New",size=SIZE_Y)
yNumC = (y==0) ? numC : yNumC.StackVertical(numC.Addborders(0,HLINE_H,0,0,LINECOL))
}
#return yNumC

for(x=0,15) {
numC = T.Subtitle(HexDigit.MidStr(x+1,1),font="Courier New",size=SIZE_Y)
xNumC = (x==0) ? numC : xNumC.StackHorizontal(numC.Addborders(VLINE_W,0,0,0,LINECOL))
}
#return xNumC

yNumC = yNumC.AddBorders(0,0,VLINE_W,0,LINECOL) # Line between vertical numbers and charset
xNumC = xNumC.AddBorders(0,0,0,HLINE_H,LINECOL) # Line between horizontal numbers and charset

Corner= T.BlankClip(Width=SIZE_X*3).AddBorders(0,0,VLINE_W,HLINE_H,LINECOL) # Top LHS corner

TOP = Corner.StackHorizontal(xnumC)
BOT = yNumC.StackHorizontal(CHARSET)
StackVertical(TOP,BOT) # Glue the whole lot together

AddBorders(VLINE_W,HLINE_H,VLINE_W,HLINE_H,BORDCOL) # Add Outer border

Return Last



Font = "Courier New"
https://i.postimg.cc/8PVm7MTf/subs-00.jpg (https://postimages.org/)

Font = "WingDings"
https://i.postimg.cc/jSx6XTws/subs-01.jpg (https://postimages.org/)

Win7 Symbol
https://i.postimg.cc/287jYRHL/W7-Symbol.jpg (https://postimages.org/)

Win7 OpenSymbol
https://i.postimg.cc/nzqb1Bg9/W7-Open-Symbol.jpg (https://postimages.org/)

Font = "Times New Roman"
https://i.postimg.cc/mDjVRrF6/Times-New-Roman.jpg (https://postimages.org/)

Font = "WebDings"
https://i.postimg.cc/FzfSqFbS/Webdings.jpg (https://postimages.org/)

Font ="WingDings" # BIG with mods

SIZE_Y = 40 # Font size (For Hex Numbers)
SIZE_X = 32 # Font size (For Hex Numbers [actually spacing allotted])
ADD_Y = 0 # Additional vertical spacing for character grid (over and above hex number font)
ADD_X = 32 # Additional horizontal spacing for character grid (over and above hex number font)

https://i.postimg.cc/5yNJNjKH/Wing-Dings-BIG.jpg (https://postimages.org/)

WebDings Big
https://i.postimg.cc/2yXskGBJ/Web-Dings-Big.jpg (https://postimages.org/)

Spot any more probs Wonkey ?

EDIT:We seem to have a "Bullet" at chr(7) [Bell control code character] in both Courier New and Wingdings.

qyot27
9th December 2020, 05:23
Or you change the encoding of your script in your text editor to "UTF-8 no BOM" and type or copy/paste directly into your script:

subtitle("•", utf8 = true)
Or change the Windows 10 system locale to UTF-8 and drop the utf8=true parameter, because it's not necessary in that scenario (this tactic works with 2.6 as well). (https://forum.doom9.org/showpost.php?p=1909790&postcount=9)

StainlessS
9th December 2020, 06:06
Previous post removed RT_Stats requirement, only AVS+ required.

Converterted to Function, might want to create muiltiple example font frames.

eg SubtitleCharacterSet("Symbol") ++ SubtitleCharacterSet("webdings")++SubtitleCharacterSet("Times New Roman")

SubtitleCharacterSet.avsi

# SubtitleCharacterSet.avsi

/*
SubtitleCharacterSet() ::: by StainlessS @ https://forum.doom9.org/showthread.php?p=1930308#post1930308

Req Avs+

Produces an RGB32 single frame showing characterset for a particular Subtitle font, in Hex/ASCII table.

SubtitleCharacterSet(
String Font, [* Font Name, Not Optional, Default Arial if "" or invalid font *]
Int "Size_y" =20, [* Height of Hex numbers [Courier New) *]
Int "Size_X" =16, [* Width of Hex numbers [Courier New) *]
Int "Add_Y" =0, [* Vertical Spacing to add for Font characterset, over and obove that allotted for Hex Numbers *]
Int "Add_X" =16, [* Hoizontal Spacing to add for Font characterset, over and obove that allotted for Hex Numbers *]
Int "VLine_W"=2, [* Width of Vertical lines in grid *]
Int "HLine_H"=2, [* Height of Horizontal lines in grid *]
Int "LineCol"=$808080, [* Color of Lines in grid *]
Int "BordCol"=$FF0000, [* Color of border line *]
Bool "Title "=True [* Show Font title on top of frame *]
)

eg
SubtitleCharacterSet("Arial")
SubtitleCharacterSet("Courier New")
SubtitleCharacterSet("Symbol")
SubtitleCharacterSet("OpenSymbol")
SubtitleCharacterSet("Times New Roman")
SubtitleCharacterSet("WebDings")
SubtitleCharacterSet("WingDings")
SubtitleCharacterSet("WebDings" ,Size_Y=40,Size_X=32,Add_Y=0,Add_X=32)
SubtitleCharacterSet("WingDings",Size_Y=40,Size_X=32,Add_Y=0,Add_X=32)
SubtitleCharacterSet("Symbol") ++ SubtitleCharacterSet("webdings")++SubtitleCharacterSet("Times New Roman")

*/

Function SubtitleCharacterSet(String Font,Int "Size_y",Int "Size_X",Int "Add_Y",Int "Add_X",
\ Int "VLine_W", Int "HLine_H",
\ Int "LineCol",Int "BordCol",
\ Bool "Title"
\ ) {
Size_Y = Default(Size_Y,20)
Size_X = Default(Size_X,16)
Add_Y = Default(Add_Y, 0)
Add_X = Default(Add_X, 16)
VLine_W = Default(VLine_W,2)
HLine_H = Default(HLine_H,2)
LineCol = Default(LineCol,$808080)
BordCol = Default(BordCol,$FF0000)
Title = Default(Title,True)
#
CELL_H = SIZE_Y+ADD_Y # Character Box Height
CELL_W = SIZE_X+ADD_X # Character Box Width (Adjust for font)
T=BlankClip(Length=1,width=CELL_W,height=CELL_H)
HexDigit = "0123456789ABCDEF"
# Do Character Set grid
for(y=0,15) {
For(x=0,15) {
n = y * 16 + x
char = Chr(n)
charC = T.Subtitle(char,font=FONT,size=SIZE_Y)
xclip = (x==0) ? charC : xclip.StackHorizontal(charC.AddBorders(VLINE_W,0,0,0,LINECOL))
}
CHARSET = (y==0) ? xclip : CHARSET.StackVertical(xclip.AddBorders(0,HLINE_H,0,0,LINECOL))
}
# Vertical Hex Numbers
TV=T.BlankClip(Width=SIZE_X*3)
for(y=0,15) {
numC = TV.Subtitle("$"+HexDigit.MidStr(y+1,1)+"0",font="Courier New",size=SIZE_Y)
yNumC = (y==0) ? numC : yNumC.StackVertical(numC.Addborders(0,HLINE_H,0,0,LINECOL))
}
for(x=0,15) {
numC = T.Subtitle(HexDigit.MidStr(x+1,1),font="Courier New",size=SIZE_Y)
xNumC = (x==0) ? numC : xNumC.StackHorizontal(numC.Addborders(VLINE_W,0,0,0,LINECOL))
}
yNumC = yNumC.AddBorders(0,0,VLINE_W,0,LINECOL) # Line between vertical numbers and charset
xNumC = xNumC.AddBorders(0,0,0,HLINE_H,LINECOL) # Line between horizontal numbers and charset
Corner= T.BlankClip(Width=SIZE_X*3).AddBorders(0,0,VLINE_W,HLINE_H,LINECOL) # Top LHS corner
TOP = Corner.StackHorizontal(xnumC)
BOT = yNumC.StackHorizontal(CHARSET)
StackVertical(TOP,BOT) # Glue the whole lot together
AddBorders(VLINE_W,HLINE_H,VLINE_W,HLINE_H,BORDCOL) # Add Outer border
(TITLE)
\ ? Last.BlankClip(Height=SIZE_Y).StackVertical(Last).Subtitle(Font,font="Courier New",size=SIZE_Y).AddBorders(VLINE_W,HLINE_H,VLINE_W,0,BORDCOL)
\ : Last
Return Last
}

EDIT: Added in BLUE

[* Font Name, Not Optional, Default Arial if "" or invalid font *]

EDIT:
script with the SubtitleCharacterSet.avsi in plugins.

StackVertical(SubtitleCharacterSet("Symbol"),SubtitleCharacterSet("webdings"))

https://i.postimg.cc/L85vzPb9/Stack-Symbols.jpg (https://postimages.cc/)


EDIT: UK NumberPlate font (Charles Write font):- https://forum.doom9.org/showpost.php?p=1817708&postcount=25
See StainlessS below in sig, DATA folder for font.
https://i.postimg.cc/ZnbF6nb9/Subtitle-Character-Set-00.jpg (https://postimages.org/)

DTL
9th December 2020, 08:42
Or change the Windows 10 system locale to UTF-8 and drop the utf8=true parameter, because it's not necessary in that scenario (this tactic works with 2.6 as well). (https://forum.doom9.org/showpost.php?p=1909790&postcount=9)

Well - I see I am lucky to have 'bullet' symbol in typically lower bytes like Chr(7) or Chr($95). But I usually use simplest and I think ANSI text editor from FAR file manager and think there were way to enter multi-byte characters by its codes to text if we have functions like utf8=true in rasterizer and some convert like StrToUTF8().

Like:
1. Create empty string.
2. Convert it to UTF8 so it is now treated as UTF8 encoded string.
3. + (add) to it our required char code like +CHR($2022).
4. Use it in Subtitle.

So to use UTF-8 symbols and strings we need to operate avisynth script as UTF-8 encoded file ? And from 8-bit ANSI text files we can call only 256-symbols part of fonts ?

wonkey_monkey
9th December 2020, 15:17
You can enter multibyte characters using CHR, but you have to use the UTF-8 encoding (0xE2 0x80 0xA2), not the Unicode code point (0x2022).

... + chr($E2) + chr($80) + chr($A2) ...

DTL
9th December 2020, 16:30
You can enter multibyte characters using CHR, but you have to use the UTF-8 encoding (0xE2 0x80 0xA2), not the Unicode code point (0x2022).

... + chr($E2) + chr($80) + chr($A2) ...

Oh - now I undrstand. It is Ms Word that shows in the single window named 'code word' 0x95 for ASCII hex 'bullet' and unicode hex 0x2022 for the Unicode 'bullet', but they are very different numbers. And I need to found somewhere convertor of 'Unicode code point' into real byte sequence to enter it using CHR().

StainlessS
9th December 2020, 20:13
I'm guessin' that MidStr() et al cannot cope with UTF-8. [?]

DTL
30th December 2020, 17:29
Because this forum is mostly about moving pictures I finally made script for creating source data for testing resizers. Based on the 'bullet' symbol because it is closer to 'elementary moving picture object' like elementary 'dot'.


function SourceObject(clip c, float fArg)
{
xpos_rot = c.width/3+(10*Sin(Pi()*fArg/(50)))
ypos_rot = c.width/3-(10*Cos(Pi()*fArg/(50)))

xpos_diag = c.width*2/3+(10*Sin(Pi()*fArg/(50)))
ypos_diag = c.width*2/3-(10*Sin(Pi()*fArg/(50)))

xpos_h = c.width*2/3+(10*Sin(Pi()*fArg/(50)))
ypos_h = c.width/3

xpos_v = c.width/3
ypos_v = c.width*2/3+(10*Sin(Pi()*fArg/(50)))

ch_size = (Int(fArg/100))+1

xpos_rot_i=Int(xpos_rot)
ypos_rot_i=Int(ypos_rot)

xpos_diag_i=Int(xpos_diag)
ypos_diag_i=Int(ypos_diag)

xpos_h_i=Int(xpos_h)
ypos_h_i=Int(ypos_h)

xpos_v_i=Int(xpos_v)
ypos_v_i=Int(ypos_v)

c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_rot_i,y=ypos_rot_i,halo_color=$FF000000, text_color=$00e0e0e0)
c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_diag_i,y=ypos_diag_i,halo_color=$FF000000, text_color=$00e0e0e0)
c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_h_i,y=ypos_h_i,halo_color=$FF000000, text_color=$00e0e0e0)
c=Subtitle(c, CHR($95),font="Arial",size=ch_size,x=xpos_v_i,y=ypos_v_i,halo_color=$FF000000, text_color=$00e0e0e0)

return c

}

BlankClip(30000,800,800,"RGB24",25,color=$00202020)

Animate(last, 0,30000,"SourceObject", 0, 30000)

ConvertToYV24()

# production-downsizing
#SinPowResizeMT(last,width/10,height/10,p=2.6)
GaussResize(last,width/10,height/10,p=12)
#JincResize(width/10,height/10,tap=5)
#LanczosResizeMT(last,width/10,height/10,taps=8)

#restoring vewing-upsizing
#SincLin2ResizeMT(width*8,height*8,taps=8)
SincResize(width*8,height*8,taps=5)
#JincResize(width*8,height*8,tap=5)

#Levels(25, 1, 55, 0, 255) # can be used for better viewing of processing errors


It feeds to resizers the number of test objects at various positions with step about 0.1 of sampling grid size and size of object with 0.1 step. After getting good result with one dot - other more complicated symbols may be tested.

StainlessS
8th March 2021, 21:05
Added UK Numberplate font image to post #164.
Also added font in zip, StainlessS@MediaFire in sig, DATA folder.

GAP
28th April 2021, 12:53
What is a good way to practice making these scripts? Someone recommend another method to resize videos and they suggested that I use a AVISynth script to do that. Can anyone tell what is a good way to start? Or even have a dictionary/guide/etc. to get em started?

StainlessS
28th April 2021, 16:12
Where it says "New To Avisynth - Start Here"
http://avisynth.nl/index.php/Main_Page

GAP
2nd May 2021, 07:34
Can you have AVIsynth and AVISynth + on the same computer?

StainlessS
2nd May 2021, 11:48
Can you have AVIsynth and AVISynth + on the same computer?
Yes but only one can be "Active" at any one time [can have x86 and x64 at same time)
Universal Avisynth Installer:- https://forum.doom9.org/showthread.php?t=172124
Easy to switch, just execute the CMD file, and select which version you want to activate.

where both x86 and x64 active, use eg VDub2 x86 for x86 AVS, and VDub2 x64 for x64 AVS.

x86 VD2 requires x86 Avisynth and x86 plugins, x64 VD2 requires x64 Avisynth and x64 plugins.

GAP
1st June 2021, 07:27
Does anyone here have an AVISynth "cheat sheet"? I am not looking for anything complicated,just something simple that I can use to get me started.

Reel.Deel
1st June 2021, 12:00
Does anyone here have an AVISynth "cheat sheet"? I am not looking for anything complicated,just something simple that I can use to get me started.

Take a look at the AviSynth wiki page. There's a section on the front page titled "New to AviSynth – Start Here", there you will find lots of good information on how to get started. The guides page (http://avisynth.nl/index.php/Guides) should be really helpful.

FranceBB
2nd June 2021, 09:59
Does anyone here have an AVISynth "cheat sheet"? I am not looking for anything complicated,just something simple that I can use to get me started.

Avisynth Wiki - External Filters with the relative documentation: http://avisynth.nl/index.php/External_filters


My personal Avisynth Cheat Sheet to use when I'm too lazy and I just want to copy-paste: https://github.com/FranceBB/FranceBB_Sample-Avisynth-Script

kedautinh12
2nd June 2021, 11:02
Thank France

GAP
2nd June 2021, 12:10
Thanks from me too.

chmars
3rd June 2021, 06:53
Thanks
Reel.deel, I had missed the guides page. Nice.
FranceBB, these are super good starting points to experiment from a already working base and learn fast.

DTL
1st October 2021, 23:15
Are there exist any built-in or plugin way of direct samples sequence setting (in 4:4:4 and sub-sampled interleaved or planar format) from text-line (or array) defined arguments to function ?
Something like

Line(pix_fmt="YUV422P10",Y="64,64,940,940",U="512,512",V="512,512")

return clip 4*1 size (with some default fps and frame num) of the requested pix_fmt and with defined samples values ? Or may be script function ?

poisondeathray
1st October 2021, 23:31
Are there exist any built-in or plugin way of direct samples sequence setting (in 4:4:4 and sub-sampled interleaved or planar format) from text-line (or array) defined arguments to function ?
Something like

Line(pix_fmt="YUV422P10",Y="64,64,940,940",U="512,512",V="512,512")

return clip 4*1 size (with some default fps and frame num) of the requested pix_fmt and with defined samples values ? Or may be script function ?

One way is BlankClip and Expr

eg.

BlankClip(length=300, fps=24, width=4, height=1, pixel_type="YUV444P10")
Expr("64","512","512")
KillAudio()

wonkey_monkey
1st October 2021, 23:40
You can use Expr:

Blankclip(width = 4, height = 1, pixel_type="YUV422P10").Expr("
sx 0 == 64
sx 1 == 64
sx 2 == 940
940 ? ? ?
","
sx 0 == 512
512 ?
","
sx 0 == 512
512 ?
")

The "sx" lines are acting like C "case" statements, with the final line being the last/default value.

DTL
2nd October 2021, 05:08
My example was short for simplicity. I mean setting exact sequencies of samples values of longer length. For typical transient description I need to set about 8..10 Y values and 4..5 UV values. And for sustained borders I can use simple AddBorders.
For long non-fully scripting way I have a set of external simple program to wrtie UYVY set of samples and RawSource plugin. But it long way. So may be ask to add simple Debug-group function close to BlankClip but with extended color param (like array of values instead of one colour).
So currently no way to set/get samples values at given (x,y) coordinate of framebuffer ?
The hackway with StackHorizontal(BlankClip(width=2,height=1,color=2_UYVY_samples),second_blankclip_with second 2 UYVY) may not work with 10bit ? And not short form for defining string of 10 Y and 5+5 UV samples.

If even use Expr() for 4:2:2 2*1 size clips (for further hor stacking) - how to set 2 different Y values of first and second Y samples ?

poisondeathray
2nd October 2021, 05:25
So currently no way to set/get samples values at given (x,y) coordinate of framebuffer ?



Reading sample value at x,y is easier with vapoursynth editor, because it supports different pixel formats, bitdepths . You mouse over any location and it reads off x,y coordindate and corresponding Y,Cb,Cr or R,G,B value , 8,10,12,16bit, float. AVSPmod is good, but unfortunately only reads 8bit values. Even if you're not familiar with vapoursynth, you can load most avs scripts into vapoursynth and use vsedit to "see" the proper pixel values

Not sure of a good way of setting pixel values at x,y . Maybe overlay as a workaround method


The hackway with StackHorizontal(BlankClip(width=2,height=1,color=2_UYVY_samples),second_blankclip_with second 2 UYVY) may not work with 10bit ? And not short form for defining string of 10 Y and 5+5 UV samples.


"UYVY" fourcc is 8bit422, so it does not work with 10bit per channel

If you meant U, V in v210 or p210 (10bit 422 interleaved, and planar), then it will work

poisondeathray
2nd October 2021, 05:32
If even use Expr() for 4:2:2 2*1 size clips (for further hor stacking) - how to set 2 different Y values of first and second Y samples ?

Untested, but maybe perform your manipulations with grayscale planes of Y, U, V and then combineplanes . StackHorizontal for 2 Y samples

DTL
2nd October 2021, 06:20
Same question - how to set sequence of (exact and different) Y-only samples to 'grey' plane. And 10bit greatly wanted for HDR like PQ transfer.
Possibly without 'stacking' of 1*1 samples Y10 or Y16 clips. That is too long. No way with 'arrays' of new avisynth versions available ?
Can array be argument of user function ?
Can enviroment return number of members in array so may be loop of BlankClip(width=1,height=1,pix_fmt="Y10") and StackHorizontal possible to fill the line of samples of grey-plane from simple provided sequence of numbers ?

wonkey_monkey
2nd October 2021, 13:36
If even use Expr() for 4:2:2 2*1 size clips (for further hor stacking) - how to set 2 different Y values of first and second Y samples ?

See my post just before yours.

Alternatively: perhaps there is an image source filter which will read Netpbm (https://en.wikipedia.org/wiki/Netpbm) files.

DTL
2nd October 2021, 14:23
"See my post just before yours."

Oh - thank you - it really works for required 10x1 4:2:2 clip like

plY=Blankclip(width = 10, height = 1, pixel_type="Y10").Expr("sx 0 == 509 sx 1 == 509 sx 2 == 509 sx 3 == 509 sx 4 == 509 sx 5 = 498 sx 6 = 446 sx 7 == 361 sx 8 == 292 276 ? ? ? ? ? ? ? ? ?")
plU=Blankclip(width = 5, height = 1, pixel_type="Y10").Expr("sx 0 == 270 sx 1 == 263 sx 2 == 330 sx 3 == 761 754 ? ? ? ?")
plV=Blankclip(width = 5, height = 1, pixel_type="Y10").Expr("sx 0 == 203 sx 1 == 224 sx 2 == 271 sx 3 == 832 821 ? ? ? ?")
CombinePlanes(plY, plU, plV, "YUV", "YYY", pixel_type="YUV422P10")


And another question - are there ways to define >8bit YUV colour for AddBorders() ? Or only create separate 2x1 clip with same way and point-resize to required size and StackHorizontal ?

GAP
6th December 2021, 13:04
How do you merge files together in AVIsynth? And with programs like AVSPMod or MeGUI?

VoodooFX
6th December 2021, 13:22
How do you merge files together in AVIsynth? And with programs like AVSPMod or MeGUI?

a=YourPreferedSourcePlugin("D:\yourvideo1.mkv")
b=YourPreferedSourcePlugin("D:\yourvideo2.mkv")
a++b

Btw, this is wrong thread to ask questions about Avisynth:
Do NOT use this thread for discussion of specific Avisynth problems you may have. Post those in a separate thread. This thread is for suggesting new FAQs and discussing existing ones.

GAP
7th December 2021, 06:01
Oh sorry about that.

FranceBB
7th December 2021, 08:33
@VoodooFX is right, you use append, so you set your file to a variable, your other file to another variable and then you append them together with ++.
Now, here's the catch: they must be exactly the same, namely they must be with the same resolution, framerate, color sampling, bit depth and if they have audio, that should be the same too, like, you cannot append a clip with audio to another which doesn't have it.
Of course, as a user and encoder writing a script, it's your duty to make sure those match, hence performing conversions. ;)

VoodooFX
6th May 2022, 17:01
This thread is about wiki:

Do NOT use this thread for discussion of specific Avisynth problems you may have. Post those in a separate thread. This thread is for suggesting new FAQs and discussing existing ones.

GAP
22nd September 2022, 04:21
How do you update AVISynth and/or AVISynth +? How to you know when you need to update it?

kedautinh12
22nd September 2022, 04:57
How do you update AVISynth and/or AVISynth +? How to you know when you need to update it?

Latest ver here:
https://gitlab.com/uvz/AviSynthPlus-Builds

FranceBB
3rd October 2022, 16:24
Just FYI, I raised an issue here https://github.com/AviSynth/AviSynthPlus/issues/302 'cause apparently WAVSource() cannot index files larger than 4 GB and that affected my supply chain... :(

LeXXuz
14th October 2022, 10:27
I have trouble on my Windows 11 machine with the default plugin folders of Avisynth+. It seems they don't get recognized and the plugins stored in
"C:\Program Files (x86)\AviSynth+\plugins64+" f.e. do not get auto-loaded. How can I fix that? Re-install of Avisynth+ did not help.
Right now I have to import all my filters manually from that folder which is a little annoying.

kedautinh12
14th October 2022, 10:30
I have trouble on my Windows 11 machine with the default plugin folders of Avisynth+. It seems they don't get recognized and the plugins stored in
"C:\Program Files (x86)\AviSynth+\plugins64+" f.e. do not get auto-loaded. How can I fix that? Re-install of Avisynth+ did not help.
Right now I have to import all my filters manually from that folder which is a little annoying.

Strange, my Windows is win 11 too and didn't got that problem

FranceBB
14th October 2022, 11:23
Mine didn't get that problem either. They were loaded automatically just fine, as they should.
Could it be some permission issues about the Program Files folder? Or perhaps Windows Defender blocking it? Dunno. It works on my end, I cannot reproduce it.

LeXXuz
14th October 2022, 12:37
Folder permissions seem fine. Maybe something wrong with the path variables if Avisynth uses any.

EDIT: Found it. The plugin folder was not set correctly within the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth. No idea why.

LeXXuz
6th December 2022, 16:06
Probably a pretty silly question but how do I perform a simple exponential math function in Avisynth? Something like x=2^n for example. :o

poisondeathray
6th December 2022, 16:14
Probably a pretty silly question but how do I perform a simple exponential math function in Avisynth? Something like x=2^n for example. :o


One way is expr
http://avisynth.nl/index.php/Expr

e.g. In a YUV clip change all values in Y channel to power of 2 , copy Cb, Cr
expr("x 2 ^", "x", "x")

kedautinh12
6th December 2022, 16:14
x = pow(2,n) (maybe) :D

Emulgator
7th December 2022, 00:36
EDIT: Found it. The plugin folder was not set correctly within the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Avisynth. No idea why.
A remote guess because sometimes my portable AviSynth installs (Groucho Style) got overridden the same way
(just happened recently with RipBot 1.26.3):
Do you have other GUIs like RipBot or StaxRip installed?
I found that RipBot auto-updating forces its own AviSnth preferences.
IIRC StaxRip did that too on me once, but I am not so sure anymore...

wonkey_monkey
7th December 2022, 01:15
I feel like I'm missing something obvious, but how do I convert from RGB32 to YUVA444? There is ConverttoYUV444 but there is no ConverttoYUVA444.

Edit: seems you have to ConverttoPlanarRGBA first, then ConverttoYUV444 will retain Alpha. Seems a bit of an oversight to me. Or maybe it's backwards compatability.

qyot27
7th December 2022, 03:49
I feel like I'm missing something obvious, but how do I convert from RGB32 to YUVA444? There is ConverttoYUV444 but there is no ConverttoYUVA444.

Edit: seems you have to ConverttoPlanarRGBA first, then ConverttoYUV444 will retain Alpha. Seems a bit of an oversight to me. Or maybe it's backwards compatability.

https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/mask.html#addalphaplane

ConvertToYUV444()
AddAlphaPlane()

wonkey_monkey
7th December 2022, 12:00
The plan was to keep the alpha channel that already existed in the RGB32 clip.

qyot27
8th December 2022, 00:08
Ah, I was probably half-asleep when I read that initially, but it certainly is a little inconsistent. Anyway, issue created on Github so it won't get buried.

StainlessS
8th December 2022, 01:14
Thanx Qyot27,
Whata wonderfull fella.

( Chill a bit, sir ) that wonkey fella is a bit messed up, try not to take notice. (Sorry Wonkey :) )

pinterf
8th December 2022, 10:56
I feel like I'm missing something obvious, but how do I convert from RGB32 to YUVA444? There is ConverttoYUV444 but there is no ConverttoYUVA444.

Edit: seems you have to ConverttoPlanarRGBA first, then ConverttoYUV444 will retain Alpha. Seems a bit of an oversight to me. Or maybe it's backwards compatability.
I guess I made the following considerations:
- ConvertToYUV444 is the generalization of ConvertToYV24
- Applying ConvertToYUV444 on old formats such as RGB32 must preserve the original behaviour and result in YV24 (YUV444P8) and not YUVA444P8

GAP
13th December 2022, 15:25
Can anyone give a step by step guide to resizing in AVISynth? I will admit that I am still new to this and I am asking becuase I was recommened to deep resize on another thread (https://forum.doom9.org/showthread.php?t=184610).

FranceBB
13th December 2022, 19:39
What do you wanna know? Which kernel is good and which ones should be avoided? The resampling page in the Avisynth wiki does a pretty good job.
As a rule of thumb, however, you can use SinPowResizeMT() to downscale and either Spline64Resize or NNEDI3 to upscale.

GAP
18th December 2022, 21:59
What do you wanna know? Which kernel is good and which ones should be avoided? The resampling page in the Avisynth wiki does a pretty good job.
As a rule of thumb, however, you can use SinPowResizeMT() to downscale and either Spline64Resize or NNEDI3 to upscale.

I want to know how I can upscale my footage for pixel game captures. Here is what I posted on my thread:

Can anyone talk a look at this script? I am to make this setup into a FFMPEG script and even an AVISynth/AVS script. Here is what I am trying to do:


Using Virtualdub I was going to do two resizes using Nearest Neighbor and later Lanzcos3. The Nearest Neighbor resize filter was going to upscale the video while the other filter was for aspect ratio correction via "Compute Height from Ratio" on Lanzcos3. I know you do not have to do this in FFMPEG or AVISynth but you could in Virtualdub2.
I was to resize it to four times bigger than usual since that is considered HD and I do not want it to be bigger than what it can allowed to be.
I was put in a .mp4 video container with .aac as the audio container. Someone recommended me libopus as a possible audio codec but I want to play it safe with .aac.
As for codecs and compression, I mostly use x264 8 bit with a Slower compression with the constant rate factor being either 16 or lossless.
I wanted colorspace from RGB to YUV. I mostly work with pixels from old video games.


I was wondering how can I do so with this FFMPEG script? Do these options that I have about match what I want do? And if possible, how can export it to AVISynth or AVS.

I also wanted to add in a fade in or fade out as I want to prevent the clip from going past a certain time.

FranceBB
22nd December 2022, 20:49
I want to know how I can upscale my footage for pixel game captures.


Fine.


Using Virtualdub I was going to do two resizes using Nearest Neighbor and later Lanzcos3.


No one should be masochist enough to be using PointResize() on his own free will for things that will be used for real.


There are several resizing kernels nowadays, but the most known are:​

- PointResize() -> Nearest Neighbour​

- BilinearResize() -> Bilinear filtering​

- BicubicResize() -> Mitchell-Netravali two-part cubic filtering​

- LanczosResize() -> Two lobes Lanczos windowed sinc function (4 lobes, 2 on each side)​

- BlackmanResize() -> A modified version of Lanczos with better ringing control (higher taps)​

- GaussResize() -> Gaussian filter; unlike bicubic, it does not overshoot, but it's less sharp​

- SincResize() -> Truncated Sinc Function; very sharp but pronte to ringing artifacts​

- Spline16Resize() -> Cubic Spline Based resizer that fit a spline through √16 sample points​

- Spline36Resize() -> Cubic Spline Based resizer that fit a spline through √36 sample points​

- Spline64Resize() -> Cubic Spline Based resizer that fit a spline through √64 sample points​

We're gonna talk about NNEDI3 (Neural Network Edge Directed Interpolation 3) later.


The most basic Algorithm -> PointResize()​

PointResize is a nearest neighbour algorithm which performs interpolation between points.​



Interpolation is the problem of approximating the value of a function for a non-given point in some space when given the value of that function in points around (neighboring) that point. The nearest neighbor algorithm selects the value of the nearest point and does not consider the values of neighboring points at all, yielding a piecewise-constant interpolant.​



Suppose we have a grid with pictures that have 8bit values like so:​


https://i.imgur.com/XOb9E9A.png
https://i.imgur.com/GiqNb7f.png


Let's move to Bilinear:​


Bilinear interpolation is performed using linear interpolation first in one direction, and then again in the other direction. Although each step is linear in the sampled values and in the position, the interpolation as a whole is not "linear" but rather "quadratic" in the sample location.​


https://i.imgur.com/Z3ugGYB.png
https://i.imgur.com/M5JTvNM.png

Let's move to Spline based resizing:​



Spline16Resize, Spline36Resize and Spline64Resize are three Spline based resizers. They are the cubic spline based resizers from Panorama tools that fit a spline through the sample points and then derives the filter kernel from the resulting blending polynomials. The rationale for Spline is to be as sharp as possible with less ringing artifacts than LanczosResize produces. Spline16Resize uses √16 or 4 sample points, Spline36Resize uses √36 or 6 sample points. The more sample points used, the more accurate the resampling.​

Very loosely and poorly made graphs but that should give you an idea:

https://i.imgur.com/EqdEEBO.png


Now a few comparisons:

https://i.imgur.com/1Xp1Xqz.png
https://i.imgur.com/uTeuXjY.png
https://i.imgur.com/mNdop9A.png
https://i.imgur.com/OU4W4At.png
https://i.imgur.com/4nu6CXg.png



What you should learn from this is:

1) DO NOT use PointResize()
2) It's 2022, use NNEDI3 to upscale or at the very least Spline64Resize()
3) If you want to add black borders to keep aspect ratio, use AddBorders() manually or use ResizeKAR() or FrostyBorders() with frosty = false to do it for you automagically.


Cheers,
Frank

LeXXuz
23rd December 2022, 16:50
Very nice and comprehensive explanation.
I'd like to say thank you for taking the time to put this up. :thanks:

DTL
24th December 2022, 23:44
Pixel-based (may be better pixel-art based) old game may be designed to be rendered as really square pixels. Also it may not contain any real number measured shifts or scaling or other transforms - only integer shifts. So only PointResize with integer ratio (2x,3x,...)is applicable to fit higher resolution screens. Different digital imaging methods of encode images require different visualization and different scaling.

LeXXuz
10th January 2023, 18:47
Simple question regarding Avisynth syntax.

In many scripts I see a decimal point behind numbers in operations. For example: x=(y/2.)

Is this to make the output (x) a float instead of an (depending on y maybe rounded) integer? Or what purpose does this decimal point have?

Boulder
10th January 2023, 18:55
Simple question regarding Avisynth syntax.

In many scripts I see a decimal point behind numbers in operations. For example: x=(y/2.)

Is this to make the output (x) a float instead of an (depending on y maybe rounded) integer? Or what purpose does this decimal point have?

Yes, that's it. Avisynth won't do the conversion if the variables are integers even if the result was a float. For example with BicubicResize, you need b=1/3., c=1/3. (or 1./3) to get the desired values there.

LeXXuz
10th January 2023, 20:06
Thanks for confirming. :thanks:

StainlessS
16th January 2023, 23:42
Also note, a function with a Float arg will accept an int [v2.60+, converted to type float inside the function],
but a function with a type Int arg will NOT accept a float.

A type float arg specifier basically means 'numeric' whereas type Int is strictly int.

LeXXuz
17th January 2023, 19:57
Thanks StainlessS. Appreciate your input. :)

GAP
18th January 2023, 13:22
Edit: Nevermind, Disregard that qusstion as it turned out that Avisynth + and Avisynth wer ein conflict with each other. I was using AVSPmod and it does not detect AVISynth +. My next questions are: How do I make AVSPMod use AVISynth +? And can AVSPmod be a substitute for Virtualdub2? I used the Universal Installer but I installed the latest version of AVISynth + but I am afraid to use it.

Emulgator
18th January 2023, 23:26
Modify the Universal Groucho setavs.cmd to

::Batch script for fast switching of Avisynth versions
::Initial idea and work by Groucho2004
::Modified by jones1913
::Modified and extended by Groucho2004
::Updated for AVSPLUS373 folders by Emulgator

@echo off
cls
setlocal

:Check administrative privileges
fsutil dirty query %systemdrive% > nul
if errorlevel 1 goto :noAdmin


:: ########################## Start Configuration #########################

:: The variable "AVS_SRC_DIR" must be set according to the location of
:: this batch file.

:: The simplest way to have this up and running is to copy the "AvisynthRepository"
:: directory to a location of your choice (avoid "Program Files" or "Program Files (x86)")
:: and create a shortcut to the "setavs.cmd" batch file in the root of "AvisynthRepository".

:: If you want to run the batch file from a different directory
:: (i.e. a directory to which the "PATH" environment variable points),
:: remove the "%~dp0" and use a fully qualified path to the source directory.
:: Example: "set AVS_SRC_DIR=E:\VideoTools\AvisynthRepository"
set AVS_SRC_DIR=%~dp0


:: Default plugin directories
:: If you leave them blank, the respective "plugin" directories within
:: the "AvisynthRepository" source directories will be used.
set PLUGDIR32=
set PLUGDIR64=


:: Additional plugin directories (works only with Avisynth+)
:: If you leave them blank, only the default plugin directories (see above)
:: will be used.
set PLUGDIR32PLUS=
set PLUGDIR64PLUS=


:: **IMPORTANT:
:: If you have customized any of the above directories and their names contain
:: special characters such as '&', '(' or ')', enclose the variable and path
:: in double quotes and use the escape character '^' before the special character(s).
::
:: Example 1:
:: set "AVS_SRC_DIR=C:\Program Files ^(x86^)\Avisynth"
::
:: Example 2:
:: set "PLUGDIR32=C:\Program Files ^(x86^)\Avisynth\Plugins ^& avsi"


:: ########################### End Configuration ##########################



if "%AVS_SRC_DIR%" == "" (
echo.
echo The source directory ^(AVS_SRC_DIR^) is not defined.
echo Please read the instructions above.
echo.
goto :end
)

if /i %PROCESSOR_ARCHITECTURE%==x86 if not defined PROCESSOR_ARCHITEW6432 set winarch=x32

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

echo.
echo Installed Avisynth version(s):
echo.
if defined winarch (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
) else (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
echo.
"%AVS_SRC_DIR%\Tools\AVSVersion64.exe"
)
echo.

echo.
echo Select the Avisynth version you want to install/uninstall:
echo.
echo 1 = Avisynth 2.5.8
echo 2 = Avisynth 2.6.0
echo 3 = Avisynth 2.6.1 (Alpha)
echo 4 = Avisynth 2.6.0 (SEt's multi-threaded build)
echo.

echo 5 = Avisynth+ 0.1.0 (x86, r2772)
echo 6 = Avisynth+ 0.1.0 (x64, r2772)
echo 7 = Avisynth+ XP 3.7.0 (x86, r3382)
echo 8 = Avisynth+ XP 3.7.0 (x64, r3382)
echo 9 = Avisynth+ 3.7.3 (x86, r3825)
echo 10 = Avisynth+ 3.7.3 (x64, r3825)

echo.
echo 13 = Uninstall Avisynth x86
echo 14 = Uninstall Avisynth x64
echo.
echo NOTE: 64 bit versions can be installed alongside 32 bit versions.
echo.
echo.
set no=
set /p no= [1-12] (leave blank and [Enter] to exit):
if [%no%]==[] goto :cancel


if %no%==1 set avs=AVS258
if %no%==2 set avs=AVS260
if %no%==3 set avs=AVS261_Alpha
if %no%==4 set avs=AVS260_MT

if %no%==5 (set avs=AVSPLUS010_x86) & set avspl=true
if %no%==6 (set avs=AVSPLUS010_x64) & set avspl=true
if %no%==7 (set avs=AVSPLUS370_x86_XP) & set avspl=true
if %no%==8 (set avs=AVSPLUS370_x64_XP) & set avspl=true
if %no%==9 (set avs=AVSPLUS373_x86) & set avspl=true
if %no%==10 (set avs=AVSPLUS373_x64) & set avspl=true


if %no%==13 (set avs=AVSx86) & goto :uninstall
if %no%==14 (set avs=AVSx64) & goto :uninstall
echo.
if [%avs%]==[] (echo Invalid input...
goto :menu)

if %avs%==AVSPLUS010_x64 set x64=true
if %avs%==AVSPLUS370_x64 set x64=true
if %avs%==AVSPLUS370_x64_XP set x64=true
if %avs%==AVSPLUS373_x64 set x64=true

:install

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

if "%PLUGDIR32%" == "" (
set REGPLUGDIR32=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32=%PLUGDIR32%
)

if "%PLUGDIR64%" == "" (
set REGPLUGDIR64=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64=%PLUGDIR64%
)

if "%PLUGDIR32PLUS%" == "" (
set REGPLUGDIR32PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32PLUS=%PLUGDIR32PLUS%
)

if "%PLUGDIR64PLUS%" == "" (
set REGPLUGDIR64PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64PLUS=%PLUGDIR64PLUS%
)

:: Remove trailing backslash if present
if "%REGPLUGDIR32PLUS:~-1%"=="\" SET REGPLUGDIR32PLUS=%REGPLUGDIR32PLUS:~0,-1%
if "%REGPLUGDIR64PLUS:~-1%"=="\" SET REGPLUGDIR64PLUS=%REGPLUGDIR64PLUS:~0,-1%
if "%REGPLUGDIR32:~-1%"=="\" SET REGPLUGDIR32=%REGPLUGDIR32:~0,-1%
if "%REGPLUGDIR64:~-1%"=="\" SET REGPLUGDIR64=%REGPLUGDIR64:~0,-1%

echo Installing %avs%...
echo.
if defined winarch (
echo setup for 32bit windows system...
echo.

if defined x64 ( echo Attempt to install x64 AVS on x32 Windows.
goto :cancel )

echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo setup for 64bit windows system...
echo.
if defined x64 (
echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR64PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\SysWow64"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWow64
)
)
goto :end

:regWin
echo.
echo adding more registry entries...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f
goto :eof

:regWow64
echo.
echo adding more registry entries (wow64 mode)...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f
goto :eof

:uninstall
echo.
echo Remove %avs% .dll and registry entries from this system?
set /p rm=[y/n]:
if /i not [%rm%]==[y] goto :cancel
echo.
if defined winarch (
if /i %avs%==AVSx64 ( echo Attempt to remove x64 AVS from x32 Windows.
goto :cancel )
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\avisynth.dll"
del "%WINDIR%\System32\devil.dll"
call :unregWin all
) else (
if /i %avs%==AVSx64 (
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\devil.dll"
del "%WINDIR%\System32\avisynth.dll"
if exist "%WINDIR%\SysWow64\avisynth.dll" (call :unregWin) else (
call :unregWin all )
) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"
if exist "%WINDIR%\System32\avisynth.dll" (call :unregWow64) else (
call :unregWow64 all )
)
)
goto :end

:unregWin
echo.
echo removing registry entries...
reg delete "HKLM\SOFTWARE\Avisynth" /f
reg delete "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregWow64
echo.
echo removing registry entries (wow64 mode)...
reg delete "HKLM\SOFTWARE\Wow6432Node\Avisynth" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregAll
echo.
echo removing more avs registry entries...
reg delete "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /f
reg delete "HKLM\SOFTWARE\Classes\.avs" /f
reg delete "HKLM\SOFTWARE\Classes\.avsi" /f
reg delete "HKLM\SOFTWARE\Classes\avsfile" /f
reg delete "HKLM\SOFTWARE\Classes\avs_auto_file" /f
goto :eof

:noAdmin
echo This batch file must run with elevated privileges, so:
echo.
echo Right click on it and chose "Run as administrator"
goto :end

:error
echo.
echo something went wrong...
echo.

:cancel
echo.
echo cancelled...
echo.

:end
endlocal
echo.
pause

Fjord
20th January 2023, 08:03
Is there a filter/function/script in Avisynth that will take the average of an entire clip? That is, to create a single frame from a clip, where each pixel in the result frame is the average of all pixels in that position in the clip. The result could be a clip containing 1 frame (ie 32-bit float), or to write the result to a file, fx TIFF in 32-bit float format?

I am only aware of temporal filters that return the average of 3 to 7 frames at a time, for each frame in a clip (TemporalDegrain(), MedianBlurTemporal(), ex_median(), etc.).

The next question will be if this can be done with other statistics, for example maximum, minimum, median?

My objective for this is to create a single-frame mask for a clip that isolates specific areas according to the statistic - for example the areas of an image that are consistently dark for the whole scene. (assuming the clip contains a single scene)

Reel.Deel
20th January 2023, 08:09
Is there a filter/function/script in Avisynth that will take the average of an entire clip?

ClipBlend (http://avisynth.nl/index.php/ClipBlend):
#Or to get a single frame average of all frames in a clip:
AviSource("blah.avi")
ClipBlend()
Trim(FrameCount-1,-1)

Float is not supported only 8-bit and 16-bit stacked.

Fjord
20th January 2023, 09:04
Thanks @Reel.Deel. Spot on! :)

Given that I have 10-bit source (YUV442P10), I assume I should use source.ConvertToStacked() (https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/convertstacked.html#converttostacked) as input to ClipBlend16(), to use all 10 bits in the process (assuming no overflow in the accumulator). Do I need to convert to YUV444P16 first?

I'll add my vote for HBD support for ClipBlend (https://forum.doom9.org/showthread.php?p=1971225#post1971225), and option for running maximum or minimum. Internal 64-bit float accumulator would also be nice. :D

FranceBB
20th January 2023, 09:11
Thanks @Reel.Deel. Spot on! :)

Given that I have 10-bit source (YUV442P10), I assume I should use source.ConvertToStacked() (https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/convertstacked.html#converttostacked) as input to ClipBlend16()

Almost, you need ConvertBits(16) first 'cause ConverttoStacked() only accepts 16bit planar as input as it will divide it in 8bit MSB and 8bit LSB.
Using the Reel.Deel example, in your case it would be like:


#Indexing the 10bit planar source
LWLibavVideoSource("whatever.mov")

#Going to 16bit planar
ConvertBits(16)

#Go to 16bit stacked (MSB and LSB)
ConverttoStacked()

#Work with 16bit stacked precision
ClipBlend16()

#Go back to 16bit planar
ConvertFromStacked()

#Final result with 16bit planar precision
Trim(FrameCount-1,-1)




I'll add my vote for HBD support for ClipBlend (https://forum.doom9.org/showthread.php?p=1971225#post1971225)

Just in case, if/when they'll add 16bit planar support, make sure not to remove 16bit stacked support in the meantime as otherwise it won't be possible for legacy Avisynth versions like 2.6.1 to work in high bit depth and also filters that might depend on it.


Cheers,
Frank

Fjord
20th January 2023, 09:26
Thanks Frank! :) Got it.

Reel.Deel
20th January 2023, 09:54
I'll add my vote for HBD support for ClipBlend (https://forum.doom9.org/showthread.php?p=1971225#post1971225), and option for running maximum or minimum. Internal 64-bit float accumulator would also be nice. :D

Maybe StainlessS will see this. I've been on the his waiting list for almost 2 yearssS :p

If you need 32-bit you can do it with expr but you will have to modify the AvgAll_16 script (https://forum.doom9.org/showthread.php?p=1579509#post1579509).

kedautinh12
20th January 2023, 10:18
Waiting for Staindroid :D

Dogway
20th January 2023, 18:31
Is there a filter/function/script in Avisynth that will take the average of an entire clip?
...
The next question will be if this can be done with other statistics, for example maximum, minimum, median?

That's basically the purpose of SceneStats (https://github.com/Dogway/Avisynth-Scripts/blob/master/ScenesPack.avsi). Generally it's for scenes, but you can also run ClipStats to get global statistics (min, max, median, mean, etc). ClipStats usually hangs AVS+ though (AvsPmod maybe?).

GAP
29th January 2023, 18:51
Modify the Universal Groucho setavs.cmd to

::Batch script for fast switching of Avisynth versions
::Initial idea and work by Groucho2004
::Modified by jones1913
::Modified and extended by Groucho2004
::Updated for AVSPLUS373 folders by Emulgator

@echo off
cls
setlocal

:Check administrative privileges
fsutil dirty query %systemdrive% > nul
if errorlevel 1 goto :noAdmin


:: ########################## Start Configuration #########################

:: The variable "AVS_SRC_DIR" must be set according to the location of
:: this batch file.

:: The simplest way to have this up and running is to copy the "AvisynthRepository"
:: directory to a location of your choice (avoid "Program Files" or "Program Files (x86)")
:: and create a shortcut to the "setavs.cmd" batch file in the root of "AvisynthRepository".

:: If you want to run the batch file from a different directory
:: (i.e. a directory to which the "PATH" environment variable points),
:: remove the "%~dp0" and use a fully qualified path to the source directory.
:: Example: "set AVS_SRC_DIR=E:\VideoTools\AvisynthRepository"
set AVS_SRC_DIR=%~dp0


:: Default plugin directories
:: If you leave them blank, the respective "plugin" directories within
:: the "AvisynthRepository" source directories will be used.
set PLUGDIR32=
set PLUGDIR64=


:: Additional plugin directories (works only with Avisynth+)
:: If you leave them blank, only the default plugin directories (see above)
:: will be used.
set PLUGDIR32PLUS=
set PLUGDIR64PLUS=


:: **IMPORTANT:
:: If you have customized any of the above directories and their names contain
:: special characters such as '&', '(' or ')', enclose the variable and path
:: in double quotes and use the escape character '^' before the special character(s).
::
:: Example 1:
:: set "AVS_SRC_DIR=C:\Program Files ^(x86^)\Avisynth"
::
:: Example 2:
:: set "PLUGDIR32=C:\Program Files ^(x86^)\Avisynth\Plugins ^& avsi"


:: ########################### End Configuration ##########################



if "%AVS_SRC_DIR%" == "" (
echo.
echo The source directory ^(AVS_SRC_DIR^) is not defined.
echo Please read the instructions above.
echo.
goto :end
)

if /i %PROCESSOR_ARCHITECTURE%==x86 if not defined PROCESSOR_ARCHITEW6432 set winarch=x32

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

echo.
echo Installed Avisynth version(s):
echo.
if defined winarch (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
) else (
"%AVS_SRC_DIR%\Tools\AVSVersion32.exe"
echo.
"%AVS_SRC_DIR%\Tools\AVSVersion64.exe"
)
echo.

echo.
echo Select the Avisynth version you want to install/uninstall:
echo.
echo 1 = Avisynth 2.5.8
echo 2 = Avisynth 2.6.0
echo 3 = Avisynth 2.6.1 (Alpha)
echo 4 = Avisynth 2.6.0 (SEt's multi-threaded build)
echo.

echo 5 = Avisynth+ 0.1.0 (x86, r2772)
echo 6 = Avisynth+ 0.1.0 (x64, r2772)
echo 7 = Avisynth+ XP 3.7.0 (x86, r3382)
echo 8 = Avisynth+ XP 3.7.0 (x64, r3382)
echo 9 = Avisynth+ 3.7.3 (x86, r3825)
echo 10 = Avisynth+ 3.7.3 (x64, r3825)

echo.
echo 13 = Uninstall Avisynth x86
echo 14 = Uninstall Avisynth x64
echo.
echo NOTE: 64 bit versions can be installed alongside 32 bit versions.
echo.
echo.
set no=
set /p no= [1-12] (leave blank and [Enter] to exit):
if [%no%]==[] goto :cancel


if %no%==1 set avs=AVS258
if %no%==2 set avs=AVS260
if %no%==3 set avs=AVS261_Alpha
if %no%==4 set avs=AVS260_MT

if %no%==5 (set avs=AVSPLUS010_x86) & set avspl=true
if %no%==6 (set avs=AVSPLUS010_x64) & set avspl=true
if %no%==7 (set avs=AVSPLUS370_x86_XP) & set avspl=true
if %no%==8 (set avs=AVSPLUS370_x64_XP) & set avspl=true
if %no%==9 (set avs=AVSPLUS373_x86) & set avspl=true
if %no%==10 (set avs=AVSPLUS373_x64) & set avspl=true


if %no%==13 (set avs=AVSx86) & goto :uninstall
if %no%==14 (set avs=AVSx64) & goto :uninstall
echo.
if [%avs%]==[] (echo Invalid input...
goto :menu)

if %avs%==AVSPLUS010_x64 set x64=true
if %avs%==AVSPLUS370_x64 set x64=true
if %avs%==AVSPLUS370_x64_XP set x64=true
if %avs%==AVSPLUS373_x64 set x64=true

:install

:: Remove trailing backslash if present
if "%AVS_SRC_DIR:~-1%"=="\" SET AVS_SRC_DIR=%AVS_SRC_DIR:~0,-1%

if "%PLUGDIR32%" == "" (
set REGPLUGDIR32=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32=%PLUGDIR32%
)

if "%PLUGDIR64%" == "" (
set REGPLUGDIR64=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64=%PLUGDIR64%
)

if "%PLUGDIR32PLUS%" == "" (
set REGPLUGDIR32PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR32PLUS=%PLUGDIR32PLUS%
)

if "%PLUGDIR64PLUS%" == "" (
set REGPLUGDIR64PLUS=%AVS_SRC_DIR%\%avs%\plugins
) else (
set REGPLUGDIR64PLUS=%PLUGDIR64PLUS%
)

:: Remove trailing backslash if present
if "%REGPLUGDIR32PLUS:~-1%"=="\" SET REGPLUGDIR32PLUS=%REGPLUGDIR32PLUS:~0,-1%
if "%REGPLUGDIR64PLUS:~-1%"=="\" SET REGPLUGDIR64PLUS=%REGPLUGDIR64PLUS:~0,-1%
if "%REGPLUGDIR32:~-1%"=="\" SET REGPLUGDIR32=%REGPLUGDIR32:~0,-1%
if "%REGPLUGDIR64:~-1%"=="\" SET REGPLUGDIR64=%REGPLUGDIR64:~0,-1%

echo Installing %avs%...
echo.
if defined winarch (
echo setup for 32bit windows system...
echo.

if defined x64 ( echo Attempt to install x64 AVS on x32 Windows.
goto :cancel )

echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo setup for 64bit windows system...
echo.
if defined x64 (
echo copying %avs% files to "%WINDIR%\System32"...
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\System32"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\System32"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\System32"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR64%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR64PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%"
reg add "HKLM\SOFTWARE\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR64PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWin
) else (
echo copying %avs% files to "%WINDIR%\SysWow64"...
echo copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\avisynth.dll" "%WINDIR%\SysWow64"
copy /y "%AVS_SRC_DIR%\%avs%\devil.dll" "%WINDIR%\SysWow64"
if errorlevel 1 ( echo Failed to copy files to "%WINDIR%\SysWow64"
goto :error )
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "" /d "%AVS_SRC_DIR%\%avs%" /f
echo.

echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir2_5" /d "%REGPLUGDIR32%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )

if "%REGPLUGDIR32PLUS%" GTR "" (
echo.
echo Writing "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%"
reg add "HKLM\SOFTWARE\Wow6432Node\Avisynth" /v "PluginDir+" /d "%REGPLUGDIR32PLUS%" /f
if errorlevel 1 ( echo Error on importing registry keys!
goto :error )
)

call :regWow64
)
)
goto :end

:regWin
echo.
echo adding more registry entries...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\System32\AviSynth.dll,0" /f
goto :eof

:regWow64
echo.
echo adding more registry entries (wow64 mode)...
reg add "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /ve /d "{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /ve /d "AviSynth" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /ve /d "AviSynth.dll" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}\InProcServer32" /v "ThreadingModel" /d "Apartment" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /v "Source Filter" /d "{D3588AB0-0781-11CE-B03A-0020AF0BA770}" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avs" /ve /d "avsfile" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\.avsi" /ve /d "avs_auto_file" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile" /ve /d "AviSynth Script" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avsfile\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f >nul 2>&1
reg add "HKLM\SOFTWARE\Classes\avs_auto_file" /ve /d "AviSynth Autoload Script" /f >nul 2>&1
if defined avspl (reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,1" /f
) else reg add "HKLM\SOFTWARE\Classes\avs_auto_file\DefaultIcon" /ve /d "%WINDIR%\SysWow64\AviSynth.dll,0" /f
goto :eof

:uninstall
echo.
echo Remove %avs% .dll and registry entries from this system?
set /p rm=[y/n]:
if /i not [%rm%]==[y] goto :cancel
echo.
if defined winarch (
if /i %avs%==AVSx64 ( echo Attempt to remove x64 AVS from x32 Windows.
goto :cancel )
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\avisynth.dll"
del "%WINDIR%\System32\devil.dll"
call :unregWin all
) else (
if /i %avs%==AVSx64 (
echo removing %avs% files from "%WINDIR%\System32"...
del "%WINDIR%\System32\devil.dll"
del "%WINDIR%\System32\avisynth.dll"
if exist "%WINDIR%\SysWow64\avisynth.dll" (call :unregWin) else (
call :unregWin all )
) else (
echo removing %avs% files from "%WINDIR%\SysWow64"...
del "%WINDIR%\SysWow64\avisynth.dll"
del "%WINDIR%\SysWow64\devil.dll"
if exist "%WINDIR%\System32\avisynth.dll" (call :unregWow64) else (
call :unregWow64 all )
)
)
goto :end

:unregWin
echo.
echo removing registry entries...
reg delete "HKLM\SOFTWARE\Avisynth" /f
reg delete "HKLM\SOFTWARE\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregWow64
echo.
echo removing registry entries (wow64 mode)...
reg delete "HKLM\SOFTWARE\Wow6432Node\Avisynth" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{E6D6B700-124D-11D4-86F3-DB80AFD98778}" /f
reg delete "HKLM\SOFTWARE\Wow6432Node\Classes\Media Type\Extensions\.avs" /f
if [%1]==[all] call :unregAll
goto :eof

:unregAll
echo.
echo removing more avs registry entries...
reg delete "HKLM\SOFTWARE\Classes\AVIFile\Extensions\AVS" /f
reg delete "HKLM\SOFTWARE\Classes\.avs" /f
reg delete "HKLM\SOFTWARE\Classes\.avsi" /f
reg delete "HKLM\SOFTWARE\Classes\avsfile" /f
reg delete "HKLM\SOFTWARE\Classes\avs_auto_file" /f
goto :eof

:noAdmin
echo This batch file must run with elevated privileges, so:
echo.
echo Right click on it and chose "Run as administrator"
goto :end

:error
echo.
echo something went wrong...
echo.

:cancel
echo.
echo cancelled...
echo.

:end
endlocal
echo.
pause


Do you change the name of the folders as well?

Emulgator
29th January 2023, 19:43
Yes, you would match these folder names as given in script.
Or choose your own folder names and match script.

LeXXuz
10th March 2023, 14:14
I have another syntax question.

Is there any difference between these 3 script snips:

1)

PRE1=filter1()
PRE2=filter2(PRE1)
filter3(PRE2)

2)
filter1().filter2().filter3()

3)
filter1()
filter2()
filter3()

If so, I'd appreciate a thorough explanation.
It would help me to understand some of the more advanced scripts any better. :o

DTL
10th March 2023, 17:35
With 1) you keep 'last' unchanged untill 3rd line.

3) overwrite 'last' in each line.

LeXXuz
10th March 2023, 23:20
With 1) you keep 'last' unchanged untill 3rd line.

3) overwrite 'last' in each line.

I see. So, if I'm only interested in what happens at the very end of those scripts after the last line, the output of all 3 is equivalent?

VoodooFX
10th March 2023, 23:47
With 1) you keep 'last' unchanged untill 3rd line.

3) overwrite 'last' in each line.

I think there are other unseen "differences", like in caching behavior.

Anyway, why this thread is treated like "Ask any question about AvS" thread, when it's about AvS wiki?

LeXXuz
11th March 2023, 00:31
Anyway, why this thread is treated like "Ask any question about AvS" thread, when it's about AvS wiki?

My apologies. I misunderstood this thread. Will post questions about AVS somewhere else in future. :o

Jawed
17th February 2025, 02:54
Avisynth.org links in this post go to a host page, i.e. are no longer valid. Shouldn't they be fixed?

Emulgator
17th February 2025, 12:51
You may want to PM Wlbert https://forum.doom9.org/member.php?u=2705

szabi
11th September 2025, 18:35
I have multiple video in one avs and lots of trim.
I would like to identify which scene belongs to which video.
Is tere any syntax to display source's filmename?

VoodooFX
11th September 2025, 19:19
I have multiple video in one avs and lots of trim.
I would like to identify which scene belongs to which video.
Is tere any syntax to display source's filmename?

Do NOT use this thread for discussion of specific Avisynth problems you may have. Post those in a separate thread. This thread is for suggesting new FAQs and discussing existing ones.