通过Rightscripts安装OpenCV和FFMPEG时出现错误 [英] Errors while installing OpenCV and FFMPEG through Rightscripts

查看:220
本文介绍了通过Rightscripts安装OpenCV和FFMPEG时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am writing a RightScript to install OpenCV-2.3.1 on a linux server. I am using FFMPEG package: ffmpeg-0.7-rc1

我正在做任何我在服务器上手动安装的操作,但是我收到一些错误当我尝试使用右脚本启动框。 OpenCV安装并通过bash手动构建时工作正常。

I am doing exactly whatever I did while installing it manually on the server, but am getting some errors when I try booting the box using the rightscripts. OpenCV installs and works fine when built manually through bash.

我收到的错误是:

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安装时才会收到这些错误。

I did a google search and I understand that some of the FFMPEG functions are deprecated now. I have tried installing the latest FFMPEG package as well, and I am getting the same errors. Also, I am wondering why I don't get these errors when I install it manually on the server via bash, and only when I install using Rightscripts.

推荐答案

使用FFMPEG软件包ffmpeg-0.8解决了这个问题。它适用于OpenCV-2.3.1
最近有一些FFMPEG的修复引起了一些冲突。 ffmpeg-0.8是稳定的,工作正常。

Using FFMPEG package ffmpeg-0.8 solves the issue. It works fine with OpenCV-2.3.1 There has been a number of recent fixes to FFMPEG that is giving rise to some clashes. ffmpeg-0.8 is stable and works fine.

这篇关于通过Rightscripts安装OpenCV和FFMPEG时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