Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th September 2011, 17:47   #1  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
How to compile FFMBC on Windows

Update: rc5, Jan 12, 2012
Also includes links to new lame 3.99, and x264 latest stable

What's New?
http://code.google.com/p/ffmbc/

What is FFMBC?

It's a version of ffmpeg (a command line trancoding utility) with better support of professional formats like DNxHD or ProRES.

Compiling FFMBC

It's not easy to find binaries of this program for windows on the internet so you might have to compile it yourself.

About this Guide

This guide was successfully tested Oct 25, 2011 (and quickly retested on subsequent versions). If you read other guides on
the internet, you will find out of date instructions. For example, some
guides claim that pr is missing from the msys environment. It is now
included at C:\MinGW\msys\1.0\bin\pr.exe.
There are also some warnings about bash being ver. 2.04 which prevents the
configure script from working. This is no longer a problem. The bash
at this date was 3.1.17(1)-release (i686-pc-msys).
Tested on XPSP3 (32bit).
Also note that instructions for compiling ffmbc are similar to instructions for compiling ffmpeg.
Some compile options given on the internet are not needed;
--extra-cflags "-U__STRICT_ANSI__" is already the default, --enable-prostproc as well,
an option about --enable-nonfree is only needed by libfaac which is not enabled by default,
also note that avisynth support only requires a few files from windows, which are included with
mingw. GPL2 is the default.

Setting up the build environment on Windows

Get the mingw installer,
mingw-get-inst-20110802.exe from http://sourceforge.net/projects/ming...ingw-get-inst/

-Choose "Download latest repository catalogues"
-Check MinGW Developer Toolkit, C++ Compiler
It takes some time to download and update everything.

Open a command prompt (Start->All Programs->Accessories->Command Prompt in XP) and type:
set PATH=C:\MinGW\bin;%PATH%
set PATH=C:\MinGW\msys\1.0\bin;%PATH%


Start mingw prompt (Start->All Programs->MingW->MingW Shell) and type:
/postinstall/pi.sh
now answer the questions with the response in parentheses ():
Do you wish to continue with the post install? (y)
Do you have MinGW installed? (y)
Where is your MinGW installation? (C:\MinGW)
Do you wish for me to add mount bindings for C:MinGW to /mingw? (y)

--Next steps download some missing files needed to compile--

download http://www.tortall.net/projects/yasm....1.0-win32.exe
and rename yasm-1.1.0-win32.exe to yasm.exe and place at C:\MinGW\bin
Note: If using Windows 2000, you need an older version of yasm.

download http://ftp.acc.umu.se/pub/gnome/bina...25-1_win32.zip
unpack
copy bin\pkg-config.exe to C:\MinGW\bin

download http://ftp.acc.umu.se/pub/gnome/bina....1-1_win32.zip
unpack, copy bin contents to C:\MinGW\bin

Make a copy of C:\MinGW\bin\libintl-8.dll then rename to intl.dll (this is required to run the downloaded pkg-config.exe).

--this is enough to finish running ./configure--
Note: If your build environment is already setup from a previous version build, you can start at this point.

Compiling your first FFMBC or a subsequent version with a working build environment

Download ffmbc: http://ffmbc.googlecode.com/files/FFmbc-0.7-rc5.tar.bz2
Place ffmbc source download at c:\
(FFmbc-0.7-rc5.tar.gz)
unpack.

From mingw shell,
cd /c/ffmbc-0.7-rc5

Option 1: To enable single binaries with no dll's, use:

configure --enable-gpl --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth

Option 2: To enable smaller exe's but with extra dll's use:

configure --enable-gpl --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-shared --disable-static

The last message you will see is
"Creating config.mak and config.h..." and a moment later you will be returned to the shell prompt.

Now type "make". It is normal to get a lot of warnings. A while later you will have your exe's and/or dll's and in c:\ffmbc-0.7-rc5. The versions named *_g have debugging info
and can be discarded.

For the shared version, you should also run these extra commands in the mingw shell:
strip -d libavcodec/avcodec-53.dll
strip -d libavdevice/avdevice-53.dll
strip -d libavfilter/avfilter-2.dll
strip -d libavformat/avformat-53.dll
strip -d libavutil/avutil-51.dll
strip -d libpostproc/postproc-51.dll
strip -d libswscale/swscale-2.dll


This will reduce the size of the dll's. For the shared version, these dll's must be in the same directory as ffmbc.exe (or somewhere in your path, type SET in the normal command prompt to view.)

Gathering your files

In order to run the shared library version you need all the dll's above in your path, and for both versions (by default) you need C:\MinGW\bin\pthreadGC2.dll in the same directory or elsewhere in the path.

