justadudewhohacks / justadudewhohacks/opencv4nodejs

Video files is not output in VideoWriter

Open
#714 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5.1k
Forks
826
PR merge metrics
No merged PRs in 30d

Description

Note: I'm a non-native English speaker, so I'm using machine translation.

No error message.
*OpenCV version* (example 3.4.1): 5.5.0
*With OpenCV-contrib?* (extra modules): no
*OS*: Windows 7 / 8 / 10? / MacOSX? / Ubuntu? : LinuxMint Ver 19.3.

I have created this code to create a video from an image.
When I execute this code, no error message, but I don't output "out.mp4".
What's wrong with this code? Am I using it wrong?

```NODE.js
const cv4n = require('opencv4nodejs');
const fs = require('fs');

const sz= new cv4n.Size(500, 500);
let video = new cv4n.VideoWriter("./out.mp4",cv4n.VideoWriter.fourcc("mp4v"), 10, sz, true);

let text = fs.readFileSync("file.list"); // use image file list
let lines = text.toString().split('\n');

for(var i = 0; i < lines.length; i++){
let pass = "./" + lines[i];
let img = cv4n.imread(pass);
video.write(img);
}
video.release();
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.