justadudewhohacks / justadudewhohacks/opencv4nodejs

OpenCV: FFMPEG: tag 0x7634706d/'mp4v' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'

Open
#840 0 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

# Error Message

```
# node video_decoder.js
OpenCV: FFMPEG: tag 0x7634706d/'mp4v' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x00000020/' ???'
decode end, exiting.
```

# Manual Build - Environment Information

source code( video_decoder.js ):
```
const cv = require('opencv4nodejs');

const grabFrames = (videoFile, delay, onFrame) => {
const cap = new cv.VideoCapture(videoFile);
let done = false;
const intvl = setInterval(() => {
let frame = cap.read();
// loop back to start on end of stream reached
if (frame.empty) {
cap.reset();
//frame = cap.read();
clearInterval(intvl);
console.log('decode end, exiting.');
}
onFrame(frame);

const key = cv.waitKey(delay);
done = key !== -1 && key !== 255;
if (done) {
clearInterval(intvl);
console.log('Key pressed, exiting.');
}

}, 0);
};

let fps = 24
//let fourcc = cv.VideoWriter.fourcc('X264');
let fourcc = cv.VideoWriter.fourcc('mp4v');
let videoWriter = new cv.VideoWriter('testVideo.mp4', fourcc, fps, new cv.Size(640, 360))

let count = 0;
const delay = 50;
grabFrames('../data/traffic.mp4', delay, (frame) => {
count++;
cv.imwrite(__dirname + `/../archive/video/frame_${count}.jpg`, frame);
videoWriter.write(frame);
});

videoWriter.release();
```

*OpenCV version* : 3.4.1

*With OpenCV-contrib?* (extra modules): yes/no?

*OS*: Ubuntu14.04

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.