Compiling the missing features

The options after configure matter; these enable various features. If you want some of the missing features, you have to install some extra source code for those packages as well. --enable-nonfree is needed by libfaac. ffmbc is GPL2 only.

Source code available from:
http://ffmbc.googlecode.com/files/FFmbc-0.7-rc5.tar.bz2
ftp://ftp.videolan.org/pub/videolan/...e_x264.tar.bz2
http://sourceforge.net/projects/lame...ar.gz/download
svn checkout http://openjpeg.googlecode.com/svn/trunk/ openjpeg

All of the options can be found by running configure --help in the mingw
shell.

The features in this compile

The resulting binary as built above does have .avs (avisynth) input support and does support 10bit pro formats. Using rawsource you can easily import 10bit video into avisynth as well.

Binaries

configure --enable-gpl --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-shared --disable-static

http://www.sendspace.com/file/8r29zc
ffmbc-0.7-rc5

http://www.sendspace.com/file/r68cmd
ffmbc-0.7-rc4

http://www.sendspace.com/file/dvxa21
ffmbc-0.7-rc3

http://www.sendspace.com/file/1vqd8e
ffmbc-0.7-rc2

http://www.sendspace.com/file/ck4n0u
ffmbc-0.7-rc1

Related Topics

Up-to-date binaries of ffmpeg, and script to create build environment for mingw which can compile ffmpeg (cross compiling on Ubuntu)
http://ffmpeg.zeranoe.com/builds/
http://ffmpeg.zeranoe.com/blog/

Other binaries of ffmbc, with x264 and 64bit versions (but not rc5 yet as of now)
http://www.mediafire.com/?8xynxe10rxb88

http://avisynth.org/mediawiki/High_b..._with_Avisynth

Compiling LAME
This is a new guide, to compile LAME which is in support of enabling lame for ffmbc.

Download the lame 3.99 sourcecode (link above). Unpack. Open the mingw32 shell. Type:
cd /c/lame-3.99
configure
make
You can now find C:\lame-3.99\libmp3lame\.libs\libmp3lame-0.dll and C:\lame-3.99\frontend\lame.exe

Compiling x264
Download the latest stable x264 sourcecode (link above). Unpack. Open the mingw32 shell. Type:
cd /c/{insert your sourcecode path here}
configure
make
You can now find x264.exe in the build directory. You need pthreadGC2.dll in your path to run it.

Compiling ffmbc with x264 and lame
*Not fully tested*

Compile x264 and lame as above, create these directories:
C:\MinGW\msys\1.0\local\
C:\MinGW\msys\1.0\local\lib\
C:\MinGW\msys\1.0\local\include\
C:\MinGW\msys\1.0\local\include\lame\

then copy these files:
last_stable_x264\libx264.a -> C:\MinGW\msys\1.0\local\lib\
lame-3.99\libmp3lame\.libs\libmp3lame.a -> C:\MinGW\msys\1.0\local\lib\
last_stable_x264\x264.h, x264_config.h -> C:\MinGW\msys\1.0\local\include\
lame-3.99\include\lame.h -> C:\MinGW\msys\1.0\local\include\lame\

Now build with
configure --enable-gpl --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-nonfree --enable-libx264 --enable-libmp3lame --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib

This builds, but not sure if it works. It's the dynamic version.

Keywords

build ffmpeg build ffmbc compile ffmpeg compile ffmbc how to make windows binaries of ffmbc windows compile of ffmbc win32 latest ffmbc

Last edited by jmac698; 15th January 2012 at 19:15. Reason: updated
jmac698 is offline   Reply With Quote
Old 30th September 2011, 15:31   #2  |  Link
hanfrunz
Registered User
 
hanfrunz's Avatar
 
Join Date: Feb 2002
Location: Germany
Posts: 540
Thanks jmac698!

i cross-compiled on a virtual linux machine before, but that setup doesn't work anymore with the latest version. so your guide is perfectly timed!

p.s. some of your links are broken -> "<br>" in the link must be removed

regards,
hanfrunz
hanfrunz is offline   Reply With Quote
Old 30th September 2011, 21:32   #3  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Trying to do this magic.

It was running for some time and....where are my binaries?

It says creating config.mak config.h and then stops.

Last edited by kolak; 30th September 2011 at 22:25.
kolak is offline   Reply With Quote
Old 1st October 2011, 01:55   #4  |  Link
Jim_Pansen
Registered User
 
Join Date: Oct 2006
Posts: 24
Thanks a lot! Good work!

I'm not familar with compiling sources, so I'm really thankful for uploading the Windows binary!

Cheers

