Previous methods for detecting the flashing behavior of fireflies were using either a photomultiplier tube, a stopwatch, or videography. Limitations and problems are associated with these methods, i.e., errors in data collection and analysis, and it is time-consuming. This study aims to applied a computer vision approach to reduce the time of data collection and analysis as compared to the videography methods by illuminance calculation, time of flash occurrence, and optimize the position coordinate automatically and tracking each firefly individually. The Validation of the approach was performed by comparing the flashing data of male fireflies, Sclerotia aquatilis that was obtained from the analysis of the behavioral video. The pulse duration, flash interval, and flash patterns of S. aquatilis were similar to a reference study. The accuracy ratio of the tracking algorithm for tracking multiple fireflies was 0.94. The time consumption required to analyze the video decreased up to 96.82% and 76.91% when compared with videography and the stopwatch method, respectively. Therefore, this program could be employed as an alternative technique for the study of fireflies flashing behavior.