Read the scripting guides. Basically, you should create a re-encoded version of the video and use it while scripting to get good performance.
Check part 3 in Huskys guide:
(02:00) Improve your performance by reencoding the video
https://discuss.eroscripts.com/t/how-to-script-in-openfunscripter-video-tutorial/16637
You can also check the Tips & Trix section in my text guide on scripting if you are ok with using ffmpeg from the command line.
https://discuss.eroscripts.com/t/how-to-get-started-with-scripting/2234