summaryrefslogtreecommitdiffstats
path: root/ffmpeg
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2009-09-27 11:05:49 +0000
committer Eric Hameleers <alien@slackware.com>2009-09-27 11:05:49 +0000
commit6168c02e8daa6ce8c0414389112f402374110d28 (patch)
tree3e60e3db3f4a29d2730ede80642476d83f6345e0 /ffmpeg
parentcb84fb1da8eb1a7980eabcfc06bf1d2e9b6983ee (diff)
downloadasb-6168c02e8daa6ce8c0414389112f402374110d28.tar.gz
asb-6168c02e8daa6ce8c0414389112f402374110d28.tar.xz
No more option swscale
Diffstat (limited to 'ffmpeg')
-rwxr-xr-xffmpeg/build/ffmpeg.SlackBuild285
1 files changed, 107 insertions, 178 deletions
diff --git a/ffmpeg/build/ffmpeg.SlackBuild b/ffmpeg/build/ffmpeg.SlackBuild
index edd9d900..6b66801b 100755
--- a/ffmpeg/build/ffmpeg.SlackBuild
+++ b/ffmpeg/build/ffmpeg.SlackBuild
@@ -1,6 +1,6 @@
-#!/bin/sh
+#!/bin/bash
# $Id$
-# Copyright (c) 2007-2008 Eric Hameleers <alien@slackware.com>
+# Copyright (c) 2007-2009 Eric Hameleers, Eindhoven, NL
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -28,7 +28,7 @@
# For: ffmpeg
# Descr: software to record, convert and stream audio and video
# URL: http://ffmpeg.mplayerhq.hu/
-# Needs:
+# Needs: yasm (only compile-time)
# Changelog:
# 20070519-1: 19/May/2007 by Eric Hameleers <alien@slackware.com>
# * Initial build.
@@ -75,6 +75,10 @@
# package (idea borrowed from the script at slackbuilds.org).
# 0.5-2: 13/may/2009 by Eric Hameleers <alien@slackware.com>
# * Updates to faac/faad/schro
+# r20056-1: 27/sep/2009 by Eric Hameleers <alien@slackware.com>
+# * Update. AMR implementation from OpenCORE with a free license
+# allows to add AMR support to the distributable package.
+# Also updated the X264 snapshot and libgsm.
#
# Run 'sh ffmpeg.SlackBuild' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -85,37 +89,29 @@
# Set initial variables:
# -- PATENT ALERT! --
-# FFmpeg can be built with MP3 audio encoder (needed for FLV videos),
-# AMR audio encoder (needed for 3GGP videos) and AAC audio encoder (used in MP4)
-# but these libraries are 'contaminated' with patents from Fraunhofer, GGP etc.
+# FFmpeg can be built with MP3 audio encoder (needed for FLV videos) and AAC
+# audio encoder (used in MP4) but these libraries are 'contaminated'
+# with patents from Fraunhofer, Apple etc.
# You can build these patended algorithms into ffmpeg, and if you are an
# ordinary end user, no one will bother you for using them.
# For the binaries based on this SlackBuild that I distribute, it is a
# different story. I am not allowed to distribute binary packages that
# incorporate patented code. So here you go. My Slackware package was built
-# with "USE_PATENTS=NO" i.e. without using the lame mp3 and aac libs and
-# without the AMR libraries.
+# with "USE_PATENTS=NO" i.e. without using the lame mp3 and aac libs.
#USE_PATENTS="NO"
USE_PATENTS=${USE_PATENTS:-"YES"}
-# If you set REQUIRE_YASM to "NO" then the script won't refuse to build
-# ffmpeg in case you don't have yasm installed (it is needed to build x264
-# newer than the 20080301 snapshot). In this case, the script will
-# automatically 'downgrade' x264 to the 20080301-2245 snapshot.
-REQUIRE_YASM=${REQUIRE_YASM:-"YES"}
-
PRGNAM=ffmpeg
-#VERSION=${VERSION:-r16043}
-VERSION=${VERSION:-0.5}
+VERSION=${VERSION:-r20056}
+#VERSION=${VERSION:-0.5}
ARCH=${ARCH:-i486}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:--j7}
TAG=${TAG:-"alien"}
DOCS="COPYING* CREDITS Changelog MAINTAINERS README* \
doc/TODO doc/*.txt doc/*.html"
-DOCS_AMRNB="AUTHORS COPYING ChangeLog INSTALL NEWS README TODO"
-DOCS_AMRWB="AUTHORS COPYING ChangeLog INSTALL NEWS README TODO"
+DOCS_AMR="AUTHORS COPYING ChangeLog LICENSE NEWS README"
DOCS_DC1394="AUTHORS COPYING ChangeLog INSTALL NEWS README"
DOCS_FAAC="AUTHORS COPYING* ChangeLog NEWS README* TODO"
DOCS_FAAD2="AUTHORS COPYING* ChangeLog NEWS README* TODO"
@@ -128,21 +124,18 @@ DOCS_SPEEX=" AUTHORS COPYING ChangeLog NEWS README* TODO"
DOCS_X264="AUTHORS COPYING"
# Support libraries:
-AMRNB=7.0.0.2
-AMRWB=7.0.0.3
+AMR=0.1.2
DC1394=2.0.2
FAAC=1.28
FAAD2=2.7
FFMPEG=$VERSION
-GSM=1.0.12
+GSM=1.0.13
LAME=398-2
OIL=0.3.16
RAW1394=2.0.0
SCHROEDINGER=1.0.7
SPEEX=1.2rc1
-X264_SAFE=20080301-2245 # In later versions nasm complains
- # about 'function hidden'
-X264=20090512-2245 # Needs yasm installed
+X264=20090926-2245 # Needs yasm installed
# Where do we look for sources?
SRCDIR=$(cd $(dirname $0); pwd)
@@ -152,23 +145,14 @@ TMP=${TMP:-/tmp/build}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-# Check for yasm, use older x264 snapshot if not found:
+# Check for yasm, abort if not found:
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)"
- if [ "$REQUIRE_YASM" != "YES" ]; then
- X264=$X264_SAFE
- echo "## Continuing the build anyway, but will use an older X264 ($X264)..."
- echo "##"
- else
- echo "## Aborting the build - set the internal script variable:"
- echo "## REQUIRE_YASM to 'NO' if you don't have yasm installed,"
- echo "## and want to fall back to an old (but still useable)"
- echo "## version of X264 that builds with nasm instead."
- echo "##"
- exit 1
- fi
+ echo "## The X264 codec compilation needs yasm (nasm will not do)!"
+ echo "## Aborting the build."
+ echo "##"
+ exit 1
fi
# ---------------------------------------------------------------------------
@@ -180,9 +164,8 @@ fi
SOURCE[0]="$SRCDIR/ffmpeg-${FFMPEG}.tar.bz2"
# We can get ffmpeg sources directly from SVN, see below.
-SRCURL[0]="http://ffmpeg.mplayerhq.hu/releases/ffmpeg-${VERSION}.tar.bz2"
-#SRCURL[0]="http://ffmpeg.mplayerhq.hu/${PRGNAM}-export-snapshot.tar.bz2"
-#SRCURL[0]=""
+#SRCURL[0]="http://ffmpeg.mplayerhq.hu/releases/ffmpeg-${VERSION}.tar.bz2"
+SRCURL[0]=""
SRCPAT[0]="NO"
# Liboil is a dependency for schroedinger
@@ -220,40 +203,24 @@ SOURCE[7]="$SRCDIR/lame-$LAME.tar.gz"
SRCURL[7]="http://downloads.sourceforge.net/lame/lame-$LAME.tar.gz"
SRCPAT[7]="YES"
-# AMR encoder libraries used in ffmpeg to encode 3GPP audio
-# amr narrowband wrapper:
-SOURCE[8]="$SRCDIR/amrnb-${AMRNB}.tar.bz2"
-SRCURL[8]="http://ftp.penguin.cz/pub/users/utx/amr/amrnb-${AMRNB}.tar.bz2"
-SRCPAT[8]="YES"
-
-# amr narrowband library:
-SOURCE[9]="$SRCDIR/26104-700.zip"
-SRCURL[9]="http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-700.zip"
-SRCPAT[9]="YES"
-
-# amr wideband wrapper:
-SOURCE[10]="$SRCDIR/amrwb-${AMRWB}.tar.bz2"
-SRCURL[10]="http://ftp.penguin.cz/pub/users/utx/amr/amrwb-${AMRWB}.tar.bz2"
-SRCPAT[10]="YES"
-
-# amr wideband library:
-SOURCE[11]="$SRCDIR/26204-700.zip"
-SRCURL[11]="http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-700.zip"
-SRCPAT[11]="YES"
+# AMR de/encoder libraries used in ffmpeg to encode 3GPP audio
+SOURCE[8]="$SRCDIR/opencore-amr-${AMR}.tar.gz"
+SRCURL[8]="http://downloads.sourceforge.net/opencore-amr/opencore-amr-${AMR}.tar.gz"
+SRCPAT[8]="NO"
# Library needed to control IEEE 1394 (firewire-) based cameras
-SOURCE[12]="$SRCDIR/libraw1394-${RAW1394}.tar.gz"
-SRCURL[12]="http://www.linux1394.org/dl/libraw1394-${RAW1394}.tar.gz"
-SRCPAT[12]="NO"
+SOURCE[9]="$SRCDIR/libraw1394-${RAW1394}.tar.gz"
+SRCURL[9]="http://www.linux1394.org/dl/libraw1394-${RAW1394}.tar.gz"
+SRCPAT[9]="NO"
-SOURCE[13]="$SRCDIR/libdc1394-${DC1394}.tar.gz"
-SRCURL[13]="http://downloads.sourceforge.net/libdc1394/libdc1394-${DC1394}.tar.gz"
-SRCPAT[13]="NO"
+SOURCE[10]="$SRCDIR/libdc1394-${DC1394}.tar.gz"
+SRCURL[10]="http://downloads.sourceforge.net/libdc1394/libdc1394-${DC1394}.tar.gz"
+SRCPAT[10]="NO"
# FAAC library, will be statically linked with ffmpeg
-SOURCE[14]="$SRCDIR/faac-$FAAC.tar.gz"
-SRCURL[14]="http://downloads.sourceforge.net/faac/faac-$FAAC.tar.gz"
-SRCPAT[14]="NO"
+SOURCE[11]="$SRCDIR/faac-$FAAC.tar.gz"
+SRCURL[11]="http://downloads.sourceforge.net/faac/faac-$FAAC.tar.gz"
+SRCPAT[11]="NO"
# Use the src_checkout() function if no downloadable tarball exists.
@@ -262,13 +229,14 @@ src_checkout() {
# Param #1 : index in the SOURCE[] array.
# Param #2 : full path to where SOURCE[$i] tarball should be created.
# Determine the tarball extension:
- PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.gz|tar.bz2|tgz).*/\1/')
- if [ "$PEXT" == "${2}" ]; then # we did not find a allowed extension
- echo "Archive can only have extension '.tar.gz' '.tar.bz2' or '.tgz'"
- exit 1
- else
- [ "$PEXT" = "tar.bz2" ] && TARCOMP="j" || TARCOMP="z"
- fi
+ PEXT=$(echo "${2}" | sed -r -e 's/.*[^.].(tar.xz|tar.gz|tar.bz2|tgz).*/\1/')
+ case "$PEXT" in
+ "tar.xz") TARCOMP="J" ;;
+ "tar.gz") TARCOMP="z" ;;
+ "tgz") TARCOMP="z" ;;
+ "tar.bz2") TARCOMP="j" ;;
+ *) echo "Archive can only have extension 'tar.xz', '.tar.gz' '.tar.bz2' or '.tgz'" ; exit 1 ;;
+ esac
case ${1} in
0) # ffmpeg-${FFMPEG}
if [ "$(echo ${FFMPEG}|cut -c1)" == 'r' ]; then # revision instead of date
@@ -293,7 +261,7 @@ src_checkout() {
if [ "${USE_PATENTS}" == "YES" ]; then
echo ""
echo "**"
- echo "** This build uses patented code (MP3 / AMR / AAC encoders)"
+ echo "** This build uses patented code (MP3 and AAC encoders)"
echo "** Run the command 'USE_PATENTS=NO $0 $*' to avoid patent issues."
echo "**"
echo ""
@@ -311,15 +279,8 @@ trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR
set -u
P1=${1:-1}
-# Slackware 11 and up need other option (gcc > 3.3.x)
-if [ $(gcc -dumpversion | tr -d '.' |cut -c 1-2) -gt 33 ]; then
- MOPT=tune
-else
- MOPT=cpu
-fi
-
case "$ARCH" in
- i486) SLKCFLAGS="-O2 -march=i486 -m${MOPT}=i686"
+ i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
s390) SLKCFLAGS="-O2"
@@ -331,9 +292,6 @@ case "$ARCH" in
x86_64) SLKCFLAGS="-O2 -fPIC"
SLKLDFLAGS="-L/usr/lib64 -fPIC"; LIBDIRSUFFIX="64"
;;
- athlon-xp) SLKCFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
- SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ;;
esac
# Create working directories:
@@ -395,12 +353,10 @@ if [ "$P1" != "--oldbuild" ]; then
for (( i = 0; i < ${#SOURCE[*]}; i++ )) ; do
# Only extract patented code if we are allowing it:
if [ "${USE_PATENTS}" == "YES" -o "${SRCPAT[$i]}" != "YES" ]; then
- if $(file ${SOURCE[$i]} | grep -q ": bzip2"); then
- tar -xjvf ${SOURCE[$i]}
- elif $(file ${SOURCE[$i]} | grep -q ": gzip"); then
- tar -xzvf ${SOURCE[$i]}
- elif $(file ${SOURCE[$i]} | grep -iq ": zip"); then
+ if $(file ${SOURCE[$i]} | grep -q ": zip"); then
unzip ${SOURCE[$i]}
+ else
+ tar -xvf ${SOURCE[$i]}
fi
fi
done
@@ -446,62 +402,32 @@ cd -
}
# -----------------------------------------------------------------------------
-# Compile amr narrowband library
+# Compile amr wideband/narrowband library
# The ffmpeg will use these
# -----------------------------------------------------------------------------
-make_amrnb()
+make_amr()
{
-echo -e "**\n** amrnb ...\n**"
-cd $TMP/tmp-$PRGNAM/amrnb-${AMRNB}
-# Copy the amrnb-float libraries to prevent the makefile downloading them:
-cp ${SOURCE[9]} .
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
+echo -e "**\n** amr ...\n**"
+cd $TMP/tmp-$PRGNAM/opencore-amr-${AMR}
LDFLAGS="$SLKLDFLAGS" \
-./configure --prefix=/usr \
- --enable-static \
- --disable-shared \
- --program-prefix="" \
- --program-suffix="" \
- --build=$ARCH-slackware-linux \
- 2>&1 | tee $OUTPUT/configure-${PRGNAM}_amrnb.log
-make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_amrnb.log
-# Install amrnb into a temp location so ffmpeg can pickup the library
-make install DESTDIR=$FFMPEGDEPSDIR \
- 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_amrnb.log
-# Add DOCS to the ffmpegdeps to have it added to ffmpeg package later:
-mkdir -p $FFMPEGDEPSDIR/doc/amrnb
-cp -a $DOCS_AMRNB $FFMPEGDEPSDIR/doc/amrnb || true
-cd -
-}
-
-# -----------------------------------------------------------------------------
-# Compile amr wideband library
-# The ffmpeg will use these
-# -----------------------------------------------------------------------------
-make_amrwb()
-{
-echo -e "**\n** amrwb ...\n**"
-cd $TMP/tmp-$PRGNAM/amrwb-${AMRWB}
-# Copy the amrwb-float libraries to prevent the makefile downloading them:
-cp ${SOURCE[11]} .
-CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
-LDFLAGS="$SLKLDFLAGS" \
-./configure --prefix=/usr \
- --enable-static \
- --disable-shared \
- --program-prefix="" \
- --program-suffix="" \
- --build=$ARCH-slackware-linux \
- 2>&1 | tee $OUTPUT/configure-${PRGNAM}_amrwb.log
-make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_amrwb.log
-# Install amrwb into a temp location so ffmpeg can pickup the library
-make install DESTDIR=$FFMPEGDEPSDIR \
- 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_amrwb.log
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ --localstatedir=/var \
+ --sysconfdir=/etc \
+ --program-prefix= \
+ --program-suffix= \
+ --build=$ARCH-slackware-linux \
+ 2>&1 | tee $OUTPUT/configure-${PRGNAM}_amr.log
+make $NUMJOBS 2>&1 | tee $OUTPUT/make-${PRGNAM}_amr.log
+make install DESTDIR=$FFMPEGDEPSDIR PREFIX=/usr LIBDIR=/usr/lib${LIBDIRSUFFIX} \
+ 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_amr.log
# Add DOCS to the ffmpegdeps to have it added to ffmpeg package later:
-mkdir -p $FFMPEGDEPSDIR/doc/amrwb
-cp -a $DOCS_AMRWB $FFMPEGDEPSDIR/doc/amrwb || true
+mkdir -p $FFMPEGDEPSDIR/doc/amr
+cp -a $DOCS_AMR $FFMPEGDEPSDIR/doc/amr || true
cd -
}
@@ -790,7 +716,7 @@ fi
# Only use patented code if we are allowing it:
if [ "${USE_PATENTS}" == "YES" ]; then
- USE_PATENTED="--enable-libmp3lame --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-nonfree"
+ USE_PATENTED="--enable-libmp3lame --enable-libfaac --enable-nonfree"
else
USE_PATENTED=" "
fi
@@ -805,34 +731,37 @@ CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
LDFLAGS="$SLKLDFLAGS" \
PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib/pkgconfig" \
-./configure --prefix=/usr \
- --libdir=/usr/lib${LIBDIRSUFFIX} \
- --shlibdir=/usr/lib${LIBDIRSUFFIX} \
- --mandir=/usr/man \
- ${USE_PATENTED} \
- --enable-gpl \
- --enable-postproc \
- --enable-avfilter \
- --enable-swscale \
- --enable-libdc1394 \
- --enable-libgsm \
- --enable-libfaad \
- --enable-libschroedinger \
- --enable-libspeex \
- --enable-libtheora \
- --enable-libx264 \
- --enable-memalign-hack \
- --enable-pthreads \
- --enable-x11grab \
- --enable-bzlib \
- --enable-zlib \
- --enable-shared \
- --enable-static \
- --disable-debug \
- --logfile=$OUTPUT/ffmpeg_conf.log \
- --extra-cflags="-I$FFMPEGDEPSDIR/usr/include -DRUNTIME_CPUDETECT" \
- --extra-ldflags="-L$FFMPEGDEPSDIR/usr/lib" \
- 2>&1 | tee $OUTPUT/configure-${PRGNAM}_ffmpeg.log
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --shlibdir=/usr/lib${LIBDIRSUFFIX} \
+ --mandir=/usr/man \
+ ${USE_PATENTED} \
+ --enable-gpl \
+ --enable-version3 \
+ --enable-postproc \
+ --enable-avfilter \
+ --enable-libopencore-amrnb \
+ --enable-libopencore-amrwb \
+ --enable-libdc1394 \
+ --enable-libgsm \
+ --enable-libfaad \
+ --enable-libschroedinger \
+ --enable-libspeex \
+ --enable-libtheora \
+ --enable-libx264 \
+ --enable-memalign-hack \
+ --enable-pthreads \
+ --enable-x11grab \
+ --enable-bzlib \
+ --enable-zlib \
+ --enable-shared \
+ --enable-static \
+ --disable-debug \
+ --logfile=$OUTPUT/ffmpeg_conf.log \
+ --extra-cflags="-I$FFMPEGDEPSDIR/usr/include -DRUNTIME_CPUDETECT" \
+ --extra-ldflags="-L$FFMPEGDEPSDIR/usr/lib" \
+ 2>&1 | tee $OUTPUT/configure-${PRGNAM}_ffmpeg.log
make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_ffmpeg.log
cd $OLDDIR
@@ -848,8 +777,7 @@ cd $OLDDIR
# Based on the value of $USE_PATENTS enable or disable patented code:
if [ "${USE_PATENTS}" = "YES" ]; then
make_lame
- make_amrnb
- make_amrwb
+ make_amr
make_faac
fi
@@ -885,8 +813,9 @@ cp -a ffpresets/*.ffpreset $PKG/usr/share/ffmpeg/
# statically, so we need to edit those out so that programs that try to link
# against our ffmpeg will not get confused:
for PCFILE in $(ls $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/*.pc) ; do
- sed -i -e 's/libraw1394//' -e 's/-lspeex//' -e 's/-lamrnb//' \
- -e 's/-lamrwb//' -e 's/-lfaac//' -e 's/-lfaad//' -e 's/-lgsm//' \
+ sed -i -e 's/libraw1394//' -e 's/-lspeex//' -e 's/-lgsm//' \
+ -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
done