-
Notifications
You must be signed in to change notification settings - Fork 8
/
pbp-install-ffmpeg
executable file
·127 lines (109 loc) · 4.69 KB
/
pbp-install-ffmpeg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/sh
### Package: pbp-install-ffmpeg
### Version: v20200712.1400
### Author: Michael Gan "xmixahlx" [email protected]
### License: GPLv3
### Script Dependencies: linux
## PBPTOOLSDIR
if [ -z $PBPTOOLSDIR ]; then
PBPTOOLSDIR="`pwd`"
fi
## VARS
DATE=`date +%Y%m%d%H%M%S`
RESDIR=$PBPTOOLSDIR/resources
DEVDIR=$PBPTOOLSDIR/upstream
GITREPO=https://github.com/ffmpeg
GITTREE=ffmpeg
# Override n4.3.1 with <branch> i.e. release/4.3, master, etc.
if [ -z $GITBRANCH ]; then
GITBRANCH=n4.3.1
fi
echo "\n*** GITBRANCH selected is $GITBRANCH.\n"
## OVERRIDES
# Override basic with standard or full
if [ -z $BUILDCONFIG ]; then
BUILDCONFIG=basic
fi
echo "\n*** BUILDCONFIG selected is $BUILDCONFIG.\n"
# Override 4.3 with 4.2 to apply 4.2 patch. NOTE: 4.3 patch also applies to master.
if [ -z $FFMPEGREL ]; then
FFMPEGREL=4.3
fi
echo "\n*** FFMPEGREL selected is $FFMPEGREL.\n"
# Override stable with testing.
if [ -z $FFMPEGVER ]; then
FFMPEGVER=stable
fi
echo "\n*** FFMPEGVER selected is $FFMPEGVER.\n"
PKGDIR=$GITTREE\_$GITBRANCH
## DEPS
# Provide INSTALLDEPS=debian to install dependencies.
if [ $INSTALLDEPS ]; then
if [ $INSTALLDEPS = debian ]; then
sudo apt-get -y build-dep ffmpeg
sudo apt-get -y install build-essential coreutils libc-bin wget tar bzip2 patch make \
libudev-dev libdrm-dev
fi
fi
## PREP
set -e
mkdir -p $DEVDIR
cd $DEVDIR
## GIT
[ -d $PKGDIR ] || git clone --depth=1 $GITREPO/$GITTREE.git --branch=$GITBRANCH $PKGDIR
cd $PKGDIR
git clean -f
git reset --hard HEAD
git pull
## PATCH
patch -p1 < $RESDIR/ffmpeg/$FFMPEGREL/current_diff_$FFMPEGVER
## CONFIGURE
if [ $BUILDCONFIG = basic ]; then
echo "\n*** Using basic BUILDCONFIG.\n"
./configure --enable-v4l2-request --enable-libdrm --enable-libudev --enable-pic --enable-shared \
--enable-avfilter --enable-postproc --enable-avresample --enable-pthreads --enable-gpl \
--enable-nonfree --enable-version3 --toolchain=hardened --prefix=/usr/local \
--libdir=/usr/local/lib/aarch64-linux-gnu --shlibdir=/usr/local/lib/aarch64-linux-gnu
fi
if [ $BUILDCONFIG = standard ]; then
echo "\n*** Using standard BUILDCONFIG.\n"
./configure --enable-v4l2-request --enable-libdrm --enable-libudev --enable-pic --enable-shared \
--enable-avfilter --enable-postproc --enable-avresample --enable-pthreads --enable-gpl \
--enable-nonfree --enable-version3 --toolchain=hardened --prefix=/usr/local \
--libdir=/usr/local/lib/aarch64-linux-gnu --shlibdir=/usr/local/lib/aarch64-linux-gnu \
--enable-avfilter --enable-gcrypt --enable-libass --enable-libbluray --enable-libdav1d \
--enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame \
--enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse \
--enable-librsvg --enable-libspeex --enable-libsrt --enable-libtheora --enable-libtwolame \
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 \
--enable-libxml2 --enable-libxvid --enable-opengl --enable-openssl --enable-libx264
fi
if [ $BUILDCONFIG = full ]; then
echo "\n*** Using full BUILDCONFIG.\n"
./configure --enable-v4l2-request --enable-libdrm --enable-libudev --enable-pic --enable-shared \
--enable-avfilter --enable-postproc --enable-avresample --enable-pthreads --enable-gpl \
--enable-nonfree --enable-version3 --toolchain=hardened --prefix=/usr/local \
--libdir=/usr/local/lib/aarch64-linux-gnu --shlibdir=/usr/local/lib/aarch64-linux-gnu \
--enable-avfilter --enable-gcrypt --enable-libass --enable-libbluray --enable-libdav1d \
--enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame \
--enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse \
--enable-librsvg --enable-libspeex --enable-libsrt --enable-libtheora --enable-libtwolame \
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 \
--enable-libxml2 --enable-libxvid --enable-opengl --enable-openssl --enable-libx264 \
--enable-ladspa --enable-libaom --enable-libaribb24 --enable-libbs2b --enable-libcaca \
--enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfribidi \
--enable-libgme --enable-libgsm --enable-libilbc --enable-libjack --enable-libkvazaar --enable-liblensfun \
--enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librubberband \
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtesseract --enable-libvidstab \
--enable-libvo-amrwbenc --enable-libwebp --enable-libzimg --enable-libzmq --enable-libzvbi \
--enable-lv2 --enable-openal --enable-opencl --enable-chromaprint --enable-frei0r \
--enable-libiec61883 --enable-libdc1394
fi
## BUILD
make -j `nproc`
## INSTALL
sudo make install
sudo ldconfig
## EXIT
exit
## ENJOY