{"id":21,"date":"2019-11-10T10:58:25","date_gmt":"2019-11-10T10:58:25","guid":{"rendered":"http:\/\/blog.edgesmart.co.uk\/?p=21"},"modified":"2020-07-06T22:48:11","modified_gmt":"2020-07-06T21:48:11","slug":"problem-with-cross-compiling-opencv-for-xilinx-zynq-arm-with-ffmpeg-on-ubuntu-linux-os","status":"publish","type":"post","link":"https:\/\/blog.edgesmart.co.uk\/index.php\/2019\/11\/10\/problem-with-cross-compiling-opencv-for-xilinx-zynq-arm-with-ffmpeg-on-ubuntu-linux-os\/","title":{"rendered":"Problem with Cross Compiling OpenCV for Xilinx Zynq &#8211; ARM with FFmpeg on Ubuntu Linux OS"},"content":{"rendered":"\n<p><strong>Problem:<\/strong><\/p>\n\n\n\n<p>I followed the instructions mentioned by Xilinx at&nbsp;http:\/\/www.wiki.xilinx.com\/OpenCV+Installation in order to cross compile the OpenCV-2.4.9 with FFmpeg for Xilinx Zynq Platform on Ubuntu 14.04.<\/p>\n\n\n\n<p>While configuring the FFmpeg, it gave me the following warning:<\/p>\n\n\n\n<p>&#8220;WARNING: arm-xilinx-linux-gnueabi-pkg-config not found, library detection may fail.&#8221;<\/p>\n\n\n\n<p>The FFmpeg did compile ok and generated all the necessary SO files however as a result of the warning when I tried to build the OpenCV-2.4.9, I got errors that&nbsp;libavcodec.so.56, libavformat.so.56 etc FFmpeg libraries are not found.<\/p>\n\n\n\n<p>Following errors while build takes place :<\/p>\n\n\n\n<p>\/usr\/lib\/gcc-cross\/arm-linux-gnueabi\/4.7\/..\/..\/..\/..\/arm-linux-gnueabi\/bin\/ld: warning: libswresample.so.1, needed by opencv\/ffmpeg-2.7.1\/lib\/libavcodec.so.56, not found (try using -rpath or -rpath-link)<br>opencv\/ffmpeg-2.7.1\/lib\/libavcodec.so.56: undefined reference to `swr_close@LIBSWRESAMPLE_1&#8242;<\/p>\n\n\n\n<p>\/opt\/Xilinx\/SDK\/2014.4\/gnu\/arm\/lin\/bin\/..\/lib\/gcc\/arm-xilinx-linux-gnueabi\/4.8.3\/..\/..\/..\/..\/arm-xilinx-linux-gnueabi\/bin\/ld: warning: libswscale.so.3, needed by ..\/..\/lib\/libopencv_highgui.so.2.4.9, not found (try using -rpath or -rpath-link)<br>..\/..\/lib\/libopencv_highgui.so.2.4.9: undefined reference to `avcodec_decode_video2@LIBAVCODEC_56&#8242;<\/p>\n\n\n\n<p><strong>Solution:<\/strong><\/p>\n\n\n\n<p>The way I have manged to resolve this and successfully cross compile OpenCV is by manually copying the SO libs from FFmpeg\/lib folder to the OpenCV\/build\/lib directory and then rerunning the make. After this OpenCV was successfully built.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Problem: I followed the instructions mentioned by Xilinx at&nbsp;http:\/\/www.wiki.xilinx.com\/OpenCV+Installation in order to cross compile the OpenCV-2.4.9 with FFmpeg for Xilinx Zynq Platform on Ubuntu 14.04. While configuring the FFmpeg, it gave me the following warning: &#8220;WARNING: arm-xilinx-linux-gnueabi-pkg-config not found, library detection may fail.&#8221; The FFmpeg did compile ok and generated all the necessary SO files &hellip;<br \/><a href=\"https:\/\/blog.edgesmart.co.uk\/index.php\/2019\/11\/10\/problem-with-cross-compiling-opencv-for-xilinx-zynq-arm-with-ffmpeg-on-ubuntu-linux-os\/\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\">Continue reading <span class=\"screen-reader-text\">Problem with Cross Compiling OpenCV for Xilinx Zynq &#8211; ARM with FFmpeg on Ubuntu Linux OS<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,26,23,25],"tags":[34,33,29,30,28,32],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-cross-compilation","category-linux","category-opencv","category-zynq","tag-cross-compilation","tag-ffmpeg","tag-opencv","tag-opencv-for-zynq","tag-xilinx-zynq","tag-zynq"],"_links":{"self":[{"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":1,"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":22,"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/21\/revisions\/22"}],"wp:attachment":[{"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.edgesmart.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}