Save to file every 1000 frames