open method

bool open(
  1. String filename, {
  2. int apiPreference = CAP_ANY,
})

Opens a video file or a capturing device or an IP video stream for video capturing with API Preference and parameters.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

https://docs.opencv.org/4.x/d8/dfe/classcv_1_1VideoCapture.html#aa6480e6972ef4c00d74814ec841a2939

Implementation

bool open(String filename, {int apiPreference = CAP_ANY}) {
  return using<bool>((arena) {
    final cname = filename.toNativeUtf8(allocator: arena);
    final success = arena<ffi.Bool>();
    cvRun(() => cffi.VideoCapture_OpenWithAPI(ref, cname.cast(), apiPreference, success));
    return success.value;
  });
}