VideoCapture.create constructor

VideoCapture.create(
  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.

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

Implementation

factory VideoCapture.create(String filename, {int apiPreference = CAP_ANY}) {
  final p = calloc<cvg.VideoCapture>();
  final cname = filename.toNativeUtf8().cast<ffi.Char>();
  cvRun(() => cvideoio.cv_VideoCapture_create_1(cname, apiPreference, p, ffi.nullptr));
  calloc.free(cname);
  return VideoCapture._(p);
}