aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2023-08-14 13:51:22 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-08-26 07:11:15 +0000
commit5d053bd216b7528bad4ec6ea00c223bf55348d87 (patch)
treed26488ab212db375aae349b984dcfbf4a95b25b5
parent72589ec7e05ad98bfda9837d9787f7d6e0680024 (diff)
Add nvcodec to the ffmpeg build
The patch enables nvidia hardware encoders/decoders. It doesn't add new package dependencies, ffmpeg loads required functionality in runtime if nvidia drivers have been installed. The change is coming together with implementation of hw devices precheck in qtmultimedia. Change-Id: Id54a95b2bacf433950c7b50a42ff99136a143d98 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> (cherry picked from commit 69c29b7584957f30cfa2283aaced77d4ec2e7072) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rwxr-xr-xcoin/provisioning/common/unix/install-ffmpeg.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/coin/provisioning/common/unix/install-ffmpeg.sh b/coin/provisioning/common/unix/install-ffmpeg.sh
index 5849585c..80b1c180 100755
--- a/coin/provisioning/common/unix/install-ffmpeg.sh
+++ b/coin/provisioning/common/unix/install-ffmpeg.sh
@@ -65,6 +65,24 @@ fi
ffmpeg_config_options=$(cat "${BASH_SOURCE%/*}/../shared/ffmpeg_config_options.txt")
+install_ff_nvcodec_headers() {
+ nv_codec_version="11.1" # use 11.1 to ensure compatibility with 470 nvidia drivers; might be upated to 12.0
+ nv_codec_url_public="https://github.com/FFmpeg/nv-codec-headers/archive/refs/heads/sdk/$nv_codec_version.zip"
+ nv_codec_url_cached="http://ci-files01-hki.ci.qt.io/input/ffmpeg/nv-codec-headers/$nv_codec_version.zip"
+ nv_codec_sha1="bfaa2801725a2eea476939f2177ab50817c3a6ad"
+ #nv_codec_sha1="4f30539f8dd31945da4c3da32e66022f9ca59c08" // 12.0
+ nv_codec_dir="$target_dir/nv-codec-headers-sdk-$nv_codec_version"
+ if [ ! -d "$nv_codec_dir" ];
+ then
+ InstallFromCompressedFileFromURL "$nv_codec_url_cached" "$nv_codec_url_public" "$nv_codec_sha1" "$target_dir" ""
+ fi
+
+ sudo make -C "$nv_codec_dir" install -j
+
+ # Might be not detected by default on RHEL
+ export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
+}
+
build_ffmpeg() {
local arch="$1"
@@ -90,6 +108,7 @@ build_ffmpeg() {
}
if [ "$os" == "linux" ]; then
+ install_ff_nvcodec_headers
build_ffmpeg
sudo mv "$ffmpeg_source_dir/build/installed/usr/local/$ffmpeg_name" "/usr/local"
SetEnvVar "FFMPEG_DIR" "/usr/local/$ffmpeg_name"