Log in

View Full Version : How to compile FFMBC on Windows


jmac698
24th September 2011, 17:47
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/mingw/files/Automated%20MinGW%20Installer/mingw-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/releases/yasm-1.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/binaries/win32/dependencies/pkg-config_0.25-1_win32.zip
unpack
copy bin\pkg-config.exe to C:\MinGW\bin

download http://ftp.acc.umu.se/pub/gnome/binaries/win32/glib/2.28/glib_2.28.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/x264/snapshots/last_stable_x264.tar.bz2
http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.tar.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_bit-depth_Support_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

hanfrunz
30th September 2011, 15:31
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

kolak
30th September 2011, 21:32
Trying to do this magic.

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

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

Jim_Pansen
1st October 2011, 01:55
Thanks a lot! Good work!

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

Cheers

Jim

jmac698
1st October 2011, 02:34
kolak:
You're doing great so far! Just type make and you're done.

kolak
1st October 2011, 12:05
Done....and it even works:)

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

Thanks a lot :)

jmac698
1st October 2011, 16:34
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.

kolak
1st October 2011, 17:23
Cool- it worked. I tried to decode some ProRes file and everything is fine- I'm proud of myself- buhahahaha:p

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

hanfrunz
5th October 2011, 15:01
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

V-Day
7th October 2011, 13:00
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
7th October 2011, 14:54
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.

jmac698
7th October 2011, 15:14
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

the_weirdo
7th October 2011, 16:40
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.

Chikuzen
8th October 2011, 14:22
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.

jmac698
8th October 2011, 16:10
aha, I was just quoting from something I read, haven't checked the script.

jmac698
11th October 2011, 05:31
I had an error about lib.exe not found but it still built.

the_weirdo
11th October 2011, 06:05
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).

jmac698
11th October 2011, 19:42
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.

Chris K
12th October 2011, 15:45
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!

Chris K
13th October 2011, 14:53
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.

jmac698
25th October 2011, 13:00
rc4 source/binaries have been released. First download on the net! I'll also look into x264 support.

jmac698
25th October 2011, 14:59
chris_k or the_weirdo,
I couldn't get ffmbc to include any extra dll's, I made a new directory
C:\MinGW\msys\1.0\local\lib
and put libmp3lame.dll and libmp3lame.a in there.
When I tried --enable-libmp3lame --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
it said libmp3lame not found.
I looked in the configure file and there is a standard naming scheme, lib???.a. So I don't know what's wrong.

the_weirdo
25th October 2011, 16:55
chris_k or the_weirdo,
I couldn't get ffmbc to include any extra dll's, I made a new directory
C:\MinGW\msys\1.0\local\lib
and put libmp3lame.dll and libmp3lame.a in there.
When I tried --enable-libmp3lame --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib
it said libmp3lame not found.
I looked in the configure file and there is a standard naming scheme, lib???.a. So I don't know what's wrong.

You need lame header, I think. Copy lame.h from lame's include folder to C:\MinGW\msys\1.0\local\include and try again.

jmac698
25th October 2011, 17:21
Strange, I had already tried that. Still not working. Also what are the equivalent files for x264?

the_weirdo
25th October 2011, 17:48
Strange, I had already tried that. Still not working. Also what are the equivalent files for x264?

I just checked and look like you need to put lame.h in C:\MinGW\msys\1.0\local\include\lame not just C:\MinGW\msys\1.0\local\include. For x264, you need to include x264.h and x264_config.h. However, you must compile libx264 to get x264_config.h :(

Compile libx264 is pretty straight, though:
cd x264
./configure --disable-cli --enable-static --enable-strip --disable-swscale --disable-gpac --prefix=/usr/local

Replace --enable-static by --enable-shared if you want a shared lib.

jmac698
25th October 2011, 17:59
awesome, that worked ;)
I compiled x264 and lame as in the first post; just using configure/make
anyone know a file hoster in a non-software patent country?

edit
could you read over the new guide, at the end?

kolak
2nd November 2011, 01:21
jma698 you may want to re-compile rc4 as code has changed after you compiled it.

Chris K
15th January 2012, 06:54
Hi Jmac698,

My setup, based on your guide still worked fine for the new FFmbc 0.7-rc5. Among other improvements, it now supports ProRES interlaced.

