Page 1 of 1

Need help on usage of libavcodec

Posted: Tue Dec 20, 2011 3:55 pm
by francesco
Hi to all
I am new in ffmpeg usage. I download the code and compile it under windows using MSYS.
The question at now is : How can I use it ? When I type make it creates an exe file.
I need the library only. The only library I see is (for example) libavcodec.a but, as I know,
*.a extension is for linux libraries. I am attempting to use it with Borland C++ Builder.
There is a documentation regarding ? May be possible that there is a lot of documentation
and no one file that explain how to use it ? Why after compilation in the ffmpg installation
directory there isn't a file with *.lib extension ?
Where I can found documentation regarding ? :shock:
Best regards

Re: Need help on usage of libavcodec

Posted: Thu Dec 22, 2011 10:35 am
by DavidGallagher
may not help if you want to use your own parameters for the build, but what I did was use,(from the "builds" section of this site), the dev and shared version, the dev version has the .libs and the shared has the .dll's of the latest build of ffmpeg.

and don't for get to wrap the headers in C like:(if useing VS C++)

Code: Select all

extern "C" {
	#include <avformat.h>
	#include <avcodec.h>
	#include <swscale.h>
}
sorry if this isn't useful to you but it was alot simpler than building ffmpeg myself :)

Re: Need help on usage of libavcodec

Posted: Wed Jan 11, 2012 6:56 pm
by zouhair
Hello,

Actually I don't have any answer, but I ask David Gallagher:
I have all the lib from the dev and shared version.
I wrote a small program which call av_register_all() function in libavformat,
but when i compile I have an error:
undefined reference to 'av_register_all'
I use the command to get the error:
gcc encodec.exe -c encoder.c -L \Path\to\Lib -lavformat -lavutil

Do you think that there is something wrong with my lids or compiler (MinGW)?
Thanks

Re: Need help on usage of libavcodec

Posted: Fri Jan 13, 2012 1:55 pm
by zouhair
I resolved the problem :mrgreen: .
Actually I have a 64bit processor but I installed MinGW 32 bit :lol: .
And to make it work I had to download the 32bit ffmepg build dev and share.
The command line to compile the program test_AV_Coder.c:
gcc -Wall -g test_AV_Coder.c -I ./include -c -o test_AV_coder.o
gcc -Wall -g test_AV_Coder.o -I ./include -L ./lib -o AV_coder.exe -lavformat -lavcodec -lavutil -lavdevice -lavfilter -lswscale

I couldn't find the right command so I put it here :oops: .