Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Main Support Categories > Multimedia & Video
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Multimedia & Video
Have multimedia question? ATI, Nvidia, Sound cards. Just ask here.

 
Thread Tools Display Modes
Old May 1st, 2009   #1
Sjeti
Just Give Me the Beans!
 
Join Date: Nov 2008
Location: Baton Rouge, LA
Beans: 63
Ubuntu 9.04 Jaunty Jackalope
No video I/O with OpenCV

I have either downloaded from the repositories, or compiled from source almost anything related to xine, gstreamer, or ffmpeg.

However, no matter what I do I can not for the life of me get the configure on OpenCV to recognize any of these formats. I have downloaded all the dev files and/or installed the package from source, yet I can still not get any to work.

Anyone have any suggestions? How can I get my openCV to read .avi files?

Edit: I am compiling opencv-1.1.0. 1.0 also did not recognize anything.

Last edited by Sjeti; May 1st, 2009 at 12:28 AM..
Sjeti is offline   Reply With Quote
Old May 1st, 2009   #2
Sjeti
Just Give Me the Beans!
 
Join Date: Nov 2008
Location: Baton Rouge, LA
Beans: 63
Ubuntu 9.04 Jaunty Jackalope
Re: No video I/O with OpenCV

So I bothered to read through the config file and it seems I need to specify --with-gstreamer. Trying this now.
Sjeti is offline   Reply With Quote
Old May 1st, 2009   #3
Sjeti
Just Give Me the Beans!
 
Join Date: Nov 2008
Location: Baton Rouge, LA
Beans: 63
Ubuntu 9.04 Jaunty Jackalope
Re: No video I/O with OpenCV

It still doesn't seem read my .avi files....maybe the code is wrong? :

Code:
int main( int argc, char** argv ) {
    cvNamedWindow( "Example3", CV_WINDOW_AUTOSIZE );
    g_capture = cvCreateFileCapture(argv[1]);
    int frames = (int)cvGetCaptureProperty(g_capture,CV_CAP_PROP_FRAME_COUNT);
    if (frames != 0) {
      cvCreateTrackbar("Position","Example3",&g_slider_position,frames,onTrackbarSlide);
    }
    IplImage* frame;
    while(1) {
	frame=cvQueryFrame(g_capture);
        if( !frame ) break;
        cvShowImage( "Example3", frame );
        char c = cvWaitKey(33);
        if( c == 27 ) break;
    }
    cvReleaseCapture( &g_capture );
    cvDestroyWindow( "Example3" );
    return(0);
}
Just some stuff out of the OpenCV tutorial.
Sjeti is offline   Reply With Quote
Old May 1st, 2009   #4
Sjeti
Just Give Me the Beans!
 
Join Date: Nov 2008
Location: Baton Rouge, LA
Beans: 63
Ubuntu 9.04 Jaunty Jackalope
Re: No video I/O with OpenCV

No luck. I tried using xine but there is an error in OpenCV's code converting int to const *char. It won't include quicktime even if I specify it.
Sjeti is offline   Reply With Quote
Old May 1st, 2009   #5
dieklaue
First Cup of Ubuntu
 
Join Date: Oct 2008
Beans: 1
Re: No video I/O with OpenCV

It's a know bug, see https://bugs.launchpad.net/ubuntu/+s...cv/+bug/311188

The problem is that the location of the ffmpeg headers has changed in Jaunty; OpenCV's ./configure-script just outputs a warning (see your config.log an grep for 'ffmpeg') an compiles without ffmpeg support.

HTH, Johannes
dieklaue is offline   Reply With Quote
Old May 2nd, 2009   #6
Sjeti
Just Give Me the Beans!
 
Join Date: Nov 2008
Location: Baton Rouge, LA
Beans: 63
Ubuntu 9.04 Jaunty Jackalope
Re: No video I/O with OpenCV

Thanks, I'm trying to install it with ffmpeg now, it recongnized it on ./configure.
Sjeti is offline   Reply With Quote
Old May 2nd, 2009   #7
Sjeti
Just Give Me the Beans!
 
