From bb5e2dc22c3dbcea53c5f34e7ea924d0bfc322df Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sun, 22 Jan 2017 16:06:04 +0000 Subject: [PATCH] media-video/libav: Add nvidia-video-codec support Package-Manager: portage-2.3.3 --- media-video/libav/libav-12.ebuild | 13 ++++++++++--- media-video/libav/metadata.xml | 1 + profiles/arch/x86/package.use.mask | 4 ++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/media-video/libav/libav-12.ebuild b/media-video/libav/libav-12.ebuild index 57a650750f27..214466a166a3 100644 --- a/media-video/libav/libav-12.ebuild +++ b/media-video/libav/libav-12.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -37,7 +37,7 @@ SLOT="0/12" ~x64-solaris ~x86-solaris" IUSE="aac alsa amr bs2b +bzip2 cdio cpudetection custom-cflags debug doc +encode faac fdk frei0r fontconfig +gpl gsm +hardcoded-tables ieee1394 jack jpeg2k libressl mp3 - +network openssl opus oss pic pulseaudio rtmp schroedinger sdl speex ssl + +network nvidia openssl opus oss pic pulseaudio rtmp schroedinger sdl speex ssl static-libs test theora threads tools truetype twolame v4l vaapi vdpau vorbis vpx X wavpack webp x264 x265 xvid +zlib" @@ -79,6 +79,7 @@ RDEPEND=" x265? ( >=media-libs/x265-1.2:=[${MULTILIB_USEDEP}] ) xvid? ( >=media-libs/xvid-1.3.2-r1[${MULTILIB_USEDEP}] ) ) + nvidia? ( media-video/nvidia-video-codec[${MULTILIB_USEDEP}] ) fdk? ( >=media-libs/fdk-aac-0.1.2[${MULTILIB_USEDEP}] ) frei0r? ( media-plugins/frei0r-plugins ) gsm? ( >=media-sound/gsm-1.0.13-r1[${MULTILIB_USEDEP}] ) @@ -139,7 +140,7 @@ REQUIRED_USE=" test? ( encode zlib ) fontconfig? ( truetype ) " -RESTRICT="faac? ( bindist ) fdk? ( bindist ) openssl? ( bindist )" +RESTRICT="faac? ( bindist ) fdk? ( bindist ) openssl? ( bindist ) nvidia? ( bindist )" MULTILIB_WRAPPED_HEADERS=( /usr/include/libavutil/avconfig.h @@ -200,12 +201,18 @@ multilib_src_configure() { use vaapi && myconf+=( --enable-vaapi ) + NVIDIA_INCLUDES="-I/opt/nvidia-video-codec/include -I/opt/cuda/include" + NVIDIA_LIBS="-L/opt/cuda/lib64" + use nvidia && myconf+=( --enable-nonfree --enable-cuda --enable-libnpp + --extra-cflags="$NVIDIA_INCLUDES" --extra-ldflags="$NVIDIA_LIBS" ) + # Encoders if use encode; then use faac && myconf+=( --enable-nonfree ) use mp3 && myconf+=( --enable-libmp3lame ) use amr && myconf+=( --enable-libvo-amrwbenc ) use aac && myconf+=( --enable-libvo-aacenc ) + use nvidia && myconf+=( --enable-nvenc ) uses="faac theora twolame vorbis wavpack webp x264 x265 xvid" for i in ${uses}; do use ${i} && myconf+=( --enable-lib${i} ) diff --git a/media-video/libav/metadata.xml b/media-video/libav/metadata.xml index 9277436519b1..222399a18306 100644 --- a/media-video/libav/metadata.xml +++ b/media-video/libav/metadata.xml @@ -20,6 +20,7 @@ Build all GPL licensed code. Without this flag set the package is build under LGPL license. Use pre-calculated tables rather than calculating them on the fly. Enable network streaming support. + Enable nvidia video codec hardware acceleration support. Prefer dev-libs/openssl over net-libs/gnutls to provide SSL/TLS support (notice: the resulting binaries are unredistributable). Use the external opus library for encoding and decoding. Enable pulseaudio input support. diff --git a/profiles/arch/x86/package.use.mask b/profiles/arch/x86/package.use.mask index 8bb03a7d8a38..7d028f6693bf 100644 --- a/profiles/arch/x86/package.use.mask +++ b/profiles/arch/x86/package.use.mask @@ -4,6 +4,10 @@ # This file requires >=portage-2.1.1 +# Luca Barbato (22 Jan 2017) +# cuda is not available on x86 nvidia-video-codec depends on it +media-video/libav nvidia + # Ilya Tumaykin (19 Jan 2017) # Requires yet unavailable >=media-video/ffmpeg-3.3. >=media-video/mpv-0.23.0 cuda -- 2.26.2