Perhaps nice to update the Windows binaries if you can find the time for it.

Greetings,
Chris

jmac698
15th January 2012, 19:16
Ok done

Chris K
15th January 2012, 22:51
Thanks!

Nice there's a shared and static build in the zip. I tried the static one and it does fine.

For those, interested in ProRES. This is what MediaInfo says about it...
Video
ID : 1
Format : ProRes
Format profile : High
Codec ID : apch
Duration : 5s 880ms
Bit rate mode : Variable
Bit rate : 61.4 Mbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 5:4
Frame rate mode : Constant
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:2
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 5.919
Stream size : 43.0 MiB (98%)
Language : English
Encoded date : UTC 2012-01-15 21:26:11
Tagged date : UTC 2012-01-15 21:26:11
Color primaries : SMPTE RP145, SMPTE 170M, SMPTE 240M, SMPTE 274M, SMPTE 293M
Transfer characteristics : BT.709-2, SMPTE 170M, SMPTE 274M, SMPTE 293M, SMPTE 296M
Matrix coefficients : BT.470-4 System B, BT.470-4 System G, BT.601-4, SMPTE 170M, SMPTE 293M

There seems to be a new upload with the missing version number.

http://groups.google.com/group/ffmbc-dev/browse_thread/thread/1753339b9ccd8024

Chris

ApPojken
14th March 2012, 22:04
Thanks for this guide.

A quick question, how do I make libx264 and ffmbc compile targeting Windows 64 bit? I assume that the default is 32 bit?

On the wish list is for someone to write a guide for libass support. I've spent nearly two long days trying to get it working. May not have given up just yet though. I would really like to be able to use it.

18fps
4th October 2013, 14:02
Thank you for your detailed instructions! At first I tried to use the last version of MinGW and got a lot of errors: no exe was compiled. Then I installed the version in this guide and tried to compile the last ffmbc source, with success.

filler56789
30th September 2014, 09:58
ffmbc 0.7.1 is 4 months old already, but

no Windows binaries available thus far :confused:

https://drive.google.com/folderview?id=0B0jxxycBojSwR3I4Vkp5Ul9tQXc&usp=sharing

Reel.Deel
1st October 2014, 03:14
ffmbc 0.7.1 is 4 months old already, but

no Windows binaries available thus far :confused:

https://drive.google.com/folderview?id=0B0jxxycBojSwR3I4Vkp5Ul9tQXc&usp=sharing

I have not seen any 'official' binaries in a while. Nonetheless there are binaries floating around. Take a look here (download links are near the end): https://groups.google.com/forum/#!topic/ffmbc-discuss/se0U1vfpicw
Do they work as intended? Well that's a different story... :p

raffriff42
1st October 2014, 03:41
FFmpeg supports DNxHD and ProRES now; there isn't a need for ffmbc so much these days, AFAICT.

filler56789
28th December 2014, 02:14
FWIW: current ffmbc is 0.7.2

http://forum.videohelp.com/threads/369190-ffmbc-0-7-2-(Win32-build)

FFmpeg supports DNxHD and ProRES now; there isn't a need for ffmbc so much these days, AFAICT.

AFAIR, at least some multiplexers (AVI, MPG, TS) of ffmbc were "more correct" (or less broken) than the original versions from ffmpeg or libav. Examples:

http://forum.videohelp.com/threads/350408-Creating-a-video-file-from-a-DTS-file-with-blank-still-image-video

http://forum.videohelp.com/threads/359680-FFmpeg-muxing-problem

jmac698
23rd February 2015, 11:06
My sendspace links are dead, but ffmbc rc8, both 32bit and 64bit, are available at

http://www.mediafire.com/?8xynxe10rxb88

filler56789
20th August 2016, 21:28
Update: FFmbc version N-32083-g8b91f67 is out:

http://forum.videohelp.com/threads/380083-FFmbc-version-N-32083-g8b91f67

Midzuki
7th November 2017, 16:38
UPDATE: FFmbc.exe version N-32103-g431e408 is out.

https://forum.videohelp.com/threads/385719-ffmbc-EXE-version-N-32103-g431e408

Midzuki
9th November 2017, 15:56
^ Now there is an x64 build as well. Third post in the Videohelp topic indicated above.