AviSynth is a
frameserver program for
Microsoft Windows,
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which i ...
and
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
initially developed by Ben Rudiak-Gould, Edwin van Eggelen, Klaus Post, Richard Berg and Ian Brabham in May 2000
and later picked up and maintained by the open source community which is still active nowadays. It is
free software
Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, ...
under
GNU GPL
The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general ...
license.
Scripting video editor
AviSynth acts as a
non-linear video editor controlled entirely by
scripting
Script may refer to:
Writing systems
* Script, a distinctive writing system, based on a repertoire of specific elements or symbols, or that repertoire
* Script (styles of handwriting)
** Script typeface, a typeface with characteristics of handw ...
(without a
GUI).
It emulates an
AVI
Avi is a given name, usually masculine, often a diminutive of Avram, Avraham, etc. It is sometimes feminine and a diminutive of the Hebrew spelling of Abigail.
People with the given name include:
* Avi (born 1937), Newbery award-winning Americ ...
video file (or
WAV audio file) as seen by the
VFW downstream application, which is typically a
media player,
video editing software
Video editing software, or a video editor is software used performing the post-production video editing of digital video sequences on a non-linear editing system. It has replaced traditional flatbed celluloid film editing tools and analog video t ...
, or an
encoder Encoder may refer to:
Electronic circuits
* Audio encoder, converts digital audio to analog audio signals
* Video encoder, converts digital video to analog video signals
* Simple encoder, assigns a binary code to an active input line
* Priority e ...
.
AviSynth is built upon ''filters'', which are much like
DirectShow filters, but with a different
binary interface. Filter capabilities include
cropping,
deinterlacing,
inverse telecine, working with still
image
An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensio ...
s, doing basic
color grading, reducing
video noise, and many other things. AviSynth also performs traditional
video editing tasks like cutting, trimming and re-sequencing segments.
For example, consider the script "myAvi.avs" (just a plain text-file saved with the extension "avs")
AviSource("myAvi.avi")
Crop(0, 0, 320, 240)
Blur(0.1)
This script file can be opened in most media players (such as
Windows Media Player
Windows Media Player (WMP) is the first media player and media library application that was developed by Microsoft for playing audio, video and viewing images on personal computers running the Microsoft Windows operating system, as well as ...
). The program will play the video file "myAvi.avi" cropped down to its top-left 320
pixels by 240 pixels and blurred by a small amount. Operations occur in sequential order, so the cropping occurs first, then the blurring.
Technically, AviSynth constructs a
filter graph (like
Microsoft
Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
GraphEdit but with added capabilities),
controlled by ''scripts'' written in th
AviSynth scripting language Its functionality can be extended through the use of third-party filters known as
plugins
Plug-in, plug in or plugin may refer to:
* Plug-in (computing) is a software component that adds a specific feature to an existing computer program.
** Audio plug-in, adds audio signal processing features
** Photoshop plugin, a piece of software t ...
. An external plugin list is maintained a
AviSynth Filter Collection
AviSynth is a
frameserver – the calling program ''requests'' audio/video frames and the script ''serves'' them. The calling program can call frames in any order, allowing it to pause, jump forward or backward etc., just as with a physical file.
AviSynth scripting language
The scripting language is a
dataflow
In computing, dataflow is a broad concept, which has various meanings depending on the application and context. In the context of software architecture, data flow relates to stream processing or reactive programming.
Software architecture
Da ...
language:
[ a ]programming paradigm
Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms.
Some paradigms are concerned mainly with implications for the execution model of the language, s ...
that describes a directed graph of the data flowing between operations. It lacks some procedural programming
Procedural programming is a programming paradigm, derived from imperative programming, based on the concept of the '' procedure call''. Procedures (a type of routine or subroutine) simply contain a series of computational steps to be carri ...
control structures, but it contains many features familiar to programmers, including variables, distinct datatypes, conditionals, and complex expressions.
The language works primarily with the audio/video ''clip'' as a built-in data type. The clip is a complex structure with many attributes such as width, height and duration. The language also has several other more standard data types: ''int'', ''float'', ''bool'' and ''string''. These can be used to perform calculations, decisions, and write text such as subtitles to the video.
The script has a single ''return value'', which is the audio and video 'seen' by the program running the script. This is normally the last line of the script, but a return statement
In computer programming, a return statement causes execution to leave the current subroutine and resume at the point in the code immediately after the instruction which called the subroutine, known as its return address. The return address is sa ...
may be inserted at any point.
"Hello World"
This example is a "Hello World" program.
BlankClip()
Subtitle("Hello, world!")
If the above text is entered into a text file with the .avs extension, it can be opened in Windows Media Player
Windows Media Player (WMP) is the first media player and media library application that was developed by Microsoft for playing audio, video and viewing images on personal computers running the Microsoft Windows operating system, as well as ...
or any of the other programs in the list below, and a video containing the words "Hello, world!" will be displayed.
The function creates a new video. The parentheses at the end of the word are optional, since no arguments are being passed, but are given in this case to indicate it is a function and not a variable.
The function draws the words "Hello, world!" on top of the previously-created blank video.
Although both functions both accept many more arguments (for example, controlling the size and length of the blank video, and the positioning, font, and color of the subtitle), this example leaves them out; the functions use built-in default arguments.
Avisynth uses syntactic sugar that makes simple scripts far easier to write: an implicit variable called . Without implicit variables, the above script would have to be written like this:
Last = BlankClip()
Last = Last.Subtitle("Hello, world!")
return Last
or like this:
A = BlankClip()
B = A.Subtitle("Hello, world!")
return B
Explicit clip variables are normally only used for functions involving more than one clip:
A = BlankClip()
B = A.Subtitle("Hello, world!")
return Dissolve(A, B, 30) # 30-frame cross fade
Video-processing
This example takes an actual video, applies some simple processing, and returns it to the output.
AviSource("C:\Example.avi")
ReduceBy2()
GreyScale()
The function is used to load an AVI video from a real location. To open other media types, the function could be used instead. divides the vertical and horizontal size of the video in half, and removes all color information.
AviSynth filters work in many RGB and YUV color space
A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital representa ...
s to allow all kinds of video input and output. Certain functions only work on specific color spaces
A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital represent ...
, requiring conversion – for example, most videos are distributed in a YUV color space, but most color correction is done in one of the RGB spaces. A color-correcting script might look like this:
DirectShowSource("movie.mp4") # YV12 color space
ConvertToRGB32
RGBAdjust(1.0, 0.95, 1.0) # decrease Green channel
ConvertToYV12
User defined
The AviSynth scripting language allows for users to define their own functions.
This is an example of a function that allows you to dissolve from one clip to another without damaging interlacing lines.
clip1 = AVISource("video1.avi")
clip2 = AVISource("video2.avi")
# call the user-defined function which is defined below:
interlaced_dissolve(clip1, clip2, 30)
# ...the script returns the above result to the calling program
# user-defined function:
# dissolve from clip1 to clip2 over 30 frames
function interlaced_dissolve(clip clip1, clip clip2, int iter)
AviSynth 3.0 and AviSynth+
AviSynth 3.0 was a complete rewrite of AviSynth 2.x, and aimed to overcome the limitations of AviSynth 2.x.
Adding improvements such as an abstracted color space
A color space is a specific organization of colors. In combination with color profiling supported by various physical devices, it supports reproducible representations of colorwhether such representation entails an analog or a digital representa ...
model, in which new color spaces (including two with 45-bit depth) could be supported through a plug-in mechanism, better cache management for better performance, and using Ruby
A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum (aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapp ...
rather than the homegrown language employed in current versions.
AviSynth 3.0 was to be available for other operating systems than Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
, instead relying on GStreamer, extending support to platforms such as Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which i ...
, Mac OS X
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and lapt ...
and BSD. Development has been stalled since August 2007.
The most current and modern version of AviSynth today i
AviSynth+
originally a fork of the official AviSynth 2.xx, but AviSynth+ has since gained widespread recognition and has become the go-to implementation. It rewrote most of the original AviSynth code, and introduced long-sought features such as 64-bit support, multithreading, deep color spaces, support for recent compilers, new scripting constructs (new control-flow constructs such as loops), and increased performance in many areas. At the same time it retained 100% compatibility to the AviSynth 2.5/2.6 series, both for filters and host applications. At the time of writing (2020-12), it is also actively maintained.
AviSynth for non-Windows operating systems
AviSynth 2.xx may be used under operating systems other than Windows through the use of Wine
Wine is an alcoholic drink typically made from fermented grapes. Yeast consumes the sugar in the grapes and converts it to ethanol and carbon dioxide, releasing heat in the process. Different varieties of grapes and strains of yeasts are ...
. To work on scripts VirtualDub/VirtualDubMod
VirtualDubMod was an open-source video capture and processing tool for Microsoft Windows, based on Avery Lee's VirtualDub.
History
Version 1.5.10.2 (build 2542) was released on 21 February 2006. VirtualDub's author, which hosts VirtualDubMod's f ...
can be used as on Windows. To interface between AviSynth under Wine and for example FFmpeg running on a Linux host, Avs2YUV AVS or Avs may refer to:
People
* AVS (actor), Indian actor and comedian
Sports
* Colorado Avalanche, an NHL hockey team
Schools
* Abbey Vocational School, a secondary school in County Donegal, Ireland
* Amman Valley School, a bilingual (Wel ...
can be used. Avs2YUV is a Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
command line program that is run under Wine and renders the output of an AviSynth script to stdout that is then piped to FFmpeg. Avs2YUV also supports writing to a named pipe.
There is a Linux port of AviSynth called AvxSynth.
AviSynth compatible programs
In addition, several programs have now been created which accept ''only'' AviSynth scripts as input - thereby simplifying the programs themselves but giving users the full power of AviSynth for input.
There are also several batch encoding applications that tie together AviSynth with command line audio and video encoders and muxers to provide an all-in-one, modular, customizable video encoding application. MeGUI is an example of this kind of application.
Although AviSynth scripts are meant to be easily opened in simple text editing programs, there are several editors meant especially for editing AviSynth scripts such a
AvsPMod
See also
* List of video editing software
References
External links
* AviSynth home page
(English)(Japanese)
AviSynth Filter Collection
Doom9's AviSynth Forums
AviSynth 3.0 development homepage
{{DEFAULTSORT:Avisynth
Free video software