diff options
author | Eric Hameleers <alien@slackware.com> | 2017-11-22 13:18:54 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2017-11-22 13:18:54 +0000 |
commit | a77ef536b8a4f2358597539f464d580717bbc8aa (patch) | |
tree | db5064eb2991866353c4d14531a626bf60eb23f7 /ffmpeg/build | |
parent | 6b2135bfb0c54ba45b99878f684c8ed846dd7e50 (diff) | |
download | asb-a77ef536b8a4f2358597539f464d580717bbc8aa.tar.gz asb-a77ef536b8a4f2358597539f464d580717bbc8aa.tar.xz |
ffmpeg: updated to 3.4 ; removed deprecated schroedinger codec library; x265 library now supports 8, 10 and 12 bit depth; refreshed internal vaapi, opus, sdl2, x264 and x265 libraries.
Diffstat (limited to '')
-rwxr-xr-x | ffmpeg/build/ffmpeg.SlackBuild | 278 |
1 files changed, 139 insertions, 139 deletions
diff --git a/ffmpeg/build/ffmpeg.SlackBuild b/ffmpeg/build/ffmpeg.SlackBuild index 14c44c30..c8fc02ee 100755 --- a/ffmpeg/build/ffmpeg.SlackBuild +++ b/ffmpeg/build/ffmpeg.SlackBuild @@ -167,6 +167,10 @@ # * Update. # 3.3.4-1: 13/sep/2017 by Eric Hameleers <alien@slackware.com> # * Update. +# 3.4-1: 20/nov/2017 by Eric Hameleers <alien@slackware.com> +# * Update. +# 3.4-2: 22/nov/2017 by Eric Hameleers <alien@slackware.com> +# * Rebuilt to fix the broken libx265 linking. # # Run 'sh ffmpeg.SlackBuild' to build a Slackware package. # The package (.txz) plus descriptive .txt file are created in /tmp . @@ -174,6 +178,13 @@ # # ----------------------------------------------------------------------------- + +PRGNAM=ffmpeg +VERSION=${VERSION:-3.4} +BUILD=${BUILD:-2} +NUMJOBS=${NUMJOBS:--j7} +TAG=${TAG:-"alien"} + # -- PATENT ALERT! -- # FFmpeg can be built with AAC audio encoder (used in MP4) but this library is # 'contaminated' with patents from Apple etc. @@ -203,11 +214,19 @@ else USE_OPENCL="" fi -PRGNAM=ffmpeg -VERSION=${VERSION:-3.3.4} -BUILD=${BUILD:-1} -NUMJOBS=${NUMJOBS:--j7} -TAG=${TAG:-"alien"} +if pkg-config --exists libbluray 2>/dev/null ; then + # Slackware 15.0 and newer have libbluray: + USE_BLURAY="--enable-libbluray" +else + USE_BLURAY="" +fi + +if pkg-config --exists libwebp 2>/dev/null ; then + # Slackware 15.0 and newer have libwebp: + USE_WEBP="--enable-libwebp" +else + USE_WEBP="" +fi DOCS="COPYING* CREDITS Changelog MAINTAINERS RELEASE* VERSION *.md \ doc/*.txt doc/*.html" @@ -247,20 +266,20 @@ MFX=20170608 FRIBIDI=0.19.7 GSM=1.0.16 LAME=3.99.5 -LIBVA=1.6.2 +LIBVA=1.8.0 LIBZVBI=0.2.35 -OPUS=1.1.4 +OPUS=1.2.1 ORC=0.4.26 RAW1394=2.0.5 RTMP=2.3 SCHROEDINGER=1.0.11 -SDL2=2.0.5 +SDL2=2.0.7 SPEEX=1.2.0 V4L=1.12.2 VDPAU=1.1.1 VPX=1.6.1 -X264=20170212-2245 -X265=2.2 +X264=20171119-2245 +X265=2.5 # Where do we look for sources? SRCDIR=$(cd $(dirname $0); pwd) @@ -310,15 +329,14 @@ fi SOURCE[0]="$SRCDIR/ffmpeg-${SRCVER}.tar.bz2" SRCPAT[0]="NO" -# Orc (oil runtime compiler) is a dependency for schroedinger -SOURCE[1]="$SRCDIR/orc-${ORC}.tar.xz" -SRCURL[1]="https://gstreamer.freedesktop.org/src/orc/orc-${ORC}.tar.xz" +# VDPAU for video hardware acceleration: +SOURCE[1]="$SRCDIR/libvdpau-${VDPAU}.tar.gz" +SRCURL[1]="http://people.freedesktop.org/~aplattner/vdpau/libvdpau-${VDPAU}.tar.gz" SRCPAT[1]="NO" -# Dirac video codec support by schroedinger: -SOURCE[2]="$SRCDIR/schroedinger-${SCHROEDINGER}.tar.gz" -#SRCURL[2]="http://www.diracvideo.org/download/schroedinger/schroedinger-${SCHROEDINGER}.tar.gz" -SRCURL[2]="https://download.videolan.org/contrib/schroedinger/schroedinger-${SCHROEDINGER}.tar.gz" +# SDL2 is required by ffplay: +SOURCE[2]="$SRCDIR/SDL2-${SDL2}.tar.gz" +SRCURL[2]="http://www.libsdl.org/release/SDL2-${SDL2}.tar.gz" SRCPAT[2]="NO" # SPEEX audio codec: @@ -410,9 +428,9 @@ SOURCE[20]="$SRCDIR/opus-${OPUS}.tar.gz" SRCURL[20]="http://downloads.xiph.org/releases/opus/opus-${OPUS}.tar.gz" SRCPAT[20]="NO" -# VDPAU for video hardware acceleration: -SOURCE[21]="$SRCDIR/libvdpau-${VDPAU}.tar.gz" -SRCURL[21]="http://people.freedesktop.org/~aplattner/vdpau/libvdpau-${VDPAU}.tar.gz" +# libfmx library, for HW-accelerated playback on Intel GPUs: +SOURCE[21]="$SRCDIR/libfmx-${MFX}.tar.xz" +SRCURL[21]="" SRCPAT[21]="NO" # libzvbi for teletext subtitle processing: @@ -420,16 +438,6 @@ SOURCE[22]="$SRCDIR/zvbi-${LIBZVBI}.tar.bz2" SRCURL[22]="http://downloads.sourceforge.net/zapping/zvbi-${LIBZVBI}.tar.bz2" SRCPAT[22]="NO" -# SDL2 is required by ffplay: -SOURCE[23]="$SRCDIR/SDL2-${SDL2}.tar.gz" -SRCURL[23]="http://www.libsdl.org/release/SDL2-${SDL2}.tar.gz" -SRCPAT[23]="NO" - -# libfmx library, for HW-accelerated playback on Intel GPUs: -SOURCE[24]="$SRCDIR/libfmx-${MFX}.tar.xz" -SRCURL[24]="" -SRCPAT[24]="NO" - # Use the src_checkout() function if no downloadable tarball exists. # This function checks out sources from SVN/CVS and creates a tarball of them. @@ -777,21 +785,101 @@ echo -e "**\n** x265 ...\n**" PREVDIR=$(pwd) cd $TMP/tmp-$PRGNAM/x265-${X265} -mkdir -p build_x265 -cd build_x265 - cmake ../source \ - -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ - -DCMAKE_LDFLAGS:STRING="$SLKLDFLAGS" \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DLIB_INSTALL_DIR=lib${LIBDIRSUFFIX} \ - -DENABLE_SHARED=OFF \ - 2>&1 | tee $OUTPUT/configure-${PRGNAM}_x265.log - make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_x265.log - # Install x265 into a temp location so ffmpeg can pickup the library - make install DESTDIR=$FFMPEGDEPSDIR \ - 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_x265.log -cd - +## Apply upstream patch to make ffmpeg compile (api.cpp:(.text+0x2c53): +## undefined reference to `x265_10bit::x265_api_get_143(int)' error): +## (not applicable until after 2.5 release; applies to git code only) +#cat $SRCDIR/patches/x265_c_comp.patch | patch -p1 --verbose \ +# 2>&1 | tee $OUTPUT/patch-${PRGNAM}_x265.log + +# We follow the build instructions at: +# https://github.com/videolan/x265/blob/master/build/linux/multilib.sh +# See also https://bitbucket.org/multicoreware/x265/wiki/Home : +# Build 10bit and 12bit only on x86_64 for which assembler code exists. +if [ "$ARCH" = "x86_64" ]; then + mkdir build-12 + cd build-12 + cmake ../source \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_INSTALL_DIR=lib${LIBDIRSUFFIX} \ + -DHIGH_BIT_DEPTH=ON \ + -DMAIN12=ON \ + -DEXPORT_C_API=OFF \ + -DENABLE_CLI=OFF \ + -DENABLE_SHARED=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}_x265.log + make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_x265.log + cd - + mkdir build-10 + cd build-10 + cmake ../source \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_INSTALL_DIR=lib${LIBDIRSUFFIX} \ + -DHIGH_BIT_DEPTH=ON \ + -DEXPORT_C_API=OFF \ + -DENABLE_CLI=OFF \ + -DENABLE_SHARED=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + 2>&1 | tee -a $OUTPUT/configure-${PRGNAM}_x265.log + make ${NUMJOBS} 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_x265.log + cd - + mkdir build-8 + cd build-8 + ln -s ../build-10/libx265.a libx265_main10.a + ln -s ../build-12/libx265.a libx265_main12.a + cmake ../source \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_INSTALL_DIR=lib${LIBDIRSUFFIX} \ + -DEXTRA_LIB="x265_main10.a;x265_main12.a" \ + -DEXTRA_LINK_FLAGS="-L." \ + -DLINKED_10BIT=ON \ + -DLINKED_12BIT=ON \ + -DENABLE_SHARED=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + 2>&1 | tee -a $OUTPUT/configure-${PRGNAM}_x265.log + make ${NUMJOBS} 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_x265.log + # Rename the 8bit library, then combine all three into libx265.a using ar: + mv libx265.a libx265_main.a + ar -M <<EOF +CREATE libx265.a +ADDLIB libx265_main.a +ADDLIB libx265_main10.a +ADDLIB libx265_main12.a +SAVE +END +EOF +else + mkdir build-8 + cd build-8 + cmake ../source \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_INSTALL_DIR=lib${LIBDIRSUFFIX} \ + -DENABLE_SHARED=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}_x265.log + make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_x265.log +fi + +# We were left in the final build directory: +# Install x265 into a temp location so ffmpeg can pickup the library +make install DESTDIR=$FFMPEGDEPSDIR \ + 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_x265.log +cd .. + # Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: mkdir -p $FFMPEGDEPSDIR/doc/x265 cp -a $DOCS_X265 $FFMPEGDEPSDIR/doc/x265 || true @@ -1014,91 +1102,6 @@ cd - # ----------------------------------------------------------------------------- -# Compile orc -# ----------------------------------------------------------------------------- -make_orc() -{ -echo -e "**\n** orc ...\n**" -cd $TMP/tmp-$PRGNAM/orc-$ORC -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -LDFLAGS="$SLKLDFLAGS" \ -./configure \ - --prefix=$FFMPEGDEPSDIR/usr \ - --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ - --enable-static \ - --disable-shared \ - --program-prefix= \ - --program-suffix= \ - --build=$TARGET \ - 2>&1 | tee $OUTPUT/configure-${PRGNAM}_orc.log -make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_orc.log -# Install orc into a temp location so schroedinger can pickup the library -echo -e "\n**\n**\n" -# We used --prefix=$FFMPEGDEPSDIR/usr so that schroedinger's build will find the -# headers in the $FFMPEGDEPSDIR instead of the filesystem root: -make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_orc.log -# Add DOCS to the ffmpeg deps to have it added to ffmpeg package later: -mkdir -p $FFMPEGDEPSDIR/doc/orc/ -cp ${DOCS_ORC} $FFMPEGDEPSDIR/doc/orc/ || true -cd - -} - - -# ----------------------------------------------------------------------------- -# Compile schroedinger -# ----------------------------------------------------------------------------- -make_schroedinger() -{ -echo -e "**\n** schroedinger ...\n**" -if [ "$ARCH" = "x86_64" ]; then - ARCHOPTS="--with-pic" -else - ARCHOPTS="" -fi -cd $TMP/tmp-$PRGNAM/schroedinger-$SCHROEDINGER - -# Do not try to build the testsuite, it gives errors about multiple definitions: -cat $SRCDIR/patches/schroedinger_notests.patch | patch -p1 --verbose \ - 2>&1 | tee $OUTPUT/patch-${PRGNAM}_schroedinger.log - -# Because of the patch, run autoreconf: -autoreconf -vif - -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -LDFLAGS="-L$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} $SLKLDFLAGS" \ -PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ -./configure \ - --prefix=$FFMPEGDEPSDIR/usr \ - --libdir=$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX} \ - --enable-static \ - --disable-shared \ - --program-prefix= \ - --program-suffix= \ - $ARCHOPTS \ - --build=$TARGET \ - 2>&1 | tee $OUTPUT/configure-${PRGNAM}_schroedinger.log -make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_schroedinger.log -# Install schroedinger into a temp location so ffmpeg can pickup the library -echo -e "\n**\n**\n" -make install 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_schroedinger.log -# Or else the ffmpeg build wil fail: -cp schroedinger.pc \ - $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/schroedinger.pc -cp schroedinger.pc \ - $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig/schroedinger-1.0.pc -( cd $FFMPEGDEPSDIR/usr/include - ln -sf schroedinger-1.0/schroedinger -) -# Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: -mkdir -p $FFMPEGDEPSDIR/doc/schroedinger/ -cp -a $DOCS_SCHROEDINGER $FFMPEGDEPSDIR/doc/schroedinger/ || true -cd - -} - - -# ----------------------------------------------------------------------------- # Compile rtmpdump # ----------------------------------------------------------------------------- make_rtmp() @@ -1247,6 +1250,7 @@ PKG_CONFIG_PATH="$FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/pkgconfig" \ --enable-runtime-cpu-detect \ --enable-vp8 \ --enable-vp9 \ + --enable-vp9-highbitdepth \ --enable-vp9-postproc \ $ARCHOPTS \ 2>&1 | tee $OUTPUT/configure-${PRGNAM}_vpx.log @@ -1537,11 +1541,6 @@ else ARCHOPTS="" fi -# Or else orc's library will not be used in the static linking (orc is listed -# as a private lib for schroedinger): -sed -i -e "s/pkg_config --libs/pkg_config --static --libs/" \ - configure - # Stamp the version into the source: [ -f version.sh ] && sed -i -e "s/UNKNOWN/$VERSION/" version.sh @@ -1565,18 +1564,20 @@ PATH="$FFMPEGDEPSDIR/usr/bin:$PATH" \ --enable-libmp3lame \ --enable-libass \ --enable-libdc1394 \ + --enable-libfribidi \ --enable-libgsm \ --enable-libmfx \ --enable-libopencore-amrnb \ --enable-libopencore-amrwb \ --enable-libopus \ - --enable-libschroedinger \ + --enable-libssh \ --enable-libspeex \ --enable-libtheora \ --enable-libv4l2 \ --enable-libvo-amrwbenc \ --enable-libvorbis \ --enable-libvpx \ + --enable-libwavpack \ --enable-libx264 \ --enable-libx265 \ --enable-libzvbi \ @@ -1591,6 +1592,8 @@ PATH="$FFMPEGDEPSDIR/usr/bin:$PATH" \ --enable-shared \ --enable-static \ --disable-debug \ + ${USE_BLURAY} \ + ${USE_WEBP} \ ${USE_OPENCL} \ ${USE_PULSE} \ ${USE_NONFREE} \ @@ -1629,8 +1632,6 @@ make_sdl2 make_speex make_gsm #make_rtmp -make_orc -make_schroedinger make_x264 make_x265 make_vpx @@ -1669,7 +1670,6 @@ for PCFILE in $(ls $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/*.pc) ; do -e 's/-lfdk-aac//g' \ -e 's/-lmp3lame//g' \ -e 's/-lopus//g' \ - -e 's/-lschroedinger-[^ ]*//g' -e 's/-lorc-[^ ]*//g' \ -e 's/-lx264//g' -e 's/-lx265//g' -e 's/-lvpx//g' -e 's/-lmfx//g' \ -e 's/-lzvbi//g' \ -e "s#-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib${LIBDIRSUFFIX}##" \ |