VideoWriter.open constructor

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

Implementation

factory VideoWriter.open(
  String filename,
  String codec,
  double fps,
  (int, int) frameSize, {
  bool isColor = true,
}) {
  return cvRunArena<VideoWriter>((arena) {
    final p = calloc<cvideo.VideoWriter>();
    cvRun(() => cvideo.VideoWriter_New(p));
    final name = filename.toNativeUtf8(allocator: arena);
    final codec_ = codec.toNativeUtf8(allocator: arena);
    cvRun(
      () => cvideo.VideoWriter_Open(
        p.ref,
        name.cast(),
        codec_.cast(),
        fps,
        frameSize.$1,
        frameSize.$2,
        isColor,
      ),
    );
    return VideoWriter._(p);
  });
}