linux - 通过 Rightscripts 安装 OpenCV 和 FFMPEG 时出错

标签 linux ubuntu opencv ffmpeg rightscale

我正在编写一个 RightScript 以在 Linux 服务器上安装 OpenCV-2.3.1。 我正在使用 FFMPEG 包:ffmpeg-0.7-rc1

我正在做我在服务器上手动安装时所做的一切,但是当我尝试使用正确的脚本启动盒子时遇到一些错误。通过 bash 手动构建时,OpenCV 可以安装并正常工作。

我遇到的错误是:

In file included from /OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:45:
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function 'void CvCapture_FFMPEG::close()':
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:451: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1533)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:451: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1533)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function 'bool CvCapture_FFMPEG::reopen()':
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:483: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1533)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:483: warning: 'void av_close_input_file(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1533)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:486: error: 'av_open_input_file' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:487: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1357)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:487: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1357)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:494: error: 'avcodec_thread_init' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:497: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3380)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:497: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3380)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function 'bool CvCapture_FFMPEG::open(const char*)':
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:524: error: 'av_open_input_file' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:529: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1357)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:529: warning: 'int av_find_stream_info(AVFormatContext*)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1357)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:541: error: 'avcodec_thread_init' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:550: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3380)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:550: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3380)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In function 'AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*, CodecID, int, int, int, double, int)':
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:999: warning: 'AVStream* av_new_stream(AVFormatContext*, int)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1557)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:999: warning: 'AVStream* av_new_stream(AVFormatContext*, int)' is deprecated (declared at /usr/local/include/libavformat/avformat.h:1557)
In file included from /OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg.cpp:45:
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In function 'int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, uint8_t*, uint32_t, AVFrame*)':
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1121: warning: 'int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const AVFrame*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4077)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1121: warning: 'int avcodec_encode_video(AVCodecContext*, uint8_t*, int, const AVFrame*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4077)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function 'void CvVideoWriter_FFMPEG::close()':
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1298: error: 'url_fclose' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function 'bool CvVideoWriter_FFMPEG::open(const char*, int, double, int, int, bool)':
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1411: error: 'av_set_parameters' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1415: error: 'dump_format' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1442: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3380)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1442: warning: 'int avcodec_open(AVCodecContext*, AVCodec*)' is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:3380)
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1479: error: 'URL_WRONLY' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1479: error: 'url_fopen' was not declared in this scope
/OpenCV-2.3.1/modules/highgui/src/cap_ffmpeg_impl.hpp:1485: error: 'av_write_header' was not declared in this scope
20:09:04: make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.o] Error 1
20:09:04: make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
20:09:04: make: *** [all] Error 2
20:09:04: cd: 23: can't cd to /root/OpenCV-2.3.1/samples/c
20:09:04: chmod: cannot access `build_all.sh': No such file or directory
20:09:04: /var/cache/rightscale/right_scripts/right_scripts_cookbook/recipes/CVScripts___Install_OpenCV: 25: ./build_all.sh: not found
*ERROR> Chef converge failed
*ERROR> An external command returned an error during the execution of Chef:

我进行了谷歌搜索,我了解到一些 FFMPEG 功能现在已被弃用。我也尝试安装最新的 FFMPEG 包,但遇到了同样的错误。另外,我想知道为什么当我通过 bash 在服务器上手动安装它时不会出现这些错误,并且仅当我使用 Rightscripts 安装时才出现这些错误。

最佳答案

使用 FFMPEG 包 ffmpeg-0.8 解决了该问题。它与 OpenCV-2.3.1 配合良好 最近对 FFMPEG 进行了一些修复,导致了一些冲突。 ffmpeg-0.8 稳定且工作正常。

关于linux - 通过 Rightscripts 安装 OpenCV 和 FFMPEG 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11024843/

相关文章:

c - C 中的消息队列 : implementing 2 way comm

ubuntu - NEXT-AUTH -/api/auth/signin 上的 500 内部服务器错误,无法访问实时站点上的登录页面

linux - Bash 中的输出格式

python - 无法在 Linux Mint 18.2 Cinnamon 64 位的 Anaconda Navigator 中打开 Spyder

python - 错误-215 trainDescCollection [iIdx] Python OpenCV

c++ - 视频处理OpenCV?

linux - mysqld 无法启动,Angstrom 中缺少/etc/default/rcS

使用不同的端口连接到 tcp 服务器。不是 set.c 语言的端口

php - 如何在php中显示系统正常运行时间?

c++ - 我应该如何着手实现用于黑白和彩色图像的算法?