Ask Your Question

Revision history [back]

Errors while building customised ffmpeg4.1 with libopencv_highgui-dev

I am building mu customised ffmpeg4.1 version. I am using cvLoadImage and some other opencv functions in my code, so I linked highgui-dev library as -lopencv_highgui in my Makefile. As we know that ffmpeg4.1 needs libavcodec.so.58 and other related libraries(newest). I updated the libopencv-highgui-dev, libopencv_core-dev and libopencv_imgproc-dev libraries. When I run the makefile I got the following errors

/usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to sws_getCachedContext@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_find_encoder@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_free@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_encode_video2@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_seek_frame@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_lockmgr_register@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avcodec_decode_video2@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_open2@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_malloc@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavio_close@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_init_packet@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_log_set_level@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avpicture_get_size@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavformat_get_riff_video_tags@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_close_input@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavpicture_fill@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_network_init@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavformat_find_stream_info@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avcodec_close@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_guess_codec@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avio_open@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_guess_format@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_open_input@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_register_all@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to sws_getContext@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavformat_new_stream@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_frame_free@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_sub_q@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_freep@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_find_decoder@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to sws_freeContext@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference tosws_scale@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_alloc_context@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_read_frame@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_codec_get_id@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_flush_buffers@LIBAVCODEC_57' collect2: error: ld returned 1 exit status make: * [new-ffmpeg] Error 1

I have clearly linked the newest libraries and included them in my makefile. Errors list suggesting me that, libopencv-highgui.so is pointing to libavcodec.57 version api's. Has opencv not upgraded to support libavXX.so.58 libs? or am I doing anything wrong here.

Can we link this libopencv_highgui library to point to libavXX.so.58(newer libs)? or should I need to compile and build the binaries of libopencv_highgui with libav newer libraries? Is it possible?

Please help me with this, or any suggestions would be helpful.

Errors while building customised ffmpeg4.1 with libopencv_highgui-dev

I am building mu customised ffmpeg4.1 version. I am using cvLoadImage and some other opencv functions in my code, so I linked highgui-dev library as -lopencv_highgui in my Makefile. As we know that ffmpeg4.1 needs libavcodec.so.58 and other related libraries(newest). I updated the libopencv-highgui-dev, libopencv_core-dev and libopencv_imgproc-dev libraries. When I run the makefile I got the following errors

/usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to sws_getCachedContext@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_find_encoder@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_free@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_encode_video2@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_seek_frame@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_lockmgr_register@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avcodec_decode_video2@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_open2@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_malloc@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavio_close@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_init_packet@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_log_set_level@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avpicture_get_size@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavformat_get_riff_video_tags@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_close_input@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavpicture_fill@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_network_init@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavformat_find_stream_info@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avcodec_close@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_guess_codec@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avio_open@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_guess_format@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_open_input@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_register_all@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to sws_getContext@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavformat_new_stream@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_frame_free@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_sub_q@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_freep@LIBAVUTIL_55' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_find_decoder@LIBAVCODEC_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to sws_freeContext@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference tosws_scale@LIBSWSCALE_4' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to avformat_alloc_context@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toav_read_frame@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference to av_codec_get_id@LIBAVFORMAT_57' /usr/lib/x86_64-linux-gnu/libopencv_highgui.so: undefined reference toavcodec_flush_buffers@LIBAVCODEC_57' collect2: error: ld returned 1 exit status make: * [new-ffmpeg] Error 1

I have clearly linked the newest libraries and included them in my makefile. Errors list suggesting me that, libopencv-highgui.so is pointing to libavcodec.57 version api's. Has opencv not upgraded to support libavXX.so.58 libs? or am I doing anything wrong here.

Can we link this libopencv_highgui library to point to libavXX.so.58(newer libs)? or should I need to compile and build the binaries of libopencv_highgui with libav newer libraries? Is it possible?

Please help me with this, or any suggestions would be helpful.