Skip to content

VideoCapture_waitAny

videoiofunctionOpenCV 5.0.0
import { VideoCapture_waitAny } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSstreams, readyIndex, timeoutNs
FUNCTIONVideoCapture_waitAny
RETURN TYPEboolean
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Wait for ready frames from VideoCapture.

throws: Exception %Exception on stream errors (check .isOpened() to filter out malformed streams) or VideoCapture type is not supported

The primary use of the function is in multi-camera environments.
The method fills the ready state vector, grabs video frame, if camera is ready.

After this call use VideoCapture::retrieve() to decode and fetch frame data.
VideoCapture_waitAny(streams: VideoCaptureVector, readyIndex: IntVector, timeoutNs: bigint): boolean;
2 available overloads
VideoCapture_waitAny(streams: VideoCaptureVector, readyIndex: IntVector): boolean;
VideoCapture_waitAny(streams: VideoCaptureVector, readyIndex: IntVector, timeoutNs: bigint): boolean;
streams

input video streams

readyIndex

Output destination, filled by the native operation. stream indexes with grabbed frames (ready to use .retrieve() to fetch actual frame)

timeoutNs

number of nanoseconds (0 - infinite)

Returns

true if streamReady is not empty

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.