Is there a function to check if a frame is available?

Is there a function that tells me if there is a frame available in the VideoCapture?
The read() function will block until there is a frame available. But I would like to be able to check if frames are available.
I need this for a special multi camera frame synchronisation algorithm.

I know I could create a thread for each camera and implement such a function. But with up to 8 camera to be synced it would give me overhead that I do not want.

If you use v4l2 api then you can use waitAny else you have to write a multithread code

not much overhead.

merely one thread per camera, which doesn’t do much except block most of the time, and some synchronization primitives (queues or counting semaphores).