Red Hat Bugzilla – Bug 491223
OpenCV rpm has no video read/write capability
Last modified: 2009-07-27 10:58:50 EDT
Description of problem: I would like to use the OpenCV API to read and write video files. The opencv rpm included in fedora is not compiled with any support for video reading and writing.
I have been able to recompile the opencv source rpm with xine support, but this only supports reading videos. There is no support for writing.
OpenCV 1.0 uses an old ffmpeg API img_convert, which prevents it from linking when compiled against newer ffmpeg libraries available from rpmfusion and atrpms.
OpenCV 1.1 pre-release (available from http://sourceforge.net/projects/opencvlibrary) has been modified to work with current ffmpeg libraries. Can you package this version?
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Write a program that calls cvCaptureFromFile
2. Link to libraires in fedora opencv (opencv-devel) rpm
cvCaptureFromFile always returns NULL, because no video reading library was linked with opencv.
A pointer to a CvCapture struct should be returned.
blobtrack.cpp is a good example of a program that requires this.
I have request acl commit for the F-11/devel branch in order to:
-Fix FTBFS for F-11 (#elif without a condition which is a trivial gcc44 restriction)
- Update opencv to 1.1pre1 (formally 1.1.0-0.1.pre1) for F-12
Given that we are on a freeze period, and opencv 1.1.0 is a pre-release, I don't even think of updating it for now. (there is an ABI bump) But opencv 1.1.0 will have gstreamer support, so it will be easier to have read/write support in fedora that way.
Ok, I can wait. Thanks for your response.
This package is built for F-11 from the current src.rpm package in F-12
It has gstreamer support enabled by default which should be capable to enable read/write capability.
Please have it tested , I will close the bug then.
Please pardon my ignorance of the koji system, but where should I get the package that you built for F11? I don't see anywhere to download it at the link you gave.
And nothing shows up here:
I installed the F12 opencv package opencv-1.1.0-0.1.pre1.fc12.1 yesterday (in F11), but I can't install opencv-1.1.0-0.3.pre1.fc12.x86_64 in F11, I get:
error: Failed dependencies:
libc.so.6(GLIBC_2.11)(64bit) is needed by opencv-1.1.0-0.3.pre1.fc12.x86_64
Sorry, that was the wrong link.
This is a private scratch build, so it will disappear later.
That's the same link you gave me before :)
Actually, the link was right; but even if the tag say .fc12, it was meant to be built for F-11 (the dist tag was inherited from the .fc12 src.rpm)
Thanks, I got the package, and I just started checking it out.
I was using the blobtrack demo before, and I noticed that the RPM linked above, opencv-1.1.0-0.3.pre1.fc11.x86_64, provides /usr/lib64/libhighgui.so.2, but the sample applications provided in opencv-devel-1.1.0-0.3.pre1.fc11.x86_64 are linked against libhighgui.so.1 (the old 1.0.0 version).
./blobtrack: error while loading shared libraries: libhighgui.so.1: cannot open shared object file: No such file or directory
I'll rebuild them and report results.
Video reading works using the gstreamer library. You can close the bug report, but please update opencv-devel samples to use libhighgui.so.2.
Thanks very much!
One further note:
Whenever I link with libcxcore.so.2 from the opencv package you provided the linker looks for libavcodec.so.51. I had to copy this library from a F10 ffmpeg-libs package. In F11 rpmfusion provides ffmpeg-libs-0.5-2.fc11.x86_64, which provides libavcodec.so.52.
(In reply to comment #10)
> One further note:
> Whenever I link with libcxcore.so.2 from the opencv package you provided the
> linker looks for libavcodec.so.51. I had to copy this library from a F10
> ffmpeg-libs package. In F11 rpmfusion provides ffmpeg-libs-0.5-2.fc11.x86_64,
> which provides libavcodec.so.52.
That's because they are "ABI incompatible", a rebuild usually is enought to have a compatible version.
Now I'm really far from providing a package built with ffmpeg's libavcodec. Fedora doesn't redistribute such library nor as plan to.
The opencv-devel doesn't provide any binary either. Only docs, headers and a symlinks, so you probably have built blobtrack yourself.
Any other comments providing opencv read/write capability ?!
You were right, I must have built the examples earlier and they weren't erased when I removed the old opencv package. As far as I'm concerned updating F11 to 1.1 with gstreamer support would be great. It works for me.
Okay. So I'm closing the bug to rawhide because updating to 1.1 will introduce an ABI bump.
BTW opencv 1.1 is meant to be updated in few days...