I have following part of the code, I am reading frames from a folder in the rate of 5 frames per second, within in an infinite loop and in total I have 2552 frames in folder