I understand now what you need. I would suggest a product/consumer architecture. In the consumer loop, every 500ms do the single frame capture. You could also try an elapsed time function in the main loop but the live stream would get interrupted.
↧