open method

void open(
  1. String filename,
  2. String codec,
  3. double fps,
  4. (int, int) frameSize, {
  5. int? apiPreference,
  6. bool isColor = true,
})

Implementation

void open(
  String filename,
  String codec,
  double fps,
  (int, int) frameSize, {
  int? apiPreference,
  bool isColor = true,
}) {
  final cname = filename.toNativeUtf8();
  final codec_ = VideoWriter.fourcc(codec);
  final p = calloc<ffi.Bool>();
  apiPreference == null
      ? cvRun(
          () => cvideoio.cv_VideoWriter_open(
            ref,
            cname.cast(),
            codec_,
            fps,
            frameSize.$1,
            frameSize.$2,
            isColor,
            p,
            ffi.nullptr,
          ),
        )
      : cvRun(
          () => cvideoio.cv_VideoWriter_open_1(
            ref,
            cname.cast(),
            apiPreference,
            codec_,
            fps,
            frameSize.$1,
            frameSize.$2,
            isColor,
            p,
            ffi.nullptr,
          ),
        );
  calloc.free(cname);
  calloc.free(p);
}