Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b56a747

Browse filesBrowse files
committed
Packages Updates and OSX El Capitan Update
1 parent 121b435 commit b56a747
Copy full SHA for b56a747

File tree

Expand file treeCollapse file tree

1 file changed

+40
-29
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+40
-29
lines changed

‎build-ffmpeg

Copy file name to clipboardExpand all lines: build-ffmpeg
+40-29Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

3-
# http://www.github.com/markus-perl
4-
# Version 0.2
3+
# https://github.com/markus-perl/ffmpeg-build-script
4+
# Version 0.3
55

66
CWD=`pwd`
77
PACKAGES="$CWD/packages"
@@ -24,13 +24,12 @@ remove_dir () {
2424
if [ -d $1 ]; then
2525
rm -r "$1"
2626
fi
27-
2827
}
2928

3029
download () {
3130
if [ ! -f "$PACKAGES/$2" ]; then
3231

33-
printf "Downloading $1"
32+
echo "Downloading $1"
3433
curl -L --silent -o "$PACKAGES/$2" "$1"
3534
EXITCODE=$?
3635
if [ $EXITCODE -ne 0 ]; then
@@ -39,7 +38,7 @@ download () {
3938
exit 1
4039
fi
4140

42-
printf " ... Done\n"
41+
echo " ... Done"
4342

4443
if ! tar -xvf "$PACKAGES/$2" -C "$PACKAGES" 2>/dev/null >/dev/null; then
4544
echo "Failed to extract $2";
@@ -59,7 +58,6 @@ execute () {
5958
echo "Failed to Execute $@" >&2
6059
exit 1
6160
fi
62-
6361
}
6462

6563
build () {
@@ -73,16 +71,21 @@ build () {
7371
return 1
7472
fi
7573

76-
77-
7874
return 0
7975
}
8076

81-
build_done () {
82-
touch "$PACKAGES/$1.done"
77+
command_exists() {
78+
if ! [ -x "$(command -v $1)" ]; then
79+
return 1
80+
fi
81+
82+
return 0
8383
}
8484

8585

86+
build_done () {
87+
touch "$PACKAGES/$1.done"
88+
}
8689

8790
case "$1" in
8891
"--cleanup")
@@ -103,14 +106,21 @@ case "$1" in
103106
;;
104107
esac
105108

106-
107-
108109
make_dir $PACKAGES
109110
make_dir $WORKSPACE
110111
make_dir $CMPL
111112

112113
export PATH=${WORKSPACE}/bin:$PATH
113114

115+
if ! command_exists "make"; then
116+
echo "make not installed.";
117+
exit 1
118+
fi
119+
120+
if ! command_exists "g++"; then
121+
echo "g++ not installed.";
122+
exit 1
123+
fi
114124

115125
if build "yasm"; then
116126
download "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz" "yasm-1.3.0.tar.gz"
@@ -121,7 +131,6 @@ if build "yasm"; then
121131
build_done "yasm"
122132
fi
123133

124-
125134
if build "opencore"; then
126135
download "http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencore-amr%2Ffiles%2Fopencore-amr%2F&ts=1442256558&use_mirror=netassist" "opencore-amr-0.1.3.tar.gz"
127136
cd $PACKAGES/opencore-amr-0.1.3
@@ -132,8 +141,8 @@ if build "opencore"; then
132141
fi
133142

134143
if build "libvpx"; then
135-
download "http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.4.0.tar.bz2" "libvpx-1.4.0.tar.bz2"
136-
cd $PACKAGES/libvpx*
144+
download "https://github.com/webmproject/libvpx/archive/v1.5.0.tar.gz" "libvpx-1.5.0.tar.gz"
145+
cd $PACKAGES/libvpx*
137146
sed -e 's/cp -p/cp/' -i build/make/Makefile
138147
execute ./configure --prefix=${WORKSPACE} --disable-unit-tests --disable-shared
139148
execute make -j 4
@@ -165,7 +174,6 @@ if build "xvidcore"; then
165174
build_done "xvidcore"
166175
fi
167176

168-
169177
if build "x264"; then
170178
download "ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2" "last_x264.tar.bz2"
171179
cd $PACKAGES/x264-snapshot-*
@@ -185,10 +193,9 @@ if build "libogg"; then
185193
build_done "libogg"
186194
fi
187195

188-
189196
if build "libvorbis"; then
190-
download "http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz" "libvorbis-1.3.4.tar.gz"
191-
cd $PACKAGES/libvorbis-1.3.4
197+
download "http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz" "libvorbis-1.3.5.tar.gz"
198+
cd $PACKAGES/libvorbis-1.3.5
192199
execute ./configure --prefix=${WORKSPACE} --with-ogg-libraries=${WORKSPACE}/lib --with-ogg-includes=${WORKSPACE}/include/ --enable-static --disable-shared --disable-oggtest
193200
execute make -j 4
194201
execute make install
@@ -208,16 +215,16 @@ if build "libtheora"; then
208215
fi
209216

210217
if build "pkg-config"; then
211-
download "http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" "pkg-config-0.28.tar.gz"
212-
cd $PACKAGES/pkg-config-0.28
218+
download "http://pkgconfig.freedesktop.org/releases/pkg-config-0.29.1.tar.gz" "pkg-config-0.29.1.tar.gz"
219+
cd $PACKAGES/pkg-config-0.29.1
213220
execute ./configure --silent --prefix=${WORKSPACE} --with-pc-path=${WORKSPACE}/lib/pkgconfig --with-internal-glib
214221
execute make -j 4
215222
execute make install
216223
build_done "pkg-config"
217224
fi
218225

219226
if build "cmake"; then
220-
download "http://www.cmake.org/files/v3.0/cmake-3.0.2.tar.gz" "cmake-3.0.2.tar.gz"
227+
download "https://cmake.org/files/v3.5/cmake-3.5.0.tar.gz" "cmake-3.5.0.tar.gz"
221228
cd $PACKAGES/cmake*
222229
rm Modules/FindJava.cmake
223230
perl -p -i -e "s/get_filename_component.JNIPATH/#get_filename_component(JNIPATH/g" Tests/CMakeLists.txt
@@ -238,7 +245,7 @@ if build "vid_stab"; then
238245
fi
239246

240247
if build "x265"; then
241-
download "https://bitbucket.org/multicoreware/x265/downloads/x265_1.9.tar.gz" "x265-1.7.tar.gz"
248+
download "https://bitbucket.org/multicoreware/x265/downloads/x265_1.9.tar.gz" "x265-1.9.tar.gz"
242249
cd $PACKAGES/x265_1.9
243250
cd source
244251
execute cmake -DCMAKE_INSTALL_PREFIX:PATH=${WORKSPACE} -DENABLE_SHARED:bool=off .
@@ -250,8 +257,7 @@ if build "x265"; then
250257
fi
251258

252259
if build "fdk_aac"; then
253-
# download "http://downloads.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.3.tar.gz" "fdk-aac-0.1.3.tar.gz"
254-
download "http://ftp.cc.uoc.gr/mirrors/linux/lfs/LFS/7.6/f/fdk-aac-0.1.3.tar.gz" "fdk-aac-0.1.3.tar.gz"
260+
download "http://downloads.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.4.tar.gz?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fopencore-amr%2Ffiles%2Ffdk-aac%2F&ts=1457561564&use_mirror=kent" "fdk-aac-0.1.4.tar.gz"
255261

256262
cd $PACKAGES/fdk-aac*
257263
execute ./configure --prefix=${WORKSPACE} --disable-shared --enable-static
@@ -269,15 +275,20 @@ execute ./configure --arch=64 --prefix=${WORKSPACE} --extra-cflags="-I$WORKSPAC
269275
execute make -j 4
270276
execute make install
271277

278+
INSTALL_FOLDER="/usr/bin"
279+
if [[ "$OSTYPE" == "darwin"* ]]; then
280+
INSTALL_FOLDER="/usr/local/bin"
281+
fi
282+
272283
echo ""
273284
echo "Building done. The binary can be found here: $WORKSPACE/bin/ffmpeg"
274285
echo ""
275-
read -r -p "Install the binary to your /usr/bin/ folder? [Y/n] " response
286+
read -r -p "Install the binary to your $INSTALL_FOLDER folder? [Y/n] " response
276287

277288
case $response in
278289
[yY][eE][sS]|[yY])
279-
sudo cp "$WORKSPACE/bin/ffmpeg" "/usr/bin/ffmpeg"
280-
sudo cp "$WORKSPACE/bin/ffprobe" "/usr/bin/ffprobe"
290+
sudo cp "$WORKSPACE/bin/ffmpeg" "$INSTALL_FOLDER/ffmpeg"
291+
sudo cp "$WORKSPACE/bin/ffprobe" "$INSTALL_FOLDER/ffprobe"
281292
echo "Done. ffmpeg is now installed to your system"
282293
;;
283294
esac

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.