OpenCV给我“找不到Moov原子”,但视频在VLC上播放

时间:2019-12-25 21:28:12

标签: opencv video video-processing opencv4nodejs

我正在做一个程序,该程序会自动下载Reddit的一些视频,并在使用OpenCV进行一些处理之后。问题是,当我尝试使用VideoCapture对象加载视频时,未创建该对象,并且出现以下错误:

[mov,mp4,m4a,3gp,3g2,mj2 @ 00000217e21f2800] moov atom not found
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
warning: app/res/extractor/cache/e3ecb6f0-275b-11ea-8299-732e4fb91847-video.mp4 (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
(node:16256) UnhandledPromiseRejectionWarning: VideoCapture::New - failed to open capture
(node:16256) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:16256) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

该视频似乎未损坏,因为我可以使用VLC正常播放该视频。

这是我用来加载视频的打字稿代码:

const video = new cv.VideoCapture(videoRef.localUrl);

如何摆脱这个错误?


OBS::我正在将opencv4nodejs用于带有打字稿的节点。

0 个答案:

没有答案