A.Quarter.To.Seven

Some of Stef's Stuff

FFmpeg Win32 built with Eclipse and MinGW/MSYS

by Stefano on 2009.01.03, no comments

Want create site? Find Free WordPress Themes and plugins.

It took me some time and a lot of research on Google to setup a fully automated FFmpeg IDE on a Windows machine. A lot of documents are available but none of them is comprehensive of all the steps required, from configuration to installation.

INDEX

REQUIREMENTS

FFmpeg is C++ code oiginally developed on/for *nix machines, but despite this it remains highly portable and cross platform. On Windows computers C/C++ code can be compiled with the GNU compiler GCC which requires a UNIX-like development environment, in this case provided by MinGW (and MSYS)

Instructions, how-to, installers and other resources you need to setup such environment are available from the respective web pages and are frequently updated (that’s why not directly linked from here). Various pages with installation instructions are available in REFERENCES.

Please read carefully FFmpeg’s RELEASE NOTES about specific MinGW/MSYS versions required to succesfully build the program.

Once MinGW/MSYS is installed you are provided with a set of command line development tools; next you need to speed up coding/debugging with a full featured C/C++ IDE such as Eclipse. If it’s your first time using Eclipse download Eclipse IDE for C/C++ Developers otherwise you can simply downloand/install the CDT Eclipse plugin.

FFmpeg source code needs configuration prior to build or install and this is done via shell configuration file/script; as optional step might be handy to have installed a shell editor such as ShellEd (simply download and unzip into the Eclipse installation folder).

REFERENCES

I found some very helpful pages on the net and here they go as a reference for you too:

DOWNLOAD FFmpeg

Once the IDE is ready you can go on with FFmpeg. As stated in the FFmpeg web page, no official builds are provided; the only way to go is compile the source code either downloading the latest snapshot zip file or checking the code out from repository.

Best method depends of course on your needs, but if your plan is develop always with the latest FFmpeg  available, checkout from repository is the right choice. I found this method preferable also because you can change to old revisions just in a click. Again SVN functionality will be available in Eclipse installing the Subclipse plugin.

Create a new SVN project in Eclipse via File->New->Other… menu. Define a new repository location that point to svn://svn.mplayerhq.hu/ffmpeg/trunk and select the revision you want to checkout (default is HEAD revision); click on Finish, the wizard create your project and fill it with files from the repository.

CONFIGURE FFmpeg

At this point MinGW/MSYS and Eclipse are installed, and FFmpeg project set up: next, the required configuration must be done. You can launch MSYS, change to FFmpeg source folder and run the following command:

[bash]
./configure –disable-mmx –enable-shared –shlibdir=. –enable-memalign-hack
[/bash]

You can choose any flag available looking directly at the configure script for help. The proposed line in particular creates FFmpeg shared libraries (dll).

If you want to configure different FFmpeg or if you have very long flag sequences this method could be really time consuming.

Better way to do configuration is let Eclipse manage the overall process: in Eclipse with C/C++ view selected click on Run menu then select External Tools->External Tools Configuration so a dialog like the following would show up

ext_tools

Create a new Program and fill in the fields as above; change Location field to point to sh.exe into your MSYS bin location, Apply and Run. The configuration is done automatically. Then you can recall it anytime by the Run External Tools button/dropdown.

You can also save as many configurations as you need (typically with different Arguments field).

BUILD/INSTALL FFmpeg

Eclipse CDT has a view called Make targets in which you can link all targets from a makefile; once you have your makefile inside the project folder just right-click on it then go to Make targets->Create and fill in name and target fields. Usually you create more tha one targets for make, make install, distclean, etc.

Double clicking on the make target hopefully should build FFmpeg.

Did you find apk for android? You can find new Free Android Games and apps.

Leave a Reply

Your email address will not be published. Required fields are marked *