aboutsummaryrefslogtreecommitdiff
path: root/project/Win32BuildSetup
diff options
context:
space:
mode:
authorWiSo <wiso@xbmc.org>2014-02-01 15:44:15 +0100
committerRainer Hochecker <fernetmenta@online.de>2014-04-27 18:05:02 +0200
commit8b7086c4a058fa238fb7737d7444edbe8ea2b94f (patch)
tree244e032c5691479864e2bf4023b6f0b4e243a47b /project/Win32BuildSetup
parent14d091a36e252eead159dbaf18a0a60eea048bd7 (diff)
[WIN32] download and compile ffmpeg from remote source.
Diffstat (limited to 'project/Win32BuildSetup')
-rw-r--r--project/Win32BuildSetup/buildffmpeg.sh105
1 files changed, 105 insertions, 0 deletions
diff --git a/project/Win32BuildSetup/buildffmpeg.sh b/project/Win32BuildSetup/buildffmpeg.sh
new file mode 100644
index 0000000000..c69f84f3b8
--- /dev/null
+++ b/project/Win32BuildSetup/buildffmpeg.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+MAKEFLAGS=""
+BGPROCESSFILE="$2"
+
+BASE_URL=https://github.com/FernetMenta/FFmpeg/archive
+VERSION=9292bac08d62b92fcd66a8df468741190269f510
+LIBNAME=ffmpeg
+ARCHIVE=$LIBNAME-$VERSION.tar.gz
+
+CUR_DIR=`pwd`
+DEPS_DIR=$CUR_DIR/../BuildDependencies
+LIB_DIR=$CUR_DIR/../../lib/win32
+WGET=$DEPS_DIR/bin/wget
+UNZIP=$CUR_DIR/tools/7z/7za
+
+cd $LIB_DIR
+
+if [ "$1" == "clean" ]
+then
+ echo removing $LIBNAME
+ if [ -d $LIBNAME ]
+ then
+ rm -r $LIBNAME
+ fi
+fi
+
+if [ ! -d $LIBNAME ]; then
+ if [ ! -f $VERSION.tar.gz ]; then
+ $WGET --no-check-certificate $BASE_URL/$VERSION.tar.gz -O $VERSION.tar.gz
+ fi
+ $UNZIP x -y $VERSION.tar.gz
+ $UNZIP x -y $VERSION.tar
+ mv $LIBNAME-$VERSION $LIBNAME
+ cd $LIBNAME
+else
+ cd $LIBNAME
+ if [ -d .libs ]; then
+ rm -r .libs
+ fi
+fi
+
+if [ ! -d .libs ]; then
+ mkdir .libs
+fi
+
+if [ $NUMBER_OF_PROCESSORS > 1 ]; then
+ if [ $NUMBER_OF_PROCESSORS > 4 ]; then
+ MAKEFLAGS=-j4
+ else
+ MAKEFLAGS=-j$NUMBER_OF_PROCESSORS
+ fi
+fi
+
+# add --enable-debug (remove --disable-debug ofc) to get ffmpeg log messages in xbmc.log
+# the resulting debug dll's are twice to fourth time the size of the release binaries
+
+OPTIONS="
+--enable-shared \
+--enable-memalign-hack \
+--enable-gpl \
+--enable-w32threads \
+--enable-postproc \
+--enable-zlib \
+--disable-static \
+--disable-debug \
+--disable-ffplay \
+--disable-ffserver \
+--disable-ffmpeg \
+--disable-ffprobe \
+--disable-devices \
+--disable-doc \
+--disable-crystalhd \
+--enable-muxer=spdif \
+--enable-muxer=adts \
+--enable-muxer=asf \
+--enable-muxer=ipod \
+--enable-muxer=ogg \
+--enable-encoder=ac3 \
+--enable-encoder=aac \
+--enable-encoder=wmav2 \
+--enable-encoder=libvorbis \
+--enable-protocol=http \
+--enable-runtime-cpudetect \
+--enable-dxva2 \
+--cpu=i686 \
+--enable-gnutls"
+
+echo configuring $LIBNAME
+./configure --extra-cflags="-fno-common -I/xbmc/lib/win32/ffmpeg_dxva2 -DNDEBUG" --extra-ldflags="-L/xbmc/system/players/dvdplayer" ${OPTIONS} &&
+
+make $MAKEFLAGS &&
+cp lib*/*.dll .libs/ &&
+cp .libs/avcodec-*.dll /xbmc/system/players/dvdplayer/ &&
+cp .libs/avformat-*.dll /xbmc/system/players/dvdplayer/ &&
+cp .libs/avutil-*.dll /xbmc/system/players/dvdplayer/ &&
+cp .libs/avfilter-*.dll /xbmc/system/players/dvdplayer/ &&
+cp .libs/postproc-*.dll /xbmc/system/players/dvdplayer/ &&
+cp .libs/swresample-*.dll /xbmc/system/players/dvdplayer/ &&
+cp .libs/swscale-*.dll /xbmc/system/players/dvdplayer/
+
+#remove the bgprocessfile for signaling the process end
+if [ -f $BGPROCESSFILE ]; then
+ rm $BGPROCESSFILE
+fi \ No newline at end of file