Linking FFMPEG to OpenCV 2.3 64bit results in linker errors

For the developers that use FFmpeg in their software.
Post Reply
deuscovrigus
Posts: 2
Joined: Wed May 02, 2012 7:22 pm

Linking FFMPEG to OpenCV 2.3 64bit results in linker errors

Post by deuscovrigus » Wed May 02, 2012 7:30 pm

So I'm using Visual Studio 2010 and I checked out version 2.3 of OpenCV. After I fiddled with the CMakeLists.txt I managed to build the highgui library with FFMPEG support on 32bit. However, if I change the configuration to 64 bit and I attempt to link with the corresponding FFMPEG libraries (http://ffmpeg.zeranoe.com/builds/win64/ ... -shared.7z). I get the following linker errors :

cap_ffmpeg.obj : error LNK2019: unresolved external symbol avcodec_thread_init referenced in function "public: bool __cdecl CvCapture_FFMPEG::reopen(void)" ([email protected][email protected]@QEAA_NXZ)
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol av_open_input_file referenced in function "public: bool __cdecl CvCapture_FFMPEG::reopen(void)" ([email protected][email protected]@QEAA_NXZ)
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol avcodec_decode_video referenced in function "public: bool __cdecl CvCapture_FFMPEG::grabFrame(void)" ([email protected][email protected]@QEAA_NXZ)
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol url_fclose referenced in function "public: void __cdecl CvVideoWriter_FFMPEG::close(void)" ([email protected][email protected]@QEAAXXZ)
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol av_write_header referenced in function "public: bool __cdecl CvVideoWriter_FFMPEG::open(char const *,int,double,int,int,bool)" ([email protected][email protected]@[email protected])
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol url_fopen referenced in function "public: bool __cdecl CvVideoWriter_FFMPEG::open(char const *,int,double,int,int,bool)" ([email protected][email protected]@[email protected])
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol dump_format referenced in function "public: bool __cdecl CvVideoWriter_FFMPEG::open(char const *,int,double,int,int,bool)" ([email protected][email protected]@[email protected])
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol av_set_parameters referenced in function "public: bool __cdecl CvVideoWriter_FFMPEG::open(char const *,int,double,int,int,bool)" ([email protected][email protected]@[email protected])
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol av_alloc_format_context referenced in function "public: bool __cdecl CvVideoWriter_FFMPEG::open(char const *,int,double,int,int,bool)" ([email protected][email protected]@[email protected])
2>cap_ffmpeg.obj : error LNK2019: unresolved external symbol guess_format referenced in function "public: bool __cdecl CvVideoWriter_FFMPEG::open(char const *,int,double,int,int,bool)" ([email protected][email protected]@[email protected])
2>C:\devel\opencv\build\x64\bin\Release\opencv_highgui232.dll : fatal error LNK1120: 10 unresolved externals

are the functions Av_alloc_format_cotext, guess_format, av_set_parameters, av_write_header, etc not implemented on the 64 bit libraries? It seems the linker can't find them in the lib files.

deuscovrigus
Posts: 2
Joined: Wed May 02, 2012 7:22 pm

Re: Linking FFMPEG to OpenCV 2.3 64bit results in linker err

Post by deuscovrigus » Thu May 03, 2012 7:35 pm

I played around a bit I managed to link both 32-bit and 64 bit of an older release (git-1aeb88b).
However, I retried doing both 32 and 64 bit builds for the latest release (git-c1fe2db ) and it gives the same linker errors as above.

Any ideas as to why?

nimcap
Posts: 1
Joined: Wed Jul 18, 2012 12:37 pm

Re: Linking FFMPEG to OpenCV 2.3 64bit results in linker err

Post by nimcap » Wed Jul 18, 2012 12:42 pm

Any progress on the issue? I am having the same problem.

rogerdpack
Posts: 1878
Joined: Fri Aug 05, 2011 9:56 pm

Re: Linking FFMPEG to OpenCV 2.3 64bit results in linker err

Post by rogerdpack » Tue Jul 24, 2012 4:55 am

appears you're maybe no linking against opencv 64 bit libs? (isn't CvCapture_FFMPEG a method of theirs?)

Post Reply
'