LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-07-2019, 11:09 AM   #1
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 13.1,13.37,14.0,14.1,14.2 64 and 32bit and arm
Posts: 299

Rep: Reputation: 78
Question ffmpeg can't find opencv


i'm running on fully patched slackware 14.2 64bit.
the ffmpeg slackbuild is complaining that pkg-config can't find opencv
Code:
patching file configure
patching file libavcodec/libopenjpegdec.c
patching file libavcodec/libopenjpegenc.c
patching file libavcodec/libfdk-aacenc.c
ERROR: opencv not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.
it is actually called opencv4.pc in /usr/lib64/pkgconfig/
but I have tried copying opencv4.pc renaming it opencv.pc, but that didn't work. I also tried replacing " opencv " with " opencv4 " in the ffmpeg configure file prior to running it, but that didn't help apart from it complained it couldn't find opencv4 instead of opencv
running
Code:
pkg-config --exists opencv4&&echo "ok"
produces ok as you would expect, and
Code:
pkg-config --list-all|grep opencv
produces
Code:
opencv4                             OpenCV - Open Source Computer Vision Library
so pkgconfig can definitely find opencv4 even if the build script or ffmpeg configure system can't! I had a look at config.log, and tailing the last 17 lines gives
Code:
check_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
pkg-config --exists --print-errors opencv
check_func_headers opencv/cxcore.h cvCreateImageHeader -I/usr/include/opencv4/opencv -I/usr/include/opencv4 -lopencv_gapi -lopencv_stitching -lopencv_videostab -lopencv_structured_light -lopencv_xphoto -lopencv_superres -lopencv_line_descriptor -lopencv_bioinspired -lopencv_rgbd -lopencv_fuzzy -lopencv_hdf -lopencv_cvv -lopencv_xobjdetect -lopencv_phase_unwrapping -lopencv_hfs -lopencv_stereo -lopencv_tracking -lopencv_datasets -lopencv_ml -lopencv_saliency -lopencv_bgsegm -lopencv_aruco -lopencv_ccalib -lopencv_img_hash -lopencv_shape -lopencv_surface_matching -lopencv_reg -lopencv_freetype -lopencv_face -lopencv_photo -lopencv_optflow -lopencv_ximgproc -lopencv_video -lopencv_plot -lopencv_dpm -lopencv_objdetect -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_imgproc -lopencv_flann -lopencv_core
check_ld cc -I/usr/include/opencv4/opencv -I/usr/include/opencv4 -lopencv_gapi -lopencv_stitching -lopencv_videostab -lopencv_structured_light -lopencv_xphoto -lopencv_superres -lopencv_line_descriptor -lopencv_bioinspired -lopencv_rgbd -lopencv_fuzzy -lopencv_hdf -lopencv_cvv -lopencv_xobjdetect -lopencv_phase_unwrapping -lopencv_hfs -lopencv_stereo -lopencv_tracking -lopencv_datasets -lopencv_ml -lopencv_saliency -lopencv_bgsegm -lopencv_aruco -lopencv_ccalib -lopencv_img_hash -lopencv_shape -lopencv_surface_matching -lopencv_reg -lopencv_freetype -lopencv_face -lopencv_photo -lopencv_optflow -lopencv_ximgproc -lopencv_video -lopencv_plot -lopencv_dpm -lopencv_objdetect -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_imgproc -lopencv_flann -lopencv_core
check_cc -I/usr/include/opencv4/opencv -I/usr/include/opencv4
BEGIN /tmp/ffconf.XXzVWgeR.c
    1   #include <opencv/cxcore.h>
    2   #include <stdint.h>
    3   long check_cvCreateImageHeader(void) { return (long) cvCreateImageHeader; }
    4   int main(void) { int ret = 0;
    5    ret |= ((intptr_t)check_cvCreateImageHeader) & 0xFFFF;
    6   return ret; }
END /tmp/ffconf.XXzVWgeR.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -O2 -fPIC -std=c99 -fomit-frame-pointer -fPIC -pthread -I/usr/include/p11-kit-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/bs2b -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/opencv4/opencv -I/usr/include/opencv4 -c -o /tmp/ffconf.XXzsAyaV.o /tmp/ffconf.XXzVWgeR.c
/tmp/ffconf.XXzVWgeR.c:1:27: fatal error: opencv/cxcore.h: No such file or directory
compilation terminated.
ERROR: opencv not found using pkg-config
so it is trying to compile a test program, however /usr/include/opencv4/opencv does not exist (it is /usr/inlcude/opencv4/opencv2) and neither does cxcore.h exist - the nearest thing to it is core.hpp
It appears that the test case for opencv is not applicable to opencv (version 4)
has anyone managed to get ffmpeg compiling with opencv ?
 
Old 01-07-2019, 11:24 AM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 4,567

Rep: Reputation: Disabled
I think (I may be wrong) opencv-4.x is just not usable by ffmpeg as it's too new, so maybe your best option is to avoid passing ffmpeg.SlackBuild the parameter OPENCV=yes
 
Old 01-07-2019, 11:26 AM   #3
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 5,632

Rep: Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389Reputation: 3389
I'm guessing you have opencv v4 installed and that will probably only work with ffmpeg v4. Try installing opencv-legacy from SBo and see if it picks that up. If it does, you may want to ping the maintainer to have him change the optional dependency for opencv to opencv-legacy.
 
Old 01-07-2019, 12:03 PM   #4
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 13.1,13.37,14.0,14.1,14.2 64 and 32bit and arm
Posts: 299

Original Poster
Rep: Reputation: 78
will do. I'll report back on progress (i've uninstalled opencv4 and opencv-legacy is at 14%)
 
Old 01-07-2019, 03:12 PM   #5
timsoft
Member
 
Registered: Oct 2004
Location: scotland
Distribution: slackware 13.1,13.37,14.0,14.1,14.2 64 and 32bit and arm
Posts: 299

Original Poster
Rep: Reputation: 78
well thanks bassmadrigal and ponce for looking. indeed using opencv-legacy for ffmpeg (and frei0r) allows ffmpeg to complete.
After rebuilding frei0r with opencv-legacy, and then building ffmpeg with all options, i rebuilt transcode, then vid.stab and then rebuilt ffmpeg the third time. Now it should pretty much have the kitchen sink!
I'd better let Heinz know that the optional dep for ffmpeg should be opencv-legacy not opencv as it is too new.

in-fact ponce, if you're reading this, as the frei0r slackbuild maintainer, it might be worth mentioning in the frei0r readme that if people are using frei0r with ffmpeg<4 then they probably want to use opencv-legacy instead of opencv for that optional dep.
Of course it has brought to my attention there is ffmpeg4 but I have no idea if that works with audacity or vlc so I'll leave it for now. It's taken long enough for this version.
 
  


Reply

Tags
ffmpeg, opencv


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
install OpenCV Looking for ffmpeg/avformat.h - not found lijing8898 Linux - Software 2 06-18-2012 05:45 AM
OpenCV - Pixel format of incoming image is unsupported by OpenCV golmschenk Programming 1 04-01-2011 01:32 PM
Opencv error: /usr/bin/ld.real: cannot find -lcv; collect2: ld returned 1 exit status Ankithskarat Linux - Newbie 1 03-24-2010 01:03 AM
unable to use configure opencv with ffmpeg srinivasmiriyalu Linux - Newbie 2 10-02-2009 11:29 AM
installing ffmpeg for opencv josemalo Linux - Software 1 02-27-2006 11:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration