Example Scripts Index
This is a collection of example scripts that demonstrate real use-cases of the AVSLib's library components. They serve as an additional to what is inside the filters' and functions' documentation example of the ways AVSLib can enhance Avisynth scripts either as a syntactic sugar (ie less coding) or as the workhorse to do the bulk of the job.
Note: In order to run the examples you will generally have to:
i) substitute the source video clips with your own compatible sources (this will require
renaming clip's filenames inside the scripts' texts),
ii) recreate the needed utility files such as images and text streams (for example: unpack zip
archives, remove extensions added to ease web distribution of batch files, etc.).
This example script loads a bunch of clips and then stacks them in a 2D matrix in just a single line of code. A variation of the script that can handle arbitrary numbers of sequentially numbered clips is provided also.
This example script applies a vertical in-to-out swap transition between a still photo and a clip.
3. Create a simple movie intro clip
This example script creates a simple movie intro clip containing a group of subtitles that appear in consecutive frames. The intro clip is then joined with the main clip.
4. Make a palette clip with all Avisynth named colors
This example script creates a color palette (ie a 2D matrix with colored rectangles) from all Avisynth's named colors.
5. Load arbitrary clips and stack them in a matrix
This example script loads clips supplied in an external text file and then applies the Stack filter to them.
In addition, shell scripts to automate the creation of the text file as well as the rendering of the .avs script are provided, giving the ability to execute a defined clip processing as a single shell command.
6. Create an enhanced movie intro clip
This example script, an extension of the third example, creates a movie intro clip containing a group of subtitles that appear and go in consecutive frames with fade-in and fade-out effects. In addition, subtitles are smoothed to allow a more pleasing view.
7. Stack clip frames in a matrix
This example script stacks a given range of frames of a clip in a (single clip) matrix. The script thus offers a way to quick preview a clip, in order to search for scene changes, cut points, etc.
In addition, the presentation text offers some insight on how you can use AVSLib components to build new library-grade routines as well as hints on how to use it effectively, ie without large performance penalties.
8. Load, convert and join arbitrary clips
This example script, an extension of the fifth example, loads clips and arguments supplied in external text files and then applies filtering (resizing and colorspace and fps conversion) based on the arguments' values. Finally, it joins the clips serially in a single timeline.
In addition, shell scripts to automate the creation of the text files as well as the rendering of the .avs script are provided, giving the ability to execute a defined clip processing as a single shell command.
9. Make an animated draw of a curve with random orbits
This example script draws an animated curve with a family of pens, each with a different color and brush (shape), on top of a base clip.
The pens deviate randomly from the curve's main (x,y) coordinates within a given radius - like the "orbits" setting found in most modern painting programs - while the curve's main (x,y) coordinates advance constantly on each frame.
The radius and opacity of the pen strokes are controlled by external files read with ConditionalReader.
10. Loop through filter settings
This example script applies a set of different filtering parameters combinations to a single (reference) frame of a clip and then joins the filtered frames into a single clip.
In addition, the example demonstrates the logging facilities of AVSLib, by producing a log of settings and filter parameters per frame.
The specific filter looped-through at the example is Levels.
11. Loop through filter settings - revisited
This example script applies a set of different filtering parameters combinations to a (reference) subrange of a clip and then joins the filtered clips into a single clip. It then stacks horizontally the filtered and original clips to easily review the filter effect.
In addition, the example demonstrates the logging facilities of AVSLib, by producing a log of settings and filter parameters per frame.
The specific filter looped-through at the example is Didée's SeeSaw.
12. Load, convert and join with transition effect arbitrary clips
This example script, an extension of the fifth and eighth examples, demonstrates the ability to build complex clip processing "programs" that can be run as one shell command with arguments.
13. Multi-color mask creation and manipulation
This example script creates combined colormasks of multiple colors and manipulates them in various ways. To demonstrate the applicability of color mask selection to moving objects, an animated source is constructed using the animation filters supplied by AVSLib.
14. Create an expanding rotating circle of rotating stars
This series of example scripts demonstrates the (large) improvement in capacity and speed of the animation filters supplied by AVSLib in version 1.1.0, compared to previous versions.
15. Per frame filtering, a position + size + color animation
This series of example scripts demonstrates the capabilities offered by the filters of the new in AVSLib version 1.1.0 filters :: frames module.
Here a complex animation is performed using those filters; the ability to call them multiple times inside the script, like regular functions, without meshing with globals is also demonstrated.
16. Per frame filtering, exporting specific frame(s)
This series of example scripts demonstrates the ease of creating new filters that build on-top of the filters of the filters :: frames module.
Three filters to export specific frames form a clip with varying requirements are created and tested: ExportFrames, ExportFramesEvery and ExportFramesReader.