Results 1 to 9 of 9

Thread: Compile Errors from OpenCV with ffmpeg + x264

  1. #1
    Join Date
    May 2011
    Beans
    3

    Question Compile Errors from OpenCV with ffmpeg + x264

    Dear My Friends,

    I am trying to compile OpenCV 2.0 with ffmpeg (with x264) support on my Ubuntu 11.04 64-bit machine. (Since I want to use the binaries provided by other developers, I have to use opencv 2.0 version)

    I followed the guide from: http://ubuntuforums.org/showthread.php?t=786095 to compile x264 and ffmpeg manually, and succeeded.

    Then I followed the guide in the INSTALL file provided by the OpenCV 2.0 package. I use CMake to configure and generate them, and use "make" command to try compiling. However, I got the following error report, which haunted me for almost half a week.

    Code:
    Linking CXX static library ../../lib/libhighgui_pch_dephelp.a
    [ 71%] Built target highgui_pch_dephelp
    Scanning dependencies of target pch_Generate_highgui
    [ 71%] Generating _highgui.h
    [ 71%] [COLOR="rgb(65, 105, 225)"]Generating _highgui.h.gch/highgui_Release.gch[/COLOR]
    [ 72%] Built target pch_Generate_highgui
    [COLOR="rgb(153, 50, 204)"]Scanning dependencies of target highgui[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_images.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/image.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/loadsave.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/precomp.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/utils.o[/COLOR]
    [ 74%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/window.o[/COLOR]
    [ 74%] Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o
    In file included from /usr/local/include/libavutil/avutil.h:119:0,
                     from /usr/local/include/libavutil/samplefmt.h:22,
                     from /usr/local/include/libavcodec/avcodec.h:30,
                     from /usr/local/include/libavformat/avformat.h:42,
                     from /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:97:
    /usr/local/include/libavutil/common.h: In function ‘int32_t av_clipl_int32_c(int64_t)’:
    /usr/local/include/libavutil/common.h:170:47: error: ‘UINT64_C’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::open(const char*)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:467:13: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::grabFrame()’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:548:54: error: ‘avcodec_decode_video’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘const char* icvFFMPEGErrStr(int)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:790:10: error: ‘AVERROR_NUMEXPECTED’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:794:10: error: ‘AVERROR_NOFMT’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:796:10: error: ‘AVERROR_IO’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:798:10: error: ‘AVERROR_NOMEM’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*, CodecID, int, int, int, double, int)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:883:70: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, uint8_t*, uint32_t, AVFrame*)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:982:22: error: ‘PKT_FLAG_KEY’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1002:30: error: ‘PKT_FLAG_KEY’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual void CvVideoWriter_FFMPEG::close()’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1162:3: warning: ‘int url_fclose(AVIOContext*)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1162:20: warning: ‘int url_fclose(AVIOContext*)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1199:41: error: ‘guess_format’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1213:31: error: ‘av_alloc_format_context’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1270:9: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1334)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1270:35: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1334)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1274:5: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1434)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1274:35: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1434)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1336:13: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1336:52: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
    make[2]: *** [src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o] Error 1
    make[1]: *** [src/highgui/CMakeFiles/highgui.dir/all] Error 2
    make: *** [all] Error 2
    For you further information, I have used the latest code from x264 and ffmpeg git, and opencv2.0 from sourceforge.net

    I have googled for a while but just cannot find a right solution to me. I know this similar compiling errors have been posted for many times, but different versions might have different fixes. So I hope any of you could help in this. Thank you in advance.

    Regards,
    Jingming

  2. #2
    Join Date
    May 2011
    Beans
    3

    Re: Compile Errors from OpenCV with ffmpeg + x264

    It seems some tags in the code segments are not displayed correctly. Plz ignore the tags like [COLOR="***"][/COLOR]. Thank you.

  3. #3
    Join Date
    May 2011
    Beans
    3

    Re: Compile Errors from OpenCV with ffmpeg + x264

    Is there anyone who can help on this?

  4. #4
    Join Date
    Dec 2009
    Beans
    3

    Re: Compile Errors from OpenCV with ffmpeg + x264

    Hi
    I have the same error and don't know what to do.

  5. #5
    Join Date
    Dec 2009
    Beans
    3

    Re: Compile Errors from OpenCV with ffmpeg + x264

    I installed OpenCV on 10.4 with out any errors.

  6. #6
    Join Date
    Oct 2009
    Beans
    7

    Re: Compile Errors from OpenCV with ffmpeg + x264

    I am also stuck in the same error. Were you able to solve it ?
    Any help or pointers regarding this will be very useful.

    Regards,
    Hrushikesh

    Quote Originally Posted by wind_field View Post
    Dear My Friends,

    I am trying to compile OpenCV 2.0 with ffmpeg (with x264) support on my Ubuntu 11.04 64-bit machine. (Since I want to use the binaries provided by other developers, I have to use opencv 2.0 version)

    I followed the guide from: http://ubuntuforums.org/showthread.php?t=786095 to compile x264 and ffmpeg manually, and succeeded.

    Then I followed the guide in the INSTALL file provided by the OpenCV 2.0 package. I use CMake to configure and generate them, and use "make" command to try compiling. However, I got the following error report, which haunted me for almost half a week.

    Code:
    Linking CXX static library ../../lib/libhighgui_pch_dephelp.a
    [ 71%] Built target highgui_pch_dephelp
    Scanning dependencies of target pch_Generate_highgui
    [ 71%] Generating _highgui.h
    [ 71%] [COLOR="rgb(65, 105, 225)"]Generating _highgui.h.gch/highgui_Release.gch[/COLOR]
    [ 72%] Built target pch_Generate_highgui
    [COLOR="rgb(153, 50, 204)"]Scanning dependencies of target highgui[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_images.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/image.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/loadsave.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/precomp.o[/COLOR]
    [ 73%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/utils.o[/COLOR]
    [ 74%] [COLOR="rgb(46, 139, 87)"]Building CXX object src/highgui/CMakeFiles/highgui.dir/window.o[/COLOR]
    [ 74%] Building CXX object src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o
    In file included from /usr/local/include/libavutil/avutil.h:119:0,
                     from /usr/local/include/libavutil/samplefmt.h:22,
                     from /usr/local/include/libavcodec/avcodec.h:30,
                     from /usr/local/include/libavformat/avformat.h:42,
                     from /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:97:
    /usr/local/include/libavutil/common.h: In function ‘int32_t av_clipl_int32_c(int64_t)’:
    /usr/local/include/libavutil/common.h:170:47: error: ‘UINT64_C’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::open(const char*)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:467:13: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvCapture_FFMPEG::grabFrame()’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:548:54: error: ‘avcodec_decode_video’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘const char* icvFFMPEGErrStr(int)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:790:10: error: ‘AVERROR_NUMEXPECTED’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:794:10: error: ‘AVERROR_NOFMT’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:796:10: error: ‘AVERROR_IO’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:798:10: error: ‘AVERROR_NOMEM’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*, CodecID, int, int, int, double, int)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:883:70: error: ‘CODEC_TYPE_VIDEO’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, uint8_t*, uint32_t, AVFrame*)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:982:22: error: ‘PKT_FLAG_KEY’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1002:30: error: ‘PKT_FLAG_KEY’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual void CvVideoWriter_FFMPEG::close()’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1162:3: warning: ‘int url_fclose(AVIOContext*)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1162:20: warning: ‘int url_fclose(AVIOContext*)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:280)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp: In member function ‘virtual bool CvVideoWriter_FFMPEG::open(const char*, int, double, CvSize, bool)’:
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1199:41: error: ‘guess_format’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1213:31: error: ‘av_alloc_format_context’ was not declared in this scope
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1270:9: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1334)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1270:35: warning: ‘int av_set_parameters(AVFormatContext*, AVFormatParameters*)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1334)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1274:5: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1434)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1274:35: warning: ‘void dump_format(AVFormatContext*, int, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avformat.h:1434)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1336:13: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
    /home/jimmy/OpenCV-2.0.0/src/highgui/cvcap_ffmpeg.cpp:1336:52: warning: ‘int url_fopen(AVIOContext**, const char*, int)’ is deprecated (declared at /usr/local/include/libavformat/avio.h:279)
    make[2]: *** [src/highgui/CMakeFiles/highgui.dir/cvcap_ffmpeg.o] Error 1
    make[1]: *** [src/highgui/CMakeFiles/highgui.dir/all] Error 2
    make: *** [all] Error 2
    For you further information, I have used the latest code from x264 and ffmpeg git, and opencv2.0 from sourceforge.net

    I have googled for a while but just cannot find a right solution to me. I know this similar compiling errors have been posted for many times, but different versions might have different fixes. So I hope any of you could help in this. Thank you in advance.

    Regards,
    Jingming

  7. #7
    Join Date
    Feb 2008
    Beans
    16

    Re: Compile Errors from OpenCV with ffmpeg + x264

    still would like help on this topic!
    i have the same error!

  8. #8
    Join Date
    Sep 2011
    Beans
    1

    Re: Compile Errors from OpenCV with ffmpeg + x264

    I'm having the same problem... Did anyone solve it?

  9. #9
    Join Date
    Oct 2011
    Beans
    1

    Re: Compile Errors from OpenCV with ffmpeg + x264

    Had the same problem under Debian. Solved installing the 0.8.x ffmpeg http://ffmpeg.org/download.html

    https://code.ros.org/trac/opencv/ticket/1020

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •