Skip to content

Commit b431e89

Browse files
committed
Merged nvenc installation fixes
2 parents 094ce9b + d25ed6f commit b431e89

File tree

2 files changed

+43
-24
lines changed

2 files changed

+43
-24
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The FFmpeg build script provides an easy way to build a static FFmpeg on **OSX**
1515

1616
## Disclaimer
1717
Use this script at your own risk. I maintain this script in my spare time.
18-
Please do not file bug reports for systems other than Debian 9 and macOS 10.13
18+
Please do not file bug reports for systems other than Debian 10 and macOS 10.15.x
1919
because I don't have the resources and the time to maintain other systems.
2020

2121

@@ -31,7 +31,20 @@ because I don't have the resources and the time to maintain other systems.
3131
* `vorbis`: Lossy audio compression format
3232
* `theora`: Free lossy video compression format
3333
* `opus`: Lossy audio coding format
34-
* `nv-codec`: NVIDIA's GPU accelerated video codecs(H264 and HEVC). Installation is triggered only if CUDA installation is detected, follow [these](#Cuda-installation) instructions for installation
34+
* `nv-codec`: [NVIDIA's GPU accelerated video codecs](https://devblogs.nvidia.com/nvidia-ffmpeg-transcoding-guide/). Installation is triggered only if CUDA installation is detected, follow [these](#Cuda-installation) instructions for installation. Supported codecs in nvcodec:
35+
* Decoders
36+
* H264 `h264_cuvid`
37+
* H265 `hevc_cuvid`
38+
* Motion JPEG `mjpeg_cuvid`
39+
* MPEG1 video `mpeg1_cuvid`
40+
* MPEG2 video `mpeg2_cuvid`
41+
* MPEG4 part 2 video `mepg4_cuvid`
42+
* VC-1 `vc1_cuvid`
43+
* VP8 `vp8_cuvid`
44+
* VP9 `vp9_cuvid`
45+
* Encoders
46+
* H264 `nvenc nvenc_h264`
47+
* H265 `nvenc_hevc`
3548

3649
## Continuos Integration
3750
ffmpeg-build-script is rockstable. Every commit runs against Linux and OSX with https://travis-ci.org just to make sure everything works as expected.
@@ -43,7 +56,7 @@ Requirements OSX
4356

4457
Requirements Linux
4558
------------
46-
* Debian >= Wheezy, Ubuntu => Trusty, other Distros might work too
59+
* Debian >= Buster, Ubuntu => Trusty, other Distros might work too
4760
* build-essentials installed:
4861

4962
```
@@ -108,6 +121,7 @@ Tested on
108121

109122
* Mac OSX 10.14 64Bit XCode 11.0
110123
* Debian 9.11
124+
* CemtOS 7.7 (Without Lib AOM and Lib Openssl activated)
111125

112126
Example
113127
-------

build-ffmpeg

100755100644
Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# https://github.com/markus-perl/ffmpeg-build-script
44

5-
VERSION=1.7
5+
VERSION=1.8
66
CWD=$(pwd)
77
PACKAGES="$CWD/packages"
88
WORKSPACE="$CWD/workspace"
@@ -242,8 +242,8 @@ if build "xvidcore"; then
242242
fi
243243

244244
if build "x264"; then
245-
download "http://ftp.videolan.org/pub/x264/snapshots/x264-snapshot-20191008-2245-stable.tar.bz2" "last_x264.tar.bz2"
246-
cd $PACKAGES/x264-snapshot-* || exit
245+
download "https://code.videolan.org/videolan/x264/-/archive/stable/x264-stable.tar.bz2" "last_x264.tar.bz2"
246+
cd $PACKAGES/x264-stable || exit
247247

248248
if [[ "$OSTYPE" == "linux-gnu" ]]; then
249249
execute ./configure --prefix=${WORKSPACE} --enable-static --enable-pic CXXFLAGS="-fPIC"
@@ -318,7 +318,7 @@ if build "vid_stab"; then
318318
fi
319319

320320
if build "x265"; then
321-
download "https://bitbucket.org/multicoreware/x265/downloads/x265_3.2.tar.gz" "x265-3.2.tar.gz"
321+
download "https://bitbucket.org/multicoreware/x265/downloads/x265_3.2.1.tar.gz" "x265-3.2.1.tar.gz"
322322
cd $PACKAGES/x265_* || exit
323323
cd source || exit
324324
execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} -DENABLE_SHARED:bool=off .
@@ -381,14 +381,14 @@ if which nvcc > /dev/null ; then
381381
fi
382382

383383
build "ffmpeg"
384-
download "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/6023b9fbfef02b71f6acfb1b09e5a12fe9d276e2.tar.gz" "ffmpeg-snapshot.tar.bz2"
385-
cd $PACKAGES/ffmpeg-6023b9f/ || exit
384+
download "https://git.ffmpeg.org/gitweb/ffmpeg.git/snapshot/192d1d34eb3668fa27f433e96036340e1e5077a0.tar.gz" "ffmpeg-snapshot.tar.bz2"
385+
cd $PACKAGES/ffmpeg-192d1d3/ || exit
386386
./configure $ADDITIONAL_CONFIGURE_OPTIONS \
387387
--pkgconfigdir="$WORKSPACE/lib/pkgconfig" \
388388
--prefix=${WORKSPACE} \
389389
--pkg-config-flags="--static" \
390-
--extra-cflags="$CFLAGS" \
391-
--extra-ldflags="$LDFLAGS" \
390+
--extra-cflags="-I$WORKSPACE/include $CFLAGS" \
391+
--extra-ldflags="-L$WORKSPACE/lib $LDFLAGS" \
392392
--extra-libs="-lpthread -lm" \
393393
--enable-static \
394394
--disable-debug \
@@ -419,7 +419,7 @@ cd $PACKAGES/ffmpeg-6023b9f/ || exit
419419
execute make -j $MJOBS
420420
execute make install
421421

422-
INSTALL_FOLDER="/usr/bin"
422+
INSTALL_FOLDER="/usr/bin"
423423
if [[ "$OSTYPE" == "darwin"* ]]; then
424424
INSTALL_FOLDER="/usr/local/bin"
425425
fi
@@ -434,20 +434,25 @@ if [[ $AUTOINSTALL == "yes" ]]; then
434434
sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
435435
sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
436436
echo "Done. ffmpeg is now installed to your system"
437+
else
438+
cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
439+
cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
440+
echo "Done. ffmpeg is now installed to your system"
437441
fi
438442
elif [[ ! $SKIPINSTALL == "yes" ]]; then
439-
if command_exists "sudo"; then
440-
441-
read -r -p "Install the binary to your $INSTALL_FOLDER folder? [Y/n] " response
442-
443-
case $response in
444-
[yY][eE][sS]|[yY])
445-
sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
446-
sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
447-
echo "Done. ffmpeg is now installed to your system"
448-
;;
449-
esac
450-
fi
443+
read -r -p "Install the binary to your $INSTALL_FOLDER folder? [Y/n] " response
444+
case $response in
445+
[yY][eE][sS]|[yY])
446+
if command_exists "sudo"; then
447+
sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
448+
sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
449+
else
450+
cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
451+
cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
452+
fi
453+
echo "Done. ffmpeg is now installed to your system"
454+
;;
455+
esac
451456
fi
452457

453458
exit 0

0 commit comments

Comments
 (0)