Join Date: Nov 2008
Location: Baton Rouge, LA
Beans: 63
Ubuntu 9.04 Jaunty Jackalope
Re: No video I/O with OpenCV

It worked, I'm just getting an error doing the make install and I can't seem to figure it out.

I've used -fPIC to install my ffmpeg files as well as the openCV files, yet I still get this error:

Code:
libtool: install: warning: relinking `libhighgui.la'
(cd /home/del/Source/opencv-1.1.0/otherlibs/highgui; /bin/bash ../../libtool  --tag=CXX --mode=relink g++ -Wall -fno-rtti -pipe -O3 -g -msse2 -no-undefined -version-info 2:0:0 -o libhighgui.la -rpath /usr/local/lib dummy.lo lib_highgui.la ../../cxcore/src/libcxcore.la ../../cv/src/libcv.la -pthread -lgthread-2.0 -lrt -lglib-2.0 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgdk_pixbuf-2.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lpng12 -ljpeg -lz -lm -ltiff -ljasper -lavcodec -lavformat -lswscale -lavformat -lavcodec -lpthread -ldl -lm )  
g++ -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtbeginS.o  .libs/dummy.o -Wl,--whole-archive ./.libs/lib_highgui.a -Wl,--no-whole-archive  -L/usr/local/lib -lcxcore -lcv -L/usr/lib -lgthread-2.0 -lrt -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgio-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgdk_pixbuf-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lpng12 -ljpeg -lz -ltiff -ljasper -lswscale -lavformat -lavcodec -lpthread -ldl -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.3.3/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/crtn.o  -msse2 -pthread -Wl,-soname -Wl,libhighgui.so.2 -o .libs/libhighgui.so.2.0.0
/usr/bin/ld: /usr/local/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against `aac_demuxer' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavformat.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
libtool: install: error: relink `libhighgui.la' with the above command before installing it
make[3]: *** [install-libLTLIBRARIES] Error 1
make[3]: Leaving directory `/home/del/Source/opencv-1.1.0/otherlibs/highgui'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/del/Source/opencv-1.1.0/otherlibs/highgui'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/del/Source/opencv-1.1.0/otherlibs'
make: *** [install-recursive] Error 1
Not entirely sure what I changed up because I've been able to install this before.
Sjeti is offline   Reply With Quote
Old May 3rd, 2009   #8
gijzelaerr
First Cup of Ubuntu
 
Join Date: May 2009
Location: Amsterdam
Beans: 2
Re: No video I/O with OpenCV

hi everyone,

I sort of fixed the problem.

Bug report:
* https://bugs.launchpad.net/ubuntu/+s...cv/+bug/311188

patch:
* http://launchpadlibrarian.net/262845...st_ffmpeg.diff

PPA with working packages:
* https://launchpad.net/~gijzelaar/+archive/opencv

Easy installation instructions
* http://gijs.pythonic.nl/blog/2009/ma...buntu-jaunty-/

I also moved my opencv python ctypes packages to this repository. Note that the PPA build queue is quite long today so it can take some time before the packages show up.

If you have any questions let me know,

--
Gijs Molenaar
http://gijs,pythonic.nl
gijzelaerr is offline   Reply With Quote
Old May 4th, 2009   #9
Sjeti
Just Give Me the Beans!
 
Join Date: Nov 2008
Location: Baton Rouge, LA
Beans: 63
Ubuntu 9.04 Jaunty Jackalope
Re: No video I/O with OpenCV

....I think I love you.


It works perfectly, thanks for the patch.
Sjeti is offline   Reply With Quote
Old July 3rd, 2009   #10
guja
First Cup of Ubuntu
 
guja's Avatar
 
Join Date: Nov 2007
Location: Novi Sad, Serbia
Beans: 10
Ubuntu Jaunty Jackalope (testing)
Send a message via MSN to guja Send a message via Yahoo to guja Send a message via Skype™ to guja
Re: No video I/O with OpenCV

Can you please send me how to install openCV on Ubuntu Jaunty?

I am totally depressed and haven't manage for 2 days to make it work.

Please give some step-by-step tutorial!

Thanks in advance!
__________________
Life's a big char so just sit & enjoy.
guja is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:59 AM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry