From 5c16b444ca1b34f116121bb582ca47cb7d95a231 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Thu, 8 Jun 2017 20:40:20 +0000 Subject: ffmpeg: updated to 3.3.2; added libmfx support --- ffmpeg/build/ffmpeg.SlackBuild | 80 +++++++++++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 12 deletions(-) (limited to 'ffmpeg') diff --git a/ffmpeg/build/ffmpeg.SlackBuild b/ffmpeg/build/ffmpeg.SlackBuild index 481faa11..21f27588 100755 --- a/ffmpeg/build/ffmpeg.SlackBuild +++ b/ffmpeg/build/ffmpeg.SlackBuild @@ -160,6 +160,9 @@ # 3.3.1-1: 20/may/2017 by Eric Hameleers # * Update. After expiry of the MP3 patents, this package will now # be able to encode MP3 even in the unrestricted variant. +# 3.3.2-1: 08/jun/2017 by Eric Hameleers +# * Update. Added libmfx support (HW-accelerated video decoding +# on modern Intel GPU's): check "ffmpeg -codecs |grep qsv". # # Run 'sh ffmpeg.SlackBuild' to build a Slackware package. # The package (.txz) plus descriptive .txt file are created in /tmp . @@ -197,19 +200,20 @@ else fi PRGNAM=ffmpeg -VERSION=${VERSION:-3.3.1} +VERSION=${VERSION:-3.3.2} BUILD=${BUILD:-1} NUMJOBS=${NUMJOBS:--j7} TAG=${TAG:-"alien"} -DOCS="COPYING* CREDITS Changelog MAINTAINERS README* \ - doc/TODO doc/*.txt doc/*.html" -DOCS_AMR="AUTHORS COPYING ChangeLog LICENSE NEWS README" -DOCS_AMRWBENC="AUTHORS COPYING ChangeLog LICENSE NEWS NOTICE README" +DOCS="COPYING* CREDITS Changelog MAINTAINERS RELEASE* VERSION *.md \ + doc/*.txt doc/*.html" +DOCS_AMR="COPYING ChangeLog README" +DOCS_AMRWBENC="COPYING ChangeLog NOTICE README" DOCS_ASS="COPYING Changelog" DOCS_AVC1394="AUTHORS COPYING ChangeLog INSTALL NEWS README" DOCS_DC1394="AUTHORS COPYING ChangeLog INSTALL NEWS README" DOCS_FDKAAC="ChangeLog NOTICE" +DOCS_MFX="COPYING README.md" DOCS_FRIBIDI="AUTHORS COPYING ChangeLog NEWS README THANKS TODO" DOCS_GSM="COPYRIGHT ChangeLog* INSTALL MACHINES MANIFEST README" DOCS_LAME="API COPYING ChangeLog HACKING LICENSE README STYLEGUIDE TODO USAGE" @@ -217,7 +221,7 @@ DOCS_LIBVA="COPYING" DOCS_LIBZVBI="AUTHORS BUGS COPYING COPYING.LIB ChangeLog INSTALL NEWS README TODO" DOCS_OPUS="AUTHORS COPYING ChangeLog NEWS README" DOCS_ORC="COPYING README TODO" -DOCS_RAW1394="AUTHORS COPYING ChangeLog INSTALL NEWS README" +DOCS_RAW1394="AUTHORS ChangeLog INSTALL NEWS README" DOCS_RTMP="AUTHORS COPYING ChangeLog README" DOCS_SCHROEDINGER="AUTHORS COPYING* NEWS TODO" DOCS_SDL2="*.txt" @@ -235,6 +239,7 @@ ASS=0.13.6 AVC1394=0.5.4 DC1394=2.1.2 FDKAAC=0.1.5 +MFX=20170608 FRIBIDI=0.19.7 GSM=1.0.16 LAME=3.99.5 @@ -416,6 +421,11 @@ 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. @@ -468,6 +478,16 @@ H) \ && tar --exclude .git -${TARCOMP}cf ${2} libvpx-${VPX} rm -rf libvpx-${VPX} ;; + 24) # We clone the git of libmfx at a certain date: + mkdir libmfx-${MFX} \ + && cd libmfx-${MFX} \ + && git clone https://github.com/lu-zero/mfx_dispatch.git . \ + && git checkout $(git rev-list -n 1 --before="`date -d $MFX`" master) \ + && chown -R root:root . \ + && cd .. \ + && tar --exclude .git -${TARCOMP}cf ${2} libmfx-${MFX} + rm -rf libmfx-${MFX} + ;; *) # Do nothing ;; esac @@ -1135,6 +1155,43 @@ cd - } +# ----------------------------------------------------------------------------- +# Compile libmfx +# ----------------------------------------------------------------------------- +make_mfx() +{ +echo -e "**\n** mfx ...\n**" +cd $TMP/tmp-$PRGNAM/libmfx-$MFX + +[ ! -x configure ] && autoreconf -vif + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +LDFLAGS="$SLKLDFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --enable-static \ + --disable-documentation \ + --program-prefix= \ + --program-suffix= \ + --build=$TARGET \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}_mfx.log +make ${NUMJOBS} 2>&1 | tee $OUTPUT/make-${PRGNAM}_mfx.log +# Install mfx into a temp location so ffmpeg can pickup the library +echo -e "\n**\n**\n" +make install DESTDIR=$FFMPEGDEPSDIR \ + 2>&1 | tee -a $OUTPUT/make-${PRGNAM}_mfx.log +# Remove the .so and .la files; we want static linking: +rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/libmfx*.so* +rm -f $FFMPEGDEPSDIR/usr/lib${LIBDIRSUFFIX}/libmfx*.la +# Add DOCS to the ffmpegdeps to have it added to ffmpeg package later: +mkdir -p $FFMPEGDEPSDIR/doc/mfx/ +cp $DOCS_MFX $FFMPEGDEPSDIR/doc/mfx/ || true +cd - +} + + # ----------------------------------------------------------------------------- # Compile VP8 # ----------------------------------------------------------------------------- @@ -1469,10 +1526,6 @@ else ARCHOPTS="" fi -# Fix SDL header location: -#sed -e '/#include/ s,&1 | tee $OUTPUT/configure-${PRGNAM}_ffmpeg.log # Use ffmpeg's own implementation: @@ -1568,6 +1622,7 @@ make_orc make_schroedinger make_x264 make_x265 +make_mfx make_vpx make_libva make_vdpau @@ -1604,7 +1659,8 @@ for PCFILE in $(ls $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/*.pc) ; do -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/-lzvbi//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}##" \ $PCFILE done -- cgit v1.2.3