HOME

TheInfoList



OR:

AviSynth is a frameserver program for
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
,
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
and
macOS macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
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, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
licensed under the
GNU General Public License The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was the first ...
.


Scripting video editor

AviSynth acts as a non-linear video editor controlled entirely by scripting (without a GUI). It emulates an AVI video file (or WAV audio file) as seen by the VFW downstream application, which is typically a
media player Media player may refer to: *Digital media player, home appliances that play digital media *Media player software, software that plays digital media *Portable media player, portable hardware that plays digital media *Windows Media Player Windo ...
,
video editing software Video editing software or a video editor is software used for performing the post-production video editing of digital video sequences on a non-linear editing system (NLE). It has replaced traditional flatbed celluloid film editing tools and analo ...
, or an encoder. AviSynth is built upon ''filters'', which are much like DirectShow filters, but with a different binary interface. Filter capabilities include cropping,
deinterlacing Deinterlacing is the process of converting interlaced video into a non-interlaced or Progressive scan, progressive form. Interlaced video signals are commonly found in analog television, VHS, Laserdisc, digital television (HDTV) when in the 1080 ...
,
inverse telecine Telecine ( or ), or TK, is the process of transferring film into video and is performed in a color suite. The term is also used to refer to the equipment used in this post-production process. Telecine enables a motion picture, captured origi ...
, working with still
image An image or picture is a visual representation. An image can be Two-dimensional space, two-dimensional, such as a drawing, painting, or photograph, or Three-dimensional space, three-dimensional, such as a carving or sculpture. Images may be di ...
s, doing basic
color grading Color grading is a post-production process common to filmmaking and video editing of altering the appearance of an image for presentation in different environments on different devices. Various attributes of an image such as contrast (vision), ...
, reducing video noise, and many other things. AviSynth also performs traditional
video editing Video editing is the post-production and arrangement of video shots. To showcase excellent video editing to the public, video editors must be reasonable and ensure they have a thorough understanding of film, television, and other sorts of videog ...
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, officially referred to as Windows Media Player Legacy to retronym, distinguish it from Windows Media Player (2022), the new Windows Media Player introduced with Windows 11) is the first media player (application soft ...
). The program will play the video file "myAvi.avi" cropped down to its top-left 320
pixels In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, pixels are the sma ...
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 and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
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. 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 Dat ...
language: a
programming paradigm A programming paradigm is a relatively high-level way to conceptualize and structure the implementation of a computer program. A programming language can be classified as supporting one or more paradigms. Paradigms are separated along and descri ...
that describes a directed graph of the data flowing between operations. It lacks some
procedural programming Procedural programming is a programming paradigm, classified as imperative programming, that involves implementing the behavior of a computer program as Function (computer programming), procedures (a.k.a. functions, subroutines) that call each o ...
control structures, but it contains many features familiar to programmers, including
variables Variable may refer to: Computer science * Variable (computer science), a symbolic name associated with a value and whose associated value may be changed Mathematics * Variable (mathematics), a symbol that represents a quantity in a mathemat ...
, distinct
datatype In computer science and computer programming, a data type (or simply type) is a collection or grouping of data values, usually specified by a set of possible values, a set of allowed operations on these values, and/or a representation of these ...
s, 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 Subtitles are texts representing the contents of the audio in a film, television show, opera or other audiovisual media. Subtitles might provide a transcription or translation of spoken dialogue. Although naming conventions can vary, caption ...
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, officially referred to as Windows Media Player Legacy to retronym, distinguish it from Windows Media Player (2022), the new Windows Media Player introduced with Windows 11) is the first media player (application soft ...
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 In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an ...
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 The RGB color model is an additive color model in which the red, green, and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three ...
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 represe ...
s to allow all kinds of video input and output. Certain functions only work on specific color spaces, requiring conversion – for example, most videos are distributed in a YUV color space, but most
color correction Color correction is a process used in stage lighting, photography, television, cinematography, and other disciplines, which uses color gels, or filters, to alter the overall color of the light. Typically the light color is measured on a scale k ...
is done in one of the
RGB The RGB color model is an additive color model in which the red, green, and blue primary colors of light are added together in various ways to reproduce a broad array of colors. The name of the model comes from the initials of the three ...
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 represe ...
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 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 sapph ...
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 Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
, instead relying on
GStreamer GStreamer is a Pipeline (computing), pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one f ...
, extending support to platforms such as
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
,
Mac OS X macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
and
BSD The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
. Development has been stalled since August 2007.
AviSynth+
is a fork of the official AviSynth 2.xx, introducing 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 (2023-06), 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 made from Fermentation in winemaking, fermented fruit. Yeast in winemaking, Yeast consumes the sugar in the fruit and converts it to ethanol and carbon dioxide, releasing heat in the process. Wine is most often made f ...
. To work on scripts
VirtualDub VirtualDub is a free and open-source video capture and video processing utility for Microsoft Windows written by Avery Lee. It is designed to process linear video streams, including filtering and recompression. It uses AVI container format to s ...
/ VirtualDubMod can be used as on Windows. To interface between AviSynth under Wine and for example
FFmpeg FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing vide ...
running on a Linux host, Avs2YUV can be used. Avs2YUV is a
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
command line program that is run under Wine and renders the output of an AviSynth script to
stdout In computer programming, standard streams are preconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdin), ...
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 The following is a list of video editing software. The criterion for inclusion in this list is the ability to perform non-linear video editing. Most modern transcoding software supports transcoding a portion of a video clip, which would count as ...


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