From c11b18358a2d2fc694b48f4422b2b6fe456ecdcf Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <mm@ucw.sh>
Date: Wed, 3 Jun 2020 20:40:33 +0200
Subject: [PATCH] [centos-7] Enable Nvidia hardware encoding in FFmpeg

---
 centos-7/Dockerfile        | 7 ++++++-
 centos-7/bash/toolchain.sh | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/centos-7/Dockerfile b/centos-7/Dockerfile
index a5cb12a..ad7bcce 100644
--- a/centos-7/Dockerfile
+++ b/centos-7/Dockerfile
@@ -71,10 +71,15 @@ RUN version=4.2.1 && \
     yum clean all && \
     source /etc/profile && \
     cd /tmp && \
+    git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git && \
+    cd nv-codec-headers && \
+    make install && \
+    cd .. && \
+    rm -rf nv-codec-headers && \
     curl -sSLO http://ffmpeg.org/releases/ffmpeg-${version}.tar.gz && \
     tar -xf ffmpeg-${version}.tar.gz && \
     cd ffmpeg-${version} && \
-    ./configure --prefix=/usr/local --enable-gpl --enable-libfreetype --enable-avresample --enable-shared --disable-static --enable-pic && \
+    ./configure --prefix=/usr/local --enable-gpl --enable-nvenc --enable-libfreetype --enable-avresample --enable-shared --disable-static --enable-pic && \
     make install && \
     cd .. && \
     rm -rf ffmpeg-${version}*
diff --git a/centos-7/bash/toolchain.sh b/centos-7/bash/toolchain.sh
index 2e7ccc2..cdcc458 100644
--- a/centos-7/bash/toolchain.sh
+++ b/centos-7/bash/toolchain.sh
@@ -3,3 +3,5 @@ source scl_source enable devtoolset-8
 
 # Git 2.18
 source scl_source enable rh-git218
+
+export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
-- 
GitLab