Using AviSynth scripts with LiMovie to process events involving faint stars
AviSynth's strength is in its scripting facility. It allows you to do almost anything you want with your video records such as changing its Gamma or integrating frames to boost faint start. This is very useful when the star is very close to the limit and the Signal/Noise ratio is poor in the original video.
This section of the workshop will show you how to use an AviSynth script for integrating frames. We will be using the Steve&Steve script, which of course has been developed by Stephen Russell and is based on a script by Steve Preston.
Trying without integration
For the purpose of this demonstration we are going to use the observation of [21] Gerlinde.avi from Data/Asteroid Occultations folder. So let's run LiMovie, open this file and see how it looks like.
Below is a screenshot which shows what you will probably see. The target star is in the middle of the white cross and is very difficult to see.
Steve&Steve's script
First let's copy the script to our LiMovie folder. To do this open up this folder and then copy the Integrate.avs file to C:\LiMovie. The next step is something that is required because we are copying the file from a DVD and it is marked as "read only" meaning that we won't be able to change it. To fix this right click on the file and select properties

Then uncheck the "Read-only" checkbox and press "OK"

Once you've finished with this, double-click on the file to open it.
Steve Russell has done a great job and wrote all the code for this script leaving on the top parameters which we only need to configure. There are also very detailed comments on how to use the script and what is the meaning of each of the parameters. Please take some time to read those. I have also underlined the most important parameters and will go through each one of them.

The first one, underlined in red, is the location of the video file we want to open. For this exercise we should put for the value of this parameter "E:\Data\Asteroidal Occultations\[21] Gerlinde.avi" where E: has to be replaced if necessary with the drive letter of your DVD drive. You should already know this letter from our previous exercise.
The second one we are going to change in our first test is underlined in blue and is the number of frames to be integrated. We are going to use a value of 3 for this one.

Once this is done save the file and confirm you want to overwrite it if asked.
Trying with integration
So now let's open our script in LiMovie. To do this we have to choose "AviSynth file(*.avs)" from the file type dropdown and then point to the file we just saved.

Once the file is loaded you can immediately tell the difference. The target star is now clearly visible in the middle of the field.

Another thing which you see immediately is the white artifacts circled in red and the black rectangle behind the numbers circled in orange. To understand what they are you should know how Steve&Steve's script actually work.
What it does is it integrates the specified number of frames (for example 3 in this case) and returns them as one. So this means that the first frame of this video will contain the integrated frames 1, 2 and 3. Then the second frame will be the integrated frames 2, 3 and 4; the third frame will be the integrated frames 3, 4 and 5.
This is all good but in such a case the time stamps of all frames would overlap and would result in a blurred and very hard or impossible to read timing. To resolve this Steve&Steve's script actually cuts one region of the frame, that's the black rectangle circled in orange, and pastes in there the same area from the middle frame only. This area is supposed to have the time of the frame exposure.
So in other words the script integrates every 3 frames and shows the time of the middle frame. This is why it is advised an odd number to be used when specifying how many frames to be integrated.
The two white rectangles, circled in red, appear because the script was designed to work with the KIWI-OSD timestamps and KIWI-OWD has only one display at the bottom while this video is using different time insertion software and the white sports are artifacts caused by the overlapping of the integrated frames. Actually in this case the real time stamp is clearly visible because of the pure luck that this time insertion and KIWI-OSD are using almost exactly the same area to display the timestamps.
The Steve&Steve script should works for most of the video recorders using KIWI-OSD. If the timestamp is not clearly readable for you then you will have to modify the Integrate.avs and redefine the area where your timestamp is displayed. If you need help with this contact Hristo Pavlov or Steve Russell.
Playing with the Gamma
Integrating frames is not the only way we can "improve" the quality of our video. Sometimes by playing with the gamma and the white/black balance we can enhance it so faint stars appear clearer. To demonstrate this lets make a second test and this time use no integration (add = 1), gamma = 2.5 and black = 16. To do this open the Integrate.avs file and then modify the configuration with these values. Then save the file and reopen it in LiMovie. We can see more noise but the target star is easily visible.

The image below shows the light curve taken with no integration and with 7-frame integration.

The first thing you see is that the no-integration light curve has more noise, while the 7-frame integration light curve is much smoother and the occultation is very distinctively seen. So this means that integration can help us to see easier whether an occultation has happened or not.
However integrating frames will certainly lead to a loss of timing precision, the question is how much is this loss. This is a difficult question and the answer depends on the quality of your video and the signal to noise ratio. In the video we are using for this demonstration the signal to noise ratio is not that bad. However this will not always be the case. Generally speaking if your video has a very poor quality already chances are you won't be able to improve it using integration. Also integration shouldn't be used for timing short occultations. We always need to have a couple of consecutive frames (5 or more) which highest reading is well below the lowest reading of the non occulted star.
If the timing of an event has been extracted using a software integration a good advice to follow when reporting such an occultation is:
- Always attach light curves from the integrated and non integrated analysis and specify what integration you have used.
- Report the time precision as 1/2 of the total exposure of the integrated frames. (In our case we are using an integration of 3 frames and this should have a total exposure of 3x40ms = 120ms per integrated frame and 1/2 of this is 60ms. So in our case we should report a timing precision of +/- 60ms)
We learned how to ...
- Configure the Integrate.avs script for integrating frames
- Configure the Integrate.avs script for adjusting the gamma to improve signal/noise
- Load a video in LiMovie using the Integrate.avs script
- What do to if the timing OSD is not clearly visible in LiMovie when using the Integrate.avs
Additional information about AviSynth is available in this DVD under /Software/AviSynth/Docs
End of "Using AviSynth scripts with LiMovie to process events involving faint stars"
![]() | Back to Content |


