-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
bugSomething isn't workingSomething isn't working
Description
VideoWriter.fromFile seems not working?
following code:
` Future processVideo(String filePath,String destFolder) async{
cv.VideoCapture cap = cv.VideoCapture.fromFile(filePath);
double width = cap.get(cv.CAP_PROP_FRAME_WIDTH);
double height = cap.get(cv.CAP_PROP_FRAME_HEIGHT);
double fps = cap.get(cv.CAP_PROP_FPS);
String newFilePath = PathUtils.join(destFolder,"processed_${PathUtils.basename(filePath)}");
File f = File(newFilePath);
if(!f.existsSync()){
f.createSync(recursive: true);
}
cv.VideoWriter writer = cv.VideoWriter.fromFile(newFilePath,"MP4V", fps, (width.toInt(),height.toInt()));
while(cap.isOpened){
var (success, frame) = cap.read();
if(!success){
break;
}
if(frame.isEmpty){
print("empty frame");
}
else {
await writer.writeAsync(frame);
}
}
writer.release();
if(f.existsSync()){
int len = await f.length();
print(len);
}
return newFilePath;
}
`
file should not be empty, I have checked that await writer.writeAsync(frame); is called and frames are not empty
Android 14
Any idea?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working