forked from Raman148/ffmpeg-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·182 lines (161 loc) · 5.82 KB
/
run.sh
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/bin/bash
set -euo pipefail
echo "/usr/local/lib" > /etc/ld.so.conf.d/libc.conf
export MAKEFLAGS="-j$[$(nproc) + 1]"
export SRC=/usr/local
export PKG_CONFIG_PATH=${SRC}/lib/pkgconfig
yum install -y autoconf automake gcc gcc-c++ git libtool make nasm zlib-devel \
openssl-devel tar cmake perl which bzip2
# yasm
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz | \
tar zxvf - -C . && \
cd ${DIR}/yasm-${YASM_VERSION} && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" --docdir=${DIR} -mandir=${DIR}&& \
make && \
make install && \
make distclean && \
rm -rf ${DIR}
# x264 TODO : pin version
DIR=$(mktemp -d) && cd ${DIR} && \
git clone --depth 1 git://git.videolan.org/x264 && \
cd x264 && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" --enable-static && \
make && \
make install && \
make distclean && \
rm -rf ${DIR}
# x265
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s https://bitbucket.org/multicoreware/x265/get/${X265_VERSION}.tar.gz | tar zxvf - -C . && \
cd multicoreware-*/source && \
cmake -G "Unix Makefiles" . && \
cmake . && \
make && \
make install && \
rm -rf ${DIR}
# libogg
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz | tar zxvf - -C . && \
cd libogg-${OGG_VERSION} && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" --disable-shared --docdir=/dev/null && \
make && \
make install && \
make distclean && \
rm -rf ${DIR}
# libopus
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz | tar zxvf - -C . && \
cd opus-${OPUS_VERSION} && \
autoreconf -fiv && \
./configure --prefix="${SRC}" --disable-shared && \
make && \
make install && \
make distclean && \
rm -rf ${DIR}
# libvorbis
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz | tar zxvf - -C . && \
cd libvorbis-${VORBIS_VERSION} && \
./configure --prefix="${SRC}" --with-ogg="${SRC}" --bindir="${SRC}/bin" \
--disable-shared --datadir=${DIR} && \
make && \
make install && \
make distclean && \
rm -rf ${DIR}
# libtheora
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2 | tar jxvf - -C . && \
cd libtheora-${THEORA_VERSION} && \
./configure --prefix="${SRC}" --with-ogg="${SRC}" --bindir="${SRC}/bin" \
--disable-shared --datadir=${DIR} && \
make && \
make install && \
make distclean && \
rm -rf ${DIR}
# libvpx
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s https://codeload.github.com/webmproject/libvpx/tar.gz/v${VPX_VERSION} | tar zxvf - -C . && \
cd libvpx-${VPX_VERSION} && \
./configure --prefix="${SRC}" --enable-vp8 --enable-vp9 --disable-examples && \
make && \
make install && \
make clean && \
rm -rf ${DIR}
# libmp3lame
DIR=$(mktemp -d) && cd ${DIR} && \
curl -L -s http://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION%.*}/lame-${LAME_VERSION}.tar.gz | tar zxvf - -C . && \
cd lame-${LAME_VERSION} && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" --disable-shared --enable-nasm && \
make && \
make install && \
make distclean&& \
rm -rf ${DIR}
# faac + http://stackoverflow.com/a/4320377
DIR=$(mktemp -d) && cd ${DIR} && \
curl -L -s http://downloads.sourceforge.net/faac/faac-${FAAC_VERSION}.tar.gz | tar zxvf - -C . && \
cd faac-${FAAC_VERSION} && \
sed -i '126d' common/mp4v2/mpeg4ip.h && \
./bootstrap && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" && \
make && \
make install &&\
rm -rf ${DIR}
# xvid
DIR=$(mktemp -d) && cd ${DIR} && \
curl -L -s http://downloads.xvid.org/downloads/xvidcore-${XVID_VERSION}.tar.gz | tar zxvf - -C .&& \
cd xvidcore/build/generic && \
./configure --prefix="${SRC}" --bindir="${SRC}/bin" && \
make && \
make install&& \
rm -rf ${DIR}
# fdk-aac
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s https://codeload.github.com/mstorsjo/fdk-aac/tar.gz/v${FDKAAC_VERSION} | tar zxvf - -C . && \
cd fdk-aac-${FDKAAC_VERSION} && \
autoreconf -fiv && \
./configure --prefix="${SRC}" --disable-shared && \
make && \
make install && \
make distclean && \
rm -rf ${DIR}
# ffmpeg
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz | tar zxvf - -C . && \
cd ffmpeg-${FFMPEG_VERSION} && \
./configure --prefix="${SRC}" --extra-cflags="-I${SRC}/include" \
--extra-ldflags="-L${SRC}/lib" --bindir="${SRC}/bin" \
--extra-libs=-ldl --enable-version3 --enable-libfaac --enable-libmp3lame \
--enable-libx264 --enable-libxvid --enable-gpl \
--enable-postproc --enable-nonfree --enable-avresample --enable-libfdk_aac \
--disable-debug --enable-small --enable-openssl --enable-libtheora \
--enable-libx265 --enable-libopus --enable-libvorbis --enable-libvpx && \
make && \
make install && \
make distclean && \
hash -r && \
cd tools && \
make qt-faststart && \
cp qt-faststart ${SRC}/bin && \
rm -rf ${DIR}
# mplayer
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://mplayerhq.hu/MPlayer/releases/MPlayer-${MPLAYER_VERSION}.tar.gz | tar zxvf - -C . && \
cd MPlayer-${MPLAYER_VERSION} && \
./configure --prefix="${SRC}" --extra-cflags="-I${SRC}/include" --extra-ldflags="-L${SRC}/lib" --bindir="${SRC}/bin" && \
make && \
make install && \
rm -rf ${DIR}
yum history -y undo last && yum clean all && rm -rf /var/lib/yum/*
# nodejs
yum install make gcc gcc-c++ -y
DIR=$(mktemp -d) && cd ${DIR} && \
curl -s http://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}.tar.gz | tar zxvf - -C . && \
cd node-v* && \
./configure && \
make && \
make install && \
rm -rf ${DIR}
yum clean all
rm -rf /var/lib/yum/yumdb/*
echo "/usr/local/lib" > /etc/ld.so.conf.d/libc.conf