summaryrefslogtreecommitdiffstats
path: root/ffmpeg
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2010-05-27 22:03:41 +0000
committer Eric Hameleers <alien@slackware.com>2010-05-27 22:03:41 +0000
commita21dd53bdf28a0a2c0c979e1dbb6a9b51d97cbf9 (patch)
tree58ced536cf800afec31ee4218792b690d1b5e32c /ffmpeg
parent7e83a8dffe6e827ebd140ba067652bea6c737297 (diff)
downloadasb-a21dd53bdf28a0a2c0c979e1dbb6a9b51d97cbf9.tar.gz
asb-a21dd53bdf28a0a2c0c979e1dbb6a9b51d97cbf9.tar.xz
Attempt to add webm support to ffmpeg, falters because I can not get the patches to ffmpeg right, the snapshot diverges too much
Diffstat (limited to 'ffmpeg')
-rwxr-xr-xffmpeg/build/ffmpeg.SlackBuild111
1 files changed, 98 insertions, 13 deletions
diff --git a/ffmpeg/build/ffmpeg.SlackBuild b/ffmpeg/build/ffmpeg.SlackBuild
index 0fac3d78..f2bad3c5 100755
--- a/ffmpeg/build/ffmpeg.SlackBuild
+++ b/ffmpeg/build/ffmpeg.SlackBuild
@@ -85,6 +85,9 @@
# snapshot (x264 can now produce blu-ray compliant video),
# and updated the lame and dc1394 versions. Added support for
# RTMP(E) - flash - streams through librtmp.
+# r23349-1: 27/may/2010 by Eric Hameleers <alien@slackware.com>
+# * New snapshot. Added libvpx plus patches for ffmpeg which
+# enable support for WebM/VP8 (google-donated new video format).
#
# Run 'sh ffmpeg.SlackBuild' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -108,7 +111,7 @@
USE_PATENTS=${USE_PATENTS:-"YES"}
PRGNAM=ffmpeg
-VERSION=${VERSION:-r22900}
+VERSION=${VERSION:-r23349}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:--j7}
TAG=${TAG:-"alien"}
@@ -126,6 +129,7 @@ DOCS_RAW1394="AUTHORS COPYING ChangeLog INSTALL NEWS README"
DOCS_RTMP="AUTHORS COPYING ChangeLog README"
DOCS_SCHROEDINGER="AUTHORS COPYING* NEWS TODO"
DOCS_SPEEX=" AUTHORS COPYING ChangeLog NEWS README* TODO"
+DOCS_VPX="AUTHORS CHANGELOG LICENSE README"
DOCS_X264="AUTHORS COPYING"
# Support libraries:
@@ -134,6 +138,7 @@ DC1394=2.1.2
FAAC=1.28
FAAD2=2.7
FFMPEG=$VERSION
+FFMPEG_VPX=r2 # patches to add vp8 codec to ffmpeg
GSM=1.0.13
LAME=3.98.4
ORC=0.4.4
@@ -141,7 +146,10 @@ RAW1394=2.0.5
RTMP=2.2c
SCHROEDINGER=1.0.9
SPEEX=1.2rc1
-X264=20100425-2245 # Needs yasm installed
+SWSCALE="" # Set SWSCALE="" to checkout a version of ffmpeg's swscale
+ # that matches the date of the FFMPEG snapshot.
+VPX=0.9.0
+X264=20100526-2245 # Needs yasm installed
# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)
@@ -155,7 +163,7 @@ OUTPUT=${OUTPUT:-/tmp}
if ! which yasm >/dev/null 2>&1 ; then
echo "##"
echo "## The 'yasm' program does not seem to be installed."
- echo "## The X264 codec compilation needs yasm (nasm will not do)!"
+ echo "## The X264/VP8 codec compilation needs yasm (nasm will not do)!"
echo "## Aborting the build."
echo "##"
exit 1
@@ -231,7 +239,17 @@ SRCPAT[11]="YES"
# librtmp library, supporting RTMP streams
SOURCE[12]="$SRCDIR/rtmpdump-${RTMP}.tar.gz"
SRCURL[12]="http://rtmpdump.mplayerhq.hu/download/rtmpdump-${RTMP}.tar.gz"
-SRCPAT[12]="YES"
+SRCPAT[12]="NO"
+
+# libvpx library, containing the VP8 codec
+SOURCE[13]="$SRCDIR/libvpx-${VPX}.tar.bz2"
+SRCURL[13]="http://webm.googlecode.com/files/libvpx-${VPX}.tar.bz2"
+SRCPAT[13]="NO"
+
+# Patches from the web-project for ffmpeg
+SOURCE[14]="$SRCDIR/mplayer-vp8-encdec-support-${FFMPEG_VPX}.tar.bz2"
+SRCURL[14]="http://webm.googlecode.com/files/mplayer-vp8-encdec-support-${FFMPEG_VPX}.tar.bz2"
+SRCPAT[14]="NO"
# Use the src_checkout() function if no downloadable tarball exists.
@@ -391,7 +409,7 @@ if [ "$P1" != "--oldbuild" ]; then
done
fi
chown -R root:root *
-chmod -R u+w,go+r-w,a-s *
+chmod -R u+w,go+r-w,a+X-s *
# --- BUILDING ---
@@ -498,9 +516,9 @@ echo -e "**\n**"
cd $TMP/tmp-$PRGNAM/libdc1394-${DC1394}
# Make sure that the static libraw1394 is found in the ffmpegdeps:
-CFLAGS="$SLKCFLAGS -I$FFMPEGDEPSDIR/usr/include" \
-CPPFLAGS="$SLKCFLAGS -I$FFMPEGDEPSDIR/usr/include" \
-LDFLAGS="$SLKLDFLAGS -L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}" \
+CFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \
+CPPFLAGS="-I$FFMPEGDEPSDIR/usr/include $SLKCFLAGS" \
+LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \
PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
./configure \
--prefix=/usr \
@@ -529,8 +547,12 @@ cd $OLDDIR
make_faac()
{
echo -e "**\n** faac ...\n**"
-#mv $TMP/tmp-$PRGNAM/faac $TMP/tmp-$PRGNAM/faac-${FAAC}
cd $TMP/tmp-$PRGNAM/faac-${FAAC}
+
+# Newer gcc/glibc will bail out otherwise:
+cat $SRCDIR/faac_gcc44.diff | patch -p1 --verbose \
+ 2>&1 | tee $OUTPUT/patch-${PRGNAM}_faac.log
+
#sh bootstrap
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -770,6 +792,48 @@ cp -a $DOCS_RTMP $FFMPEGDEPSDIR/doc/rtmp/ || true
cd -
}
+
+# -----------------------------------------------------------------------------
+# Compile libvpx
+# -----------------------------------------------------------------------------
+make_vpx()
+{
+echo -e "**\n** vpx ...\n**"
+if [ "$ARCH" = "i486" -o "" = "i686" ]; then
+ ARCHOPTS="--target=x86-linux-gcc"
+elif [ "$ARCH" = "x86_64" ]; then
+ ARCHOPTS="--target=${ARCH}-linux-gcc --enable-pic"
+else
+ ARCHOPTS="--target=${ARCH}-linux-gcc"
+fi
+cd $TMP/tmp-$PRGNAM/libvpx-${VPX}
+CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
+LDFLAGS="$SLKLDFLAGS" \
+./configure \
+ --disable-install-bins \
+ --disable-install-srcs \
+ --disable-install-libs \
+ --disable-debug-libs \
+ --enable-postproc \
+ $ARCHOPTS \
+ 2>&1 | tee $OUTPUT/configure-${PRGNAM}_vpx.log
+ #--disable-examples \ causes errors
+make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_vpx.log
+# Install libvpx into a temp location so ffmpeg can pickup the library
+make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_vpx.log
+# The build system vor libvpx is not yet mature:
+cp -a vp8/*.h vpx_codec/*.h vpx_ports/*.h vpx_scale/*.h ${FFMPEGDEPSDIR}/usr/include
+rm -f ${FFMPEGDEPSDIR}/usr/include/config.h
+ranlib libvpx.a && cp -a libvpx.a ${FFMPEGDEPSDIR}/usr/lib${LIBDIRSUFFIX}
+ranlib libvpx_g.a && cp -a libvpx_g.a ${FFMPEGDEPSDIR}/usr/lib${LIBDIRSUFFIX}
+# Add DOCS to the ffmpegdeps to have it added to ffmpeg package later:
+mkdir -p $FFMPEGDEPSDIR/doc/vpx
+cp -a $DOCS_VPX $FFMPEGDEPSDIR/doc/vpx/ || true
+cd -
+}
+
+
# -----------------------------------------------------------------------------
# Compile ffmpeg with additional support for -
# LAME (MP3), XVID, FAAC (MP4), FAAD2 , SPEEX, X264, GSM, SCHROEDINGER
@@ -803,12 +867,29 @@ if [ "$ARCH" = "x86_64" ]; then
fi
# Assembler patch enables MMX/SSE:
cat $SRCDIR/${FFMPEGASM}.patch | patch -p1 --verbose \
- 2>&1 | tee $OUTPUT/patch-${PRGNAM}_ffmpeg.log
+ 2>&1 | tee $OUTPUT/patch-${PRGNAM}_asm.log
ARCHOPTS="--arch=x86_64 --enable-pic"
else
ARCHOPTS=""
fi
+# Apply WebM (VP8 codec format) patches - some patches will FAIL to apply
+# because ffmpeg is slowly adding this new functionality:
+(
+ for PF in $(find ../mplayer-vp8-encdec-support -name "*.diff" | grep -v mplayer-only) ; do
+ echo "VP8 patch: $PF"
+ cat $PF | patch -p0 --verbose || true
+ done
+) 2>&1 | tee $OUTPUT/patch-${PRGNAM}_vpx.log
+# Final patch to fix the problem that we are using a "too new" ffmpeg:
+# Prefer a specific versioned patch over the version-less patch:
+if [ -f $SRCDIR/ffmpeg-${FFMPEG}_webm_fix.diff ]; then
+ FFMPEGWEBMFIX=ffmpeg-${FFMPEG}_webm_fix
+else
+ FFMPEGASM=ffmpeg_webm_fix
+fi
+cat $SRCDIR/$FFMPEGWEBMFIX.diff | patch -p1 --verbose 2>&1 | tee -a $OUTPUT/patch-${PRGNAM}_vpx.log
+
# Stamp the version into the source:
[ -f version.sh ] && sed -i -e "s/UNKNOWN/$VERSION/" version.sh
@@ -847,7 +928,7 @@ PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \
--disable-debug \
$ARCHOPTS \
--extra-cflags="-I$FFMPEGDEPSDIR/usr/include -DRUNTIME_CPUDETECT" \
- --extra-ldflags="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} -lssl -lcrypto -lz" \
+ --extra-ldflags="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} -lssl -lcrypto -lz -lusb" \
2>&1 | tee $OUTPUT/configure-${PRGNAM}_ffmpeg.log
make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_ffmpeg.log
@@ -860,6 +941,7 @@ cd $OLDDIR
#
#if [ 'xy' != 'xy' ]; then # use this block if you want to skip a lot
+
# Needed before ffmpeg:
# Based on the value of $USE_PATENTS enable or disable patented code:
if [ "${USE_PATENTS}" = "YES" ]; then
@@ -876,8 +958,10 @@ make_rtmp
make_orc
make_schroedinger
make_x264
+make_vpx
#fi # end of 'xy'
+
# ffmpeg uses the above static libraries:
make_ffmpeg
@@ -893,7 +977,7 @@ else
make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log
fi
-# Add x264 presets. See 'Preset files' in the man pages.
+# Add x264vpx presets. See 'Preset files' in the man pages.
mkdir -p $PKG/usr/share/ffmpeg
cp -a ffpresets/*.ffpreset $PKG/usr/share/ffmpeg/
@@ -905,7 +989,8 @@ for PCFILE in $(ls $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/*.pc) ; do
-e 's/-lopencore-amrnb//' -e 's/-lopencore-amrwb//' \
-e 's/-lfaac//' -e 's/-lfaad//' \
-e 's/-lmp3lame//' -e 's/-lschroedinger-[^ ]*//' -e 's/-loil-[^ ]*//' \
- -e 's/-lx264//' -e 's/-ldc1394_control//' -e 's/-lraw1394//' $PCFILE
+ -e 's/-lx264//' -e 's/-lvpx//' \
+ -e 's/-ldc1394_control//' -e 's/-lraw1394//' $PCFILE
done
# Add a configuration file for the ffserver: