问题描述
我正在根据说明.我安装了所有提到的依赖项,但是当我尝试运行make
时,出现了这样的错误:
I'm trying to install OpenCV in Ubuntu 14.10 according to instruction.I installed all mentioned dependencies, but when I'm trying to run make
I get such errors:
/home/ilia/opencv-2.4.8/modules/highgui/src/ffmpeg_codecs.hpp:114:7: error: ‘CODEC_ID_H261’ was not declared in this scope
{ CODEC_ID_H261, MKTAG('H', '2', '6', '1') }
我认为,对于所有编解码器,
.这些错误:
for all codecs, as I think.And these errors:
In file included from /home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg.cpp:45:0:
/home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::getProperty(int)’:
/home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg_impl.hpp:773:33: error: ‘AVStream’ has no member named ‘r_frame_rate’
return av_q2d(video_st->r_frame_rate);
^
/home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::get_fps()’:
/home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg_impl.hpp:820:49: error: ‘AVStream’ has no member named ‘r_frame_rate’
double fps = r2d(ic->streams[video_stream]->r_frame_rate);
^
In file included from /home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg.cpp:45:0:
/home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg_impl.hpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, uint8_t*, uint32_t, AVFrame*)’:
/home/ilia/opencv-2.4.8/modules/highgui/src/cap_ffmpeg_impl.hpp:1236:72: error: ‘avcodec_encode_video’ was not declared in this scope
out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
^
看起来找不到一些头文件,但是我安装了所有必需的dev软件包libswscale-dev,libavdevice-dev,libavfilter-dev,libavformat-dev,libavcodec-dev.我该怎么办才能解决这些问题?
It looks like it can not find some header files, but I installed all necessary dev packageslibswscale-dev, libavdevice-dev, libavfilter-dev, libavformat-dev, libavcodec-dev. What should I do to resolve these problems?
推荐答案
除非有特殊原因,否则我建议安装Ubuntu存储库中已经存在的OpenCV:sudo apt-get install libopencv-dev
Unless you have special reasons I would suggest installing the OpenCV that are already in the Ubuntu repository: sudo apt-get install libopencv-dev
对于视频编解码器,我建议您仅尝试安装所有与ffmpeg和gstreamer相关的编解码器软件包.
For video codecs I suggest simply trying to install all ffmpeg and gstreamer related codec packages.
这篇关于在Ubuntu 14.10中安装OpenCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!