Jim
Jim_Pansen is offline   Reply With Quote
Old 1st October 2011, 02:34   #5  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
kolak:
You're doing great so far! Just type make and you're done.
jmac698 is offline   Reply With Quote
Old 1st October 2011, 12:05   #6  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Done....and it even works

Does it normal to see many warnings?
If it works does it mean it's fine?

Thanks a lot
kolak is offline   Reply With Quote
Old 1st October 2011, 16:34   #7  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
If there was a serious error, it wouldn't make an exe. The warnings are just that - warnings. I've always gotten a lot as well, and it's in the guide now.
Note that this is proof that an average person can make their own compile, so don't be afraid to try!
Once everything is set up, configure and make are all you need to make any project. The main thing likely to happen is that you're missing files, just search for them and dump them in, and keep trying.

Last edited by jmac698; 1st October 2011 at 16:36.
jmac698 is offline   Reply With Quote
Old 1st October 2011, 17:23   #8  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Cool- it worked. I tried to decode some ProRes file and everything is fine- I'm proud of myself- buhahahaha

New guide is more detailed- better- at the end there is nothing difficult at all if you have such a guide- thanks

Last edited by kolak; 1st October 2011 at 17:28.
kolak is offline   Reply With Quote
Old 5th October 2011, 15:01   #9  |  Link
hanfrunz
Registered User
 
hanfrunz's Avatar
 
Join Date: Feb 2002
Location: Germany
Posts: 540
Hello jmac698,

have you tried to add x264 and faac libs? I have no luck compiling faac. x264 compiles fine, but the lib is not found by ffmbc.
Any idea?

regards,
hanfrunz
hanfrunz is offline   Reply With Quote
Old 7th October 2011, 13:00   #10  |  Link
V-Day
Registered User
 
Join Date: May 2006
Posts: 2
Thanks for the great guide jmac698.
I have a question though: Is it possible to use standard FFMPEG profiles (*.ffpreset) with FFMBC, as i seem to be having some problems using them.
Please point me to the right thread if this has already been discussed elsewhere.
V-Day is offline   Reply With Quote
Old 7th October 2011, 14:54   #11  |  Link
V-Day
Registered User
 
Join Date: May 2006
Posts: 2
Ok. I seem to have worked it out.
ffpresets are called with -fpre and FFMPEG params are not the same as FFMBC.
After remapping everything works now.
V-Day is offline   Reply With Quote
Old 7th October 2011, 15:14   #12  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
hanfrunz,
build static and there can't possibly be any problem with the lib not found.
use --enable-gpl3 to enable faac
there should be some way to include already built libraries from ffmpeg
jmac698 is offline   Reply With Quote
Old 7th October 2011, 16:40   #13  |  Link
the_weirdo
Yes, I'm weird.
 
the_weirdo's Avatar
 
Join Date: May 2010
Location: Southeast Asia
Posts: 271
To link against external libs, you can use PKG_CONFIG_PATH or specify location of those libs via --extra-cflags and --extra-ldflags. For example:
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure
OR
./configure --extra-cflags="/usr/local/include" --extra-ldflags="/usr/local/lib"
Another way:
LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" ./configure

And you'll need to pass --enable-nonfree to configure if you want to link ffmbc against libfaac.
the_weirdo is offline   Reply With Quote
Old 8th October 2011, 14:22   #14  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 595
Quote:
Originally Posted by jmac698 View Post
an option about gpl3 is only needed by libfaac which is not enabled by default,
"--enable-libfaac" doesn't require "--enable-version3".
It requires "--enable-nonfree".
"--enable-version3" is required by libopencore-amr(nb/wb) and libvo-(aac/amrwb)enc.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 8th October 2011, 16:10   #15  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
aha, I was just quoting from something I read, haven't checked the script.
jmac698 is offline   Reply With Quote
Old 11th October 2011, 05:31   #16  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
I had an error about lib.exe not found but it still built.
jmac698 is offline   Reply With Quote
Old 11th October 2011, 06:05   #17  |  Link
the_weirdo
Yes, I'm weird.
 
the_weirdo's Avatar
 
Join Date: May 2010
Location: Southeast Asia
Posts: 271
Quote:
Originally Posted by jmac698 View Post
I had an error about lib.exe not found but it still built.
Because when you build ffmpeg/ffmbc/libav with "--enable-shared", you'll need lib.exe from MSVC to create *.lib files. You can ignore that error message if you don't need *.lib files. However, it's better that you build it as static instead shared libs, unless you need those libs for other purposes.

One small mistake in your guide: "--enable-version3 is required by libopencore-amr(nb/wb) and libvo-(aac/amrwb)enc" is true with ffmpeg/libav, but configure of FFmbc doesn't have that option. FFmbc license is GPL v2 only (at least for now).

