If you look at the menu command for saving as AVI, it has an option to set the frame rate, which is taken from a setting hidden in Image > Stacks > Tools > Animation Options... in the menu.
Using the command finder, which you can invoke by typing [L], you find the sources for these two commands:
- File > Save As > AVI... =>
ij.plugin.filter.AVI_Writer
- Image > Stacks > Tools > Animation Options... =>
ij.plugin.Animator("options")
The command finder provides a handy button that directly links to the source files, have a look here and here. You'll find that the frame rate setting is stored as fps
in the Calibration of the ImagePlus.