Trying to set up a compiler to work is a tough job! Just install ffmpeg windows build helpers cross compile script by Roger Pack. You can then use the properly configured GCC-MingW32 compiler to build from your own stable sources.

Alternatively if you know how to determine required dependencies get the MinGW-w64 Build Script and set it up as “fully static build”. A toolchain is a set of tools that allows the user to compile software. With this toolchain FFmpeg can be cross compiled.

Linux Mint 17.2 x64 hosted on VMware Player, Core-i7 (4 CPU Threads), 2GB RAM, 60GB Storage. GCC 4.9.3, lame 3.99.5, fdk-aac 0.1.4, x264 0.148.x, x265 1.7,  mfx_dispatch-master 1.7, dcadec-master, ffmpeg 2.7.2

user here is: “mint”
Source: /home/mint/code/x86_64

========== Tools ============
sudo apt-get install subversion curl texinfo g++ bison flex cvs yasm automake libtool autoconf gcc cmake git make pkg-config zlib1g-dev mercurial unzip pax -y


===== MinGW-w64 Build Script =====

wget http://zeranoe.com/scripts/mingw_w64_build/mingw-w64-build-3.6.7

chmod 755 ./mingw-w64-build-3.6.7

bash ./mingw-w64-build-3.6.7

========== env =============
To add MinGW-w64 to the PATH variable run:

export PATH="/home/mint/code/mingw-w64-x86_64/bin:$PATH"

export PKG_CONFIG_PATH="/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32/lib/pkgconfig"


=========== libiconv-1.14 ===========
cd /home/mint/code/x86_64/libiconv-1.14

export CFLAGS=-O2

./configure --host=x86_64-w64-mingw32 --prefix=/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-shared --enable-static

make -j 8
make install

unset CFLAGS


============= zlib-1.2.8 ============
cd /home/mint/code-git/x86_64/zlib-1.2.8

CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar RANLIB=x86_64-w64-mingw32-ranlib ARFLAGS=rcs ./configure --prefix=/home/mint/code-git/mingw-w64-x86_64/x86_64-w64-mingw32 --static

make -j 8

make install


=========== SDL-1.2.15 =========
cd /home/mint/code/x86_64/SDL-1.2.15

export CFLAGS=-DDECLSPEC=

./configure --host=x86_64-w64-mingw32 --prefix=/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-shared --enable-static

make -j 8
make install

unset CFLAGS

sed -i.bak "s/-mwindows//" "/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32/lib/pkgconfig/sdl.pc"

sed -i.bak "s/-mwindows//" "/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32/bin/sdl-config"

cp "/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32/bin/sdl-config" "/home/mint/code/mingw-w64-x86_64/bin/x86_64-w64-mingw32-sdl-config"


=========== lame ==============
cd /home/mint/code/x86_64/lame
make clean

./configure --host=x86_64-w64-mingw32 --prefix=/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-shared --enable-static

make -j 8
make install


======== fdk-aac ========
cd /home/mint/code/x86_64/fdk-aac
make clean

./configure --host=x86_64-w64-mingw32 --prefix=/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-shared --enable-static

make -j 8
make install


======== x264 =================
cd /home/mint/code/x86_64/x264
make clean

./configure --host=x86_64-w64-mingw32 --enable-static --cross-prefix=/home/mint/code/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --prefix=/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-strip --disable-lavf

make -j 8
make install


======== x265 ================
Cross Compiling with CMake
using a CMake configuration file

>>>>>>>
cd /home/mint/code/x86_64/x265/build/linux

cat x265-conf.txt>build.cmake

cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32" -DCMAKE_TOOLCHAIN_FILE=build.cmake ../../source

make -j 8
make install

>>>>>>>> x265-conf.txt >>>>>>>
# this one is important
SET(CMAKE_SYSTEM_NAME Windows)

# specify the cross compiler
SET(CMAKE_C_COMPILER   x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
SET(CMAKE_RANLIB x86_64-w64-mingw32-ranlib)
SET(CMAKE_ASM_YASM_COMPILER yasm)

option(ENABLE_SHARED OFF)


======= mfx_dispatch-master =============
Building using autotools

cd /home/mint/code/x86_64/mfx_dispatch-master

autoreconf -fiv

./configure --host=x86_64-w64-mingw32 --prefix=/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32 --disable-shared --enable-static

make -j 8

make install


======= dcadec-master =============
cd /home/mint/code/x86_64/dcadec-master
make clean

make CC=x86_64-w64-mingw32-gcc

make install PREFIX=/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32


======= ffmpeg ====================
cd /home/mint/code/x86_64/ffmpeg
make clean

./configure --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/mint/code/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --disable-w32threads --enable-runtime-cpudetect --enable-gpl --enable-version3 --enable-nonfree --enable-static --disable-shared --enable-libx264 --enable-libmfx --enable-libx265 --extra-libs=-lstdc++ --enable-libmp3lame --enable-libfdk-aac --disable-libfaac --enable-libdcadec --enable-dxva2 --enable-avisynth --enable-iconv --enable-zlib --extra-cflags= --prefix="/home/mint/code/mingw-w64-x86_64/x86_64-w64-mingw32" --pkg-config=pkg-config

make -j 8
make install
Living in Tune with Nature's Beat (Earth, Water, Fire, Air, Space)

Leave a Reply

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