AVSMeter is a CLI (command line interface) tool that "runs" an Avisynth script with virtually no overhead, displays clip info, CPU/GPU and memory usage and the minimum, maximum and average frames processed per second.
Measuring how fast Avisynth can serve frames to a client application (x264, VirtualDub) and establishing CPU/GPU/memory usage helps with optimizing scripts and tracking down crashes, slowdowns and bottlenecks.





Usage:  AVSMeter script.avs [switches]
Switches
 -avsinfo            Display extended Avisynth info (1)
 -info [-i]          Display clip info
 -log  [-l]          Create log fil
e (2)
 -csv                Create csv file (3)
 -gpu                Monitor GPU/VPU usage (4)
 -range=first,last   Set frame range (5)
 -timelimit=n        Set time limit (seconds) (6)
 -priority=n         Set process priority (1:low, 2:normal, 3:high)


(1) Displays extended info about the installed Avisynth version and the plugin sub-system. If a custom avisynth.dll is specified in the ini file, info about that file will be displayed. The "-avsinfo" switch can be combined with "-log" in order to write the info to a file ("avsinfo.log" is created in the current (working) directory unless the INI option "LogDirectory" points to another (valid) directory).

(2) Creates a log file with various details about the installed Avisynth version, clip info, runtime results, a copy of the script and a performance data table with the measured details about each frame/frame interval. The log file is created in the same directory as the script unless the INI option "LogDirectory" points to another (valid) directory.
Note: The numbering of the frames in the performance data section is not zero-based, i.e. the first frame is 1, not 0.

(3) Creates a CSV file containing the performance data formatted as comma-separated values for direct import in Excel or a similar spread sheet program (OpenOffice, LibreOffice). The CSV file is created in the same directory as the script unless the INI option "LogDirectory" points to another (valid) directory.
Note: The numbering of the frames in the .csv file is not zero-based, i.e. the first frame is 1, not 0.

(4) Enables display of the GPU/VPU usage which of course is only useful if a filter that uses the GPU is in the chain. AVSMeter uses GPU-Z to access the graphics card sensors through a shared memory space. GPU-Z has to be running (the window can be minimized to the system tray) before running AVSMeter.

(5) Specify the range of frames to be processed. For example, "-range=1500,1999" processes 500 frames starting at frame 1500. Without "-range" AVSMeter processes all frames of the script.

(6) Specify a time limit (in seconds) after which the program stops reading frames and terminates.

Note: If applicable, command line switches override INI settings.



INI file settings

AVSMeter checks if a settings file ("AVSMeter.ini") exists in the directory from where it is started. If not, it will be created with the default settings.
Supported settings for the INI file (default values in red):

"LogDirectory":
The user can specify a directory in which all log files are stored. This has to be a fully qualified path, for example "LogDirectory=c:\LogFiles" (without the quotes). The default is an empty string which means that all log files are stored in the script directory or, in case the "-avsinfo" switch was used, the current (working) directory.

"AVSDLL"
:
The user can specify the avisynth.dll to be used. This has to be a fully qualified path, for example "AVSDLL=d:\apps\avisynth\avisynth.dll" (without the quotes). The default is an empty string which means that AVSMeter will attempt to load avisynth.dll through the standard Windows search hierarchy.

"DisplayFPS"
(0 or 1):
If set to "1", frames/second is printed to the console.

"DisplayTPF" (0 or 1):

If set to "1", time/frame (in milliseconds) is printed to the console.

"DisplayEfficiencyIndex" (0 or 1):
If set to "1", the result of (FPS / CPU usage) is printed to the console. This ratio indicates the efficiency of a script (higher = better) and is useful for comparing different versions of a script or scripts that are supposed to do the same thing.

"CreateLog" (0 or 1):

Creates a log file with various details about the installed Avisynth version, clip info, runtime results, a copy of the script and a performance data table with the measured details about each frame/frame interval. The log file is created in the same directory as the script unless the INI option "LogDirectory" points to a valid directory.
Note: The numbering of the frames in the performance data section is not zero-based, i.e. the first frame is 1, not 0.

"CreateCSV" (0 or 1):
Creates a CSV file containing the performance data formatted as comma-separated values for direct import in Excel or a similar spread sheet program (OpenOffice, LibreOffice). The CSV file is created in the same directory as the script unless the INI option "LogDirectory" points to a valid directory.
Note: The numbering of the frames in the .csv file is not zero-based, i.e. the first frame is 1, not 0.

"SkipSpeedTest" (0 or 1):
AVSMeter runs a quick test on a few frames at the start in order to measure the frames/second that Avisynth returns for a given script. The result is used to determine a suitable interval for measuring CPU/GPU/memory usage and minimize the overhead of these measurements.
If "SkipSpeedTest" is set to "1", this test is omitted. This can be useful if, for example, AVSMeter is used with a script that just writes a single image or a sequence of images where the speed test is irrelevant.
For normal operation, i.e. testing the speed of a script, that setting should be "0", otherwise the accuracy of the FPS/TPF measurements may be reduced, particularly for fast scripts.

"LogFileDateTimeSuffix" (0 or 1):
If set to "1", adds a date/time suffix to all .log and .csv files.

"PauseBeforeExit" (0 or 1):
If set to "1", pauses the program at the end and returns to the console prompt only after pressing "ESC".

"ConUseSTDOUT" (0 or 1):
If set to "1", directs all console output to stdout. The default setting "0" uses stderr except the "command line usage" message which always goes through stdout.

"FrameRange" (first,last):

Specify the range of frames to be processed. "FrameRange=0,-1" processes all frames in the script. "FrameRange=1500,1999" processes 500 frames starting at frame 1500.

"InvokeDistributor" (0 or 1):

For users of SEt's Avisynth MT: If set to "1", adds the "Distributor" call internally if the script uses MT Mode 1~4 (via "SetMTMode"). Note: Setting this value to "1" and adding the Distributor call in the script will unnecessarily increase the number of threads which leads to increased memory usage and suboptimal performance. The "InvokeDistributor" setting is ignored when using non-MT versions of Avisynth.

"AllowOnlyOneInstance" (0 or 1):
When set to "1", only one instance of AVSMeter can run at the same time.

"UseColor" (0 or 1):
When set to "0", coloring of the console output is disabled.

"MonitorGPULoad" (0 or 1):
When set to "1", enables display of the GPU/VPU usage which of course is only useful if a filter that uses the GPU is in the chain. AVSMeter uses GPU-Z to access the graphics card sensors through a shared memory space. GPU-Z has to be running (the window can be minimized to the system tray) before running AVSMeter.

"ProcessPriority" (1, 2 or 3):
Specify the process priority for AVSMeter and all attached processes (1: low, 2: normal, 3: high).

"TimeLimit" (1 - 999999):
Specify a time limit (in seconds) after which the program stops reading frames and terminates. A setting of "-1" disables this feature. This setting is ignored when the program is invoked with the "-i" ("-info") switch which only determines the clip properties.