fromFileAsync static method
Implementation
static Future<VideoWriter> fromFileAsync(
String filename,
String codec,
double fps,
(int, int) frameSize, {
int? apiPreference,
bool isColor = true,
}) {
final p = calloc<cvg.VideoWriter>();
final cname = filename.toNativeUtf8();
final codec_ = VideoWriter.fourcc(codec);
if (apiPreference == null) {
return cvRunAsync0(
(callback) => cvideoio.cv_VideoWriter_create_1(
cname.cast(),
codec_,
fps,
frameSize.$1,
frameSize.$2,
isColor,
p,
callback,
),
(c) {
calloc.free(cname);
return c.complete(VideoWriter.fromPointer(p));
},
);
}
return cvRunAsync0(
(callback) => cvideoio.cv_VideoWriter_create_2(
cname.cast(),
apiPreference,
codec_,
fps,
frameSize.$1,
frameSize.$2,
isColor,
p,
callback,
),
(c) {
calloc.free(cname);
return c.complete(VideoWriter.fromPointer(p));
},
);
}