我在Ubuntu 14.04上使用OpenCV 2.4.8来阅读一些MP4视频。该程序可以在Mac和其他Linux机器上运行,但是由于某些原因,当我编译并运行该程序时,在退出之前会给我这些错误:

[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
[h264 @ 0x1d0dcc0] missing picture in access unit
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d0dcc0] decode_slice_header error
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1d8a5c0] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
Non-reference picture received and no reference available
[h264 @ 0x1cf8f40] decode_slice_header error
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit
[h264 @ 0x1d0dcc0] missing picture in access unit

正在文件中读取的代码的主要部分看起来像这样(它们在某些方法之间是分开的,所以我包括了完成打开和读取框架的所有工作的代码行:
cv::VideoCapture cap;
cap.open (input_path);
success = cap.read (data.frames[i]);

有谁知道我如何让我的程序正确阅读这些视频?我试图添加“cap.set(CV_CAP_PROP_FOURCC,CV_FOURCC('H','2','6','4'));“在“cap.open”之前,但似乎不起作用。

最佳答案

根据我的经验,最简单的解决方案是转换为.avi
无法像.avi一样简单地处理mp4文件似乎是opencv的错

关于c++ - OpenCV无法读取MP4视频,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32479249/

10-12 17:03