-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.ffmpeg-local
269 lines (241 loc) · 7.38 KB
/
Makefile.ffmpeg-local
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
#####################################################################
#
# Build ffmpeg from web.
#
# Dennis Zierahn
#
ffmpeg_version = git
ffmpeg = ffmpeg-$(ffmpeg_version)
all: ffmpeg
ffmpeg-local-doit: ./ffmpeg-local
cd ./ffmpeg-local; make all
#####################################################################
#
# Local setup
#
./ffmpeg-local:
mkdir ./ffmpeg-local
ln -s ../Makefile.ffmpeg-local ./ffmpeg-local/Makefile
#####################################################################
#
# ffmpeg
#
$(ffmpeg):
git clone git://source.ffmpeg.org/ffmpeg $(ffmpeg)
tar -cvzf ffmpeg-git.tar.gz $(ffmpeg)
mv -f ffmpeg-git.tar.gz ../download
$(ffmpeg)/libavfilter/vf_logo.c:
cd $(ffmpeg)/libavfilter; \
cp ../../../filters/vf_logo.c .; \
HAVE_VFLOGO=`fgrep -o "REGISTER_FILTER(LOGO" allfilters.c`; \
if test "x$$HAVE_VFLOGO" = "x"; then \
sed -i '/initialized = 1;/ a\\n\tREGISTER_FILTER(LOGO,\t\t\tlogo,\t\t\tvf);' allfilters.c; \
fi; \
HAVE_VFLOGO=`fgrep -o "CONFIG_LOGO_FILTER" Makefile`; \
if test "x$$HAVE_VFLOGO" = "x"; then \
sed -i '$$ a\\nOBJS-$$(CONFIG_LOGO_FILTER) += vf_logo.o' Makefile; \
fi; \
ffmpeg-common = \
--disable-asm \
--enable-gpl \
--enable-version3 \
--enable-nonfree \
--enable-runtime-cpudetect \
--enable-hardcoded-tables \
--enable-zlib \
--enable-bzlib \
--enable-gnutls \
--enable-librtmp \
--enable-libfreetype \
--enable-libfdk-aac \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libvo-aacenc \
--enable-libvo-amrwbenc \
--enable-libmp3lame \
--enable-libopenjpeg \
--enable-libtheora \
--enable-libvorbis \
--enable-libspeex \
--disable-libass \
--enable-libopus \
--enable-libgsm \
--enable-libvpx \
--enable-libxavs \
--enable-libxvid \
--enable-libx264 \
--enable-libbluray \
--enable-libschroedinger \
--enable-libilbc \
--enable-fontconfig \
--enable-frei0r \
--disable-filter=frei0r \
ffmpeg-alloptions = \
--enable-gpl \
--enable-nonfree \
--enable-version3 \
--enable-fontconfig \
--enable-frei0r \
--enable-gnutls \
--enable-ladspa \
--enable-libass \
--enable-libbluray \
--enable-libcaca \
--enable-libcdio \
--enable-libcelt \
--enable-libdc1394 \
--enable-libfaac \
--enable-libfdk-aac \
--enable-libflite \
--enable-libfreetype \
--enable-libgme \
--enable-libgsm \
--enable-libiec61883 \
--enable-libilbc \
--enable-libmodplug \
--enable-libmp3lame \
--enable-libnut \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libpulse \
--enable-librtmp \
--enable-libschroedinger \
--enable-libshine \
--enable-libsoxr \
--enable-libspeex \
--enable-libssh \
--enable-libtheora \
--enable-libtwolame \
--enable-libutvideo \
--enable-libv4l2 \
--enable-libvidstab \
--enable-libvo-aacenc \
--enable-libvo-amrwbenc \
--enable-libvorbis \
--enable-libvpx \
--enable-libwavpack \
--enable-libwebp \
--enable-libx264 \
--enable-libxavs \
--enable-libxvid \
--enable-libzvbi \
--enable-openal \
--enable-opencl \
--enable-opengl \
--enable-x11grab \
ffmpeg-allshared = \
--enable-shared \
--enable-static \
--enable-libaacplus \
--enable-libopus \
--enable-libquvi \
--enable-openssl \
ffmpeg-allstatic = \
--enable-static \
--disable-shared \
--extra-ldflags="-v" \
ffmpeg-alloptionsfail = \
--enable-avisynth \
--enable-libopencv \
--enable-libstagefright-h264 \
--enable-libx265 \
--enable-decklink \
ffmpeg-shared = \
--enable-shared \
--disable-static \
ffmpeg-static = \
--disable-shared \
--enable-static \
--extra-ldflags="-L../ffmpeg-static" \
ffmpeg-libs = \
--extra-libs="-lm" \
--extra-libs="-lz" \
--extra-libs="-ldl" \
--extra-libs="-lbz2" \
--extra-libs="-lxml2" \
--extra-libs="-lexpat" \
--extra-libs="-lfreetype" \
--extra-libs="-lfontconfig" \
--extra-libs="-lfribidi" \
--extra-libs="-lorc-0.4" \
--extra-libs="-lgmp" \
--extra-libs="-lhogweed" \
--extra-libs="-lnettle" \
--extra-libs="-lgnutls" \
--extra-libs="-ljpeg" \
--extra-libs="-lcdio" \
--extra-libs="-lcdio_cdda" \
--extra-libs="-lcdio_paranoia" \
ffmpeg-darwin:
--extra-libs="-liconv" \
ffmpeg-moreoptions-dont-work-yet:
--enable-libcdio \
--enable-libutvideo \
ffmpeg-env-xodroid= \
export TARGET_SUBARCH="armv7"; \
export TARGET_CPU="cortex-a9"; \
export TARGET_FLOAT="hard"; \
export TARGET_FPU="neon"; \
export TARGET_FPU_FLAGS="-mfloat-abi=$$TARGET_FLOAT -mfpu=$$TARGET_FPU"; \
export TARGET_EXTRA_FLAGS="-Wno-psabi -Wa,-mno-warn-deprecated"; \
export TARGET_COPT="-Wall -pipe -fomit-frame-pointer -O3"; \
export TARGET_COPT="$$TARGET_COPT -fexcess-precision=fast -ffast-math -funsafe-math-optimizations"; \
export TARGET_LOPT="-s -Wl,--as-needed"; \
export CFLAGS="-mcpu=$$TARGET_CPU $$TARGET_FPU_FLAGS -mabi=aapcs-linux"; \
export CFLAGS="$$CFLAGS $$TARGET_COPT $$TARGET_EXTRA_FLAGS"; \
export CXXFLAGS="$$CFLAGS"; \
export CFLAGS="$$CFLAGS -fgnu89-inline"; \
export CPPFLAGS="$$CFLAGS"; \
export LDFLAGS="-L/opt/vc/lib -march=$$TARGET_SUBARCH -mtune=$$TARGET_CPU $$TARGET_LOPT"
ffmpeg-static:
mkdir -p ffmpeg-static
[ -d /lib ] && ln -sf /lib/lib*.a ffmpeg-static || true
[ -d /usr/lib ] && ln -sf /usr/lib/lib*.a ffmpeg-static || true
[ -d /usr/local/lib ] && ln -sf /usr/local/lib/lib*.a ffmpeg-static || true
[ -d /usr/local/lib64 ] && ln -sf /usr/local/lib64/lib*.a ffmpeg-static || true
[ -d /lib/arm-linux-gnueabihf ] && ln -sf /lib/arm-linux-gnueabihf/lib*.a ffmpeg-static || true
[ -d /usr/lib/arm-linux-gnueabihf ] && ln -sf /usr/lib/arm-linux-gnueabihf/lib*.a ffmpeg-static || true
$(ffmpeg)/dezi.static.conf: ffmpeg-static
cd $(ffmpeg); \
make distclean; \
./configure $(ffmpeg-common) $(ffmpeg-static) $(ffmpeg-libs) || exit; \
touch dezi.static.conf
$(ffmpeg)/dezi.static.done: $(ffmpeg)/dezi.static.conf
cd $(ffmpeg); \
make -j6 || exit; \
sudo make install; \
[ -f ffmpeg ] && sudo mv -f /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg-static || true; \
[ -f ffplay ] && sudo mv -f /usr/local/bin/ffplay /usr/local/bin/ffplay-static || true; \
[ -f ffprobe ] && sudo mv -f /usr/local/bin/ffprobe /usr/local/bin/ffprobe-static || true; \
[ -f ffserver ] && sudo mv -f /usr/local/bin/ffserver /usr/local/bin/ffserver-static || true; \
touch dezi.static.done
$(ffmpeg)/dezi.shared.conf:
cd $(ffmpeg); \
make distclean; \
./configure $(ffmpeg-common) $(ffmpeg-shared) $(ffmpeg-libs) || exit; \
touch dezi.shared.conf
$(ffmpeg)/dezi.shared.done: $(ffmpeg)/dezi.shared.conf
cd $(ffmpeg); \
make -j6 || exit; \
sudo make install; \
[ -f ffmpeg ] && sudo mv -f /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg-shared || true; \
[ -f ffplay ] && sudo mv -f /usr/local/bin/ffplay /usr/local/bin/ffplay-shared || true; \
[ -f ffprobe ] && sudo mv -f /usr/local/bin/ffprobe /usr/local/bin/ffprobe-shared || true; \
[ -f ffserver ] && sudo mv -f /usr/local/bin/ffserver /usr/local/bin/ffserver-shared || true; \
touch dezi.shared.done
$(ffmpeg)/dezi.test.conf:
cd $(ffmpeg); \
rm -f ffmpeg ffplay ffprobe ffserver; \
rm -f ffmpeg_g ffplay_g ffprobe_g ffserver_g; \
./configure $(ffmpeg-alloptions) $(ffmpeg-allstatic) || exit; \
touch dezi.test.conf
ffmpeg-test: \
$(ffmpeg) \
$(ffmpeg)/libavfilter/vf_logo.c \
$(ffmpeg)/dezi.test.conf \
ffmpeg: \
$(ffmpeg) \
$(ffmpeg)/libavfilter/vf_logo.c \
$(ffmpeg)/dezi.shared.done \
$(ffmpeg)/dezi.static.done \