Last edited by the_weirdo; 11th October 2011 at 06:14.
the_weirdo is offline   Reply With Quote
Old 11th October 2011, 19:42   #18  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
I forgot to mention, instead of trying to compile lame/x264 encoder yourself, you just need the dll and to use the tip to pass cflags to link to the external dll. So it's really quite simple to make a version with extra codec support.
That's why I use the dll version, you can easily update the dll's or add more.
jmac698 is offline   Reply With Quote
Old 12th October 2011, 15:45   #19  |  Link
Chris K
Registered User
 
Join Date: Mar 2007
Posts: 16
Hi Jmac698,

I finished the whole setup procedure successfully but when I enter the config
line I get the following message ...

---------------------------------------------
$ configure --enable-gpl --enable-memalign-hack --enable-runtime-cpudetect --en
able-avisynth --enable-shared --disable-static
yasm not found, use --disable-yasm for a crippled build

If you think configure made a mistake, make sure you are using the latest
version. If the latest version fails, report the problem to the
ffmbc-dev@googlegroups.com mailing list.
Include the log file "config.log" produced by configure as this will help
solving the problem.
---------------------------------------------

I renamed yasm-1.1.0-win32.exe to yasm.exe and copied
it to c:\MinGW\bin

I've installed the setup on W2K if that matters.

Any idea ?

EDIT:

I disabled yasm and compiled both ffmbc-0.7-rc3 and a FFmpeg snapshot with success.
That means they were basically working. I suppose this means the paths are ok?

EDIT2:

Found it! It's a W2K problem. I downloaded a older yasm version and it works fine.
Well, at least I don't get the message yasm not found.

Thanks for this great guide!

Last edited by Chris K; 12th October 2011 at 20:02.
Chris K is offline   Reply With Quote
Old 13th October 2011, 14:53   #20  |  Link
Chris K
Registered User
 
Join Date: Mar 2007
Posts: 16
Happy to report I've been quite successful since I set up the MinGW/msys environment yesterday.

--------------------------------------
FFmbc version 0.7-rc3
Copyright (c) 2008-2011 Baptiste Coudurier and the FFmpeg developers

built on Oct 13 2011 14:40:57 with gcc 4.6.1

Configuration: --enable-gpl --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-nonfree --enable-libfaac --enable-libx264 --enable-libmp3lame --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-libxvid

libavutil 51. 11. 0 / 51. 11. 0
libavcodec 53. 9. 0 / 53. 9. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libavfilter 2. 27. 3 / 2. 27. 3
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
-------------------------------------

As you can see libx264, libfaac, libmp3lame and libxvid are already in.

I was out for a static build but had some problems with libmp3lame and libxvid. These do not accept the --enable-static flag so they came up as shared libraries (libmp3lame-0.dll and xvidcore.dll). But FFmbc sees them when they are in the same directory.

EDIT: I was wrong about libmp3lame. It does support the --enable-static and --disable-shared flags. I now don't need the "libmp3lame-0.dll" anymore. The problems with libxvid seems to be common as I could read at the Zeranoe forum.

libxvid was even trickier because it came up with a error about cygwin. I then modified the configure file a bit and that worked.

SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def"
SPECIFIC_CFLAGS="-mno-cygwin"

I removed "-mno-cygwin" from the first line and removed the second line totally. I had to run configure as "./configure --prefix=/mingw" otherwise I did get an error. Perhaps that path has to be changed because after "make install" the xvid dll was written to "mingw/lib" instead of "msys/1.0/local/lib" and the xvid header file to "mingw/include"? I had to move them manually to the proper dirs before starting to compile ffmbc. Suggestions on how to fix this are very welcome.

EDIT2: Finally found the solution to include libxvid statically into ffmbc/ffmpeg.

1. Go to the "xvidcore/build/generic" folder.
2. Do the cygwin modifications in the configure file as mentioned above.
3. configure (Without any additions. Also do not use ./configure).
4. make
5. make install (now writes the files to "/mingw/msys/1.0/local/" like the others do).
6. Go to the /mingw/msys/1.0/local/lib folder and remove "xvidcore.dll".
7. At the same folder make a copy of "xvidcore.a" named "libxvidcore.a"
8. Go to the ffmbc folder and ./confgure with all the options (see on top of this post).
9. make
10. make install

The fact that I had to use an older yasm version because of W2K seems to be no problem. I can see it's used but it don't give any errors when the object files are created.

I hope my positive results will encourage others to also give this guide a try.

Last edited by Chris K; 14th October 2011 at 16:09.
Chris K is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 +1. The time now is 23:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.