# The script execution model

This section is a walkthrough to the internals of the AviSynth script engine. Its aim is to provide a better understanding of how AviSynth transforms script commands to actual video frames and help a user that has already grasped the basics of AviSynth scripting to start writing better and optimised scripts.

The following subsections present the various parts that when combined together form what can be called the AviSynth’s “script execution model”:

- Sequence of events

A detailed description of the sequence of events that occur when you execute (ie load and render to your favorite encoder) an AviSynth script.

- The (implicit) filter graph

A glance at the basic internal data structure that holds the representation of a parsed AviSynth script.

- The fetching of frames (from bottom to top)

How the AviSynth engine requests frames from filters.

- Scope and lifetime of variables

The interplay of variables’ scope and lifetime with the other features of AviSynth syntax.

- Evaluation of runtime scripts

The details of runtime scripts’ evaluation.

- Performance considerations

Various performance-related issues and advice on how to optimise your AviSynth scripts and configuration.

Back to scripting reference.

$Date: 2008/04/20 19:07:33 $