MingGW-w64 Build Script 3.5.5

Releases for my MinGW-w64 build script
Post Reply
User avatar
Zeranoe
Site Admin
Posts: 697
Joined: Sat May 07, 2011 7:12 pm
Contact:

MingGW-w64 Build Script 3.5.5

Post by Zeranoe » Wed Dec 04, 2013 2:33 am

Version 3.5.5 of my MingGW-w64 Build Script has been released

For download links and the full release please visit: http://ffmpeg.zeranoe.com/blog/?p=242

bat999
Posts: 49
Joined: Wed Sep 19, 2012 8:07 pm

Re: MingGW-w64 Build Script 3.5.5

Post by bat999 » Fri Dec 06, 2013 7:56 pm

"I could use some feedback and bug reports..."
Hi
I used the mingw-w64-build-3.5.5 Build Script with 32-bit *buntu-12-04.
Everything's hunky dory :D

Code: Select all

@Xubuntu:~$ wine ./ffmpeg
ffmpeg version git-2013-12-06-90539ce Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec  6 2013 19:41:09 with gcc 4.8.2 (GCC)
  configuration: --pkg-config=pkg-config --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --disable-w32threads --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
My FFmpeg build script is here ---> http://pastebin.com/raw.php?i=Pui4Gdf9

pavel
Posts: 10
Joined: Wed Dec 04, 2013 7:39 am

Re: MingGW-w64 Build Script 3.5.5

Post by pavel » Fri Dec 13, 2013 12:10 pm

bat999 wrote:
"I could use some feedback and bug reports..."
Hi
I used the mingw-w64-build-3.5.5 Build Script with 32-bit *buntu-12-04.
Everything's hunky dory :D

Code: Select all

@Xubuntu:~$ wine ./ffmpeg
ffmpeg version git-2013-12-06-90539ce Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec  6 2013 19:41:09 with gcc 4.8.2 (GCC)
  configuration: --pkg-config=pkg-config --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --disable-w32threads --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid
My FFmpeg build script is here ---> http://pastebin.com/raw.php?i=Pui4Gdf9

great. just tried on Ubuntu 11.10 32 as guest OS (VirtualBox). Could you try to compile with --enable-rtmp?
I'have spent almost 2 days.. but no luck..

the erros like this whle compiling rtmpdump package:
[rtmpdump] bad reloc address 0x0 in section `.data'

tried with OPENSSL, POLARSSL and GNUTLS.. always got this error...

So how can i compile ffmpeg with --enable-rtmp option ?

Below is my script (currently do not use it, it's is not completed...):

Code: Select all

#!/bin/bash
#
# Name of script
# script to start Zeranoe mingw-w64 building thing...
script="FFmpegW.sh"
# 
#
# December 13 2013.
#
# Cross-compile FFmpeg.
# With bzip2 zlib libiconv libmp3lame libx264, librtmp, pthreads
#
# Welcome message.
echo "Start welcome"
echo "Now running script:- $script"
echo "Hello"
echo "End welcome"
#
#
# Variables for compiler.
export PKG_CONFIG_PATH=$HOME/build/lib/pkgconfig
export LDFLAGS=-L$HOME/build/lib
export CFLAGS=-I$HOME/build/include
#
# Path of mingw32 compiler.
export PATH=$HOME/software/mingw-w64/mingw-w64-i686/bin:$PATH
#
# Create a build folder.
cd ~/; sudo rm -rf build; mkdir build; cd build
#
# Compile bzip2.
curl bzip.org/1.0.6/bzip2-1.0.6.tar.gz | tar -xz; cd bzip2-*
sed -i 's/include <sys\\stat/include <sys\/stat/g' bzip2.c # Cross-compile hack.
make CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar RANLIB=i686-w64-mingw32-ranlib PREFIX=$HOME/build \
libbz2.a bzip2 bzip2recover install; cd ..
#
# Compile zlib.
curl -L sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.xz
# mirror: http://zlib.net/zlib-1.2.8.tar.xz
tar -xJf zlib-1.2.8.tar.xz
cd zlib-*
CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar RANLIB=i686-w64-mingw32-ranlib \
./configure --prefix=$HOME/build --static
make; make install; cd ..
#
# Compile libiconv.
curl ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz | tar -xz; cd libiconv-*
./configure \
--prefix=$HOME/build --host=i686-w64-mingw32 --disable-shared --disable-dependency-tracking
make; make install; cd ..
# Compile libmp3lame.
curl -L sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz | tar -xz; cd lame-*
./configure \
--prefix=$HOME/build --host=i686-w64-mingw32 --disable-shared --disable-dependency-tracking --enable-nasm
make; make install; cd ..


sudo apt-get remove yasm
wget launchpad.net/ubuntu/+archive/primary/+files/yasm_1.2.0.orig.tar.gz
tar -xzf yasm_1.2.0.orig.tar.gz
cd yasm*
./configure && make && make install


# Compile libx264.
git clone --depth 1 git://git.videolan.org/x264; cd x264
./configure \
--prefix=$HOME/build --host=i686-w64-mingw32 --cross-prefix=i686-w64-mingw32- --enable-static --disable-avs \
--disable-cli --disable-ffms --disable-gpac --disable-lavf --disable-opencl --disable-swscale
make; make install; cd ..
#


# Compile pthreads <-- seems it's not needed to compile 
#wget ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip

#ve pthreads.2 folder to c:\\ffmpeg\libs\pthreads.2
#cd pthreads.2
#make clean GC-static
#cp -iv pthread.h semaphore.h sched.h /mingw/include/
#cp -iv libpthreadGC2.a /mingw/lib
#cp -iv libpthreadGC2.a /mingw/lib/libpthread.a
#CPPFLAGS="-DPTW32_STATIC_LIB"
#export CPPFLAGS


apt-get remove openssl
apt-get install libssl-dev
apt-get install libcurl4-openssl-dev

#-----libssl & libcrypto static libs

wget http://www.openssl.org/source/openssl-1.0.0d.tar.gz

#wget http://www.openssl.org/source/openssl-0.9.8p.tar.gz
tar xvfz openssl-1.0.0d.tar.gz
cd openssl-1.0.0d
#./config --prefix=/root/build no-shared
sed -i 's/^CC= gcc/CC= i686-w64-mingw32-gcc/g' Makefile
sed -i 's/^AR= ar /AR= i686-w64-mingw32-ar /g' Makefile
sed -i 's/^ARD=ar /ARD=i686-w64-mingw32-ar /g' Makefile
sed -i 's/^RANLIB= /usr/bin/ranlib/RANLIB=i686-w64-mingw32-ranlib/g' Makefile
sed -i 's/^MAKEDEPPROG= gcc/MAKEDEPPROG= i686-w64-mingw32-gcc /g' Makefile

./Configure mingw --prefix=/root/build -DL_ENDIAN -DOPENSSL_NO_HW --cross-compile-prefix=i686-w64-mingw32-
./Configure mingw --prefix=/root/build -DL_ENDIAN --cross-compile-prefix=i686-w64-mingw32-

or try
./Configure mingw --prefix=/root/software/mingw-w64/mingw-w64-i686/i686-w64-mingw32 -DL_ENDIAN -DOPENSSL_NO_HW --cross-compile-prefix=i686-w64-mingw32-


make

make
make install
cd ..

# Compile librtmp
git clone git://git.ffmpeg.org/rtmpdump
sudo apt-get install build-essential gcc make subversion libssl-dev
sudo apt-get install rtmpdump
cd rtmpdump
cp /root/build/lib/*.a /tmp/lib
sed -i.bak -e '/^LIB_OPENSSL\=/s/lcrypto/lcrypto \-ldl/' Makefile
make CROSS_COMPILE=i686-w64-mingw32- SYS=posix prefix=/root/build INC=-I/root/build/include XLDFLAGS=-L/tmp/lib SHARED=
make install prefix=/root/build SHARED=

# prefix in two folders change
# -ld issue. -> install in other dir
#  reloc issue -->http://ffmpeg.zeranoe.com/forum/search.php?keywords=libdl&sid=6d1cf1eadbf0e237306ea37270cbe5a6
#solution -> useother sublib (polaris, gnutls..)
#-> http://web.archiveorange.com/archive/v/5hTZazlthm14mNgmDU09

#cp polaris pkg:
#/root/software/mingw-w64/mingw-w64-i686/i686-w64-mingw32


apt-get install dpkg-dev


git clone git://git.ffmpeg.org/rtmpdump
sudo apt-get install build-essential gcc make subversion libssl-dev
sudo apt-get install rtmpdump
cd rtmpdump/librtmp
make
cp librtmp.so.1 /root/build/lib
cd ..
cd rtmpdump
make  CROSS_COMPILE=i686-w64-mingw32- SYS=posix prefix=/root/build INC=-I/root/build/include XLDFLAGS=-L/root/build/lib SHARED=
make install prefix=/root/build SHARED=
cd ..

#
# ...
#
#


# Build FFmpeg.
git clone --depth 1 git://source.ffmpeg.org/ffmpeg; cd ffmpeg
./configure --pkg-config=pkg-config --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --disable-w32threads --enable-gpl --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-pthreads --enable-librtmp
#
#
make
#
# Package the binaries and send to Desktop.
7za a -mx=9 $HOME/Desktop/FFmpeg-2.1.1+git$(date +"%Y%m%d")-win32-static.7z ffmpeg.exe ffprobe.exe
#
echo "Hello World"
echo "Job finished"
#
#
#

bat999
Posts: 49
Joined: Wed Sep 19, 2012 8:07 pm

Re: MingGW-w64 Build Script 3.5.5

Post by bat999 » Fri Dec 13, 2013 8:35 pm

pavel wrote:... tried with OPENSSL...
So how can i compile ffmpeg with --enable-rtmp option ?
Hi
It cross-compiled OK for me with --enable-librtmp using openssl-1.0.1e. ;)

Code: Select all

@Xubuntu:~$ wine ./ffmpeg
ffmpeg version git-2013-12-13-7b2a19c Copyright (c) 2000-2013 the FFmpeg developers
  built on Dec 13 2013 20:22:52 with gcc 4.8.2 (GCC)
  configuration: --pkg-config=pkg-config --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --disable-w32threads --enable-openssl --enable-librtmp --extra-libs='-lcrypt32 -lgdi32 -lwinmm -lws2_32'
Build script is here ---> http://pastebin.com/raw.php?i=eV7vYRan

pavel
Posts: 10
Joined: Wed Dec 04, 2013 7:39 am

Re: MingGW-w64 Build Script 3.5.5

Post by pavel » Sat Dec 14, 2013 2:04 pm

bat999 wrote: Hi
It cross-compiled OK for me with --enable-librtmp using openssl-1.0.1e.
Awesome!! You had to say that there is a problem with 1.0.1.d version of openssl package?

Anyway, I will try it...

I have one more question. Could you let me know how to run this script in windows? I assume that I need mingw-w64 installed. But have no idea how to do it. (Instead of mingw). So, the short guide will be a good point.

Post Reply