/
ffmpeg.sh
executable file
·124 lines (116 loc) · 4.06 KB
/
ffmpeg.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
#!/bin/bash -ex
# Cross-compile ffmpeg for Emscripten
# Copyright (C) 2019 Sylvain Beucler
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
CACHEROOT=$(dirname $(readlink -f $0))/../cache
BUILD=$(dirname $(readlink -f $0))/../build
INSTALLDIR=$(dirname $(readlink -f $0))/../install
PATCHESDIR=$(dirname $(readlink -f $0))/../patches
HOSTPYTHON=$BUILD/hostpython/bin/python
cd $BUILD/
tar xf $CACHEROOT/ffmpeg-3.0.tar.bz2
cd ffmpeg-3.0/
mkdir -p build
cd build/
export CFLAGS="-fno-common"
export CXXFLAGS="-fno-common"
# Configure flags from renpy-deps/build.sh
emconfigure ../configure --prefix=$INSTALLDIR \
--cc=emcc \
--disable-shared \
--enable-runtime-cpudetect \
--enable-avresample \
--disable-encoders \
--disable-muxers \
--disable-bzlib \
--disable-demuxers \
--enable-demuxer=au \
--enable-demuxer=avi \
--enable-demuxer=flac \
--enable-demuxer=m4v \
--enable-demuxer=matroska \
--enable-demuxer=mov \
--enable-demuxer=mp3 \
--enable-demuxer=mpegps \
--enable-demuxer=mpegts \
--enable-demuxer=mpegtsraw \
--enable-demuxer=mpegvideo \
--enable-demuxer=ogg \
--enable-demuxer=wav \
--disable-decoders \
--enable-decoder=flac \
--enable-decoder=mp2 \
--enable-decoder=mp3 \
--enable-decoder=mp3on4 \
--enable-decoder=mpeg1video \
--enable-decoder=mpeg2video \
--enable-decoder=mpegvideo \
--enable-decoder=msmpeg4v1 \
--enable-decoder=msmpeg4v2 \
--enable-decoder=msmpeg4v3 \
--enable-decoder=mpeg4 \
--enable-decoder=pcm_dvd \
--enable-decoder=pcm_s16be \
--enable-decoder=pcm_s16le \
--enable-decoder=pcm_s8 \
--enable-decoder=pcm_u16be \
--enable-decoder=pcm_u16le \
--enable-decoder=pcm_u8 \
--enable-decoder=theora \
--enable-decoder=vorbis \
--enable-decoder=opus \
--enable-decoder=vp3 \
--enable-decoder=vp8 \
--enable-decoder=vp9 \
--disable-parsers \
--enable-parser=mpegaudio \
--enable-parser=mpegvideo \
--enable-parser=mpeg4video \
--enable-parser=vp3 \
--enable-parser=vp8 \
--disable-protocols \
--disable-devices \
--disable-vdpau \
--disable-vda \
--disable-filters \
--disable-bsfs \
--disable-d3d11va \
--disable-dxva2 \
--disable-vaapi \
--disable-vda \
--disable-vdpau \
--disable-videotoolbox \
--disable-iconv \
\
--disable-programs \
--disable-avdevice \
--disable-postproc \
--disable-avfilter \
--disable-protocols \
--disable-network \
--arch=emscripten --disable-asm --disable-stripping --ar=emar --ranlib=emranlib \
--host asmjs-unknown-none
# --enable-cross-compile: requests specifying target and host OS,
# let's rely on emconfigure instead
emmake make -j$(nproc) V=1 || true
cp -p /bin/true doc/print_options
touch doc/print_options
emmake make -j$(nproc) V=1
emmake make install