Need help on usage of libavcodec

For the developers that use FFmpeg in their software.
Post Reply
francesco
Posts: 10
Joined: Tue Dec 20, 2011 3:19 pm

Need help on usage of libavcodec

Post by francesco » Tue Dec 20, 2011 3:55 pm

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

DavidGallagher
Posts: 3
Joined: Tue Dec 20, 2011 2:41 am

Re: Need help on usage of libavcodec

Post by DavidGallagher » Thu Dec 22, 2011 10:35 am

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 :)

zouhair
Posts: 3
Joined: Wed Jan 11, 2012 6:43 pm

Re: Need help on usage of libavcodec

Post by zouhair » Wed Jan 11, 2012 6:56 pm

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

zouhair
Posts: 3
Joined: Wed Jan 11, 2012 6:43 pm

Re: Need help on usage of libavcodec

Post by zouhair » Fri Jan 13, 2012 1:55 pm

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: .

Post Reply
'