forked from ffmpeginteropx/FFmpegInteropX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFFmpegConfig.sh
More file actions
123 lines (106 loc) · 2.6 KB
/
FFmpegConfig.sh
File metadata and controls
123 lines (106 loc) · 2.6 KB
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
#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
declare -A arch
arch['x86']='x86'
arch['x64']='x86_64'
arch['ARM']='arm'
arch['ARM64']='arm64'
variant=$1
platform=$2
sharedOrStatic=$3
intDir="$DIR/Intermediate/FFmpeg$variant/$platform/int/ffmpeg"
outDir="$DIR/Output/FFmpeg$variant/$platform"
#Main
echo "Make $variant $platform $sharedOrStatic $intDir $outDir"
mkdir -p $intDir
cd $intDir
configureArgs="\
--toolchain=msvc \
--disable-doc \
--arch=${arch[$platform]} \
--enable-${sharedOrStatic} \
--enable-cross-compile \
--enable-debug \
--enable-zlib \
--enable-bzlib \
--enable-lzma \
--enable-libxml2 \
--enable-iconv \
--enable-libdav1d \
--enable-openssl \
--target-os=win32 \
--pkg-config=$DIR/Intermediate/pkg-config.exe \
--prefix=$outDir \
"
cflags="-MD -DLZMA_API_STATIC"
if [ "$variant" == "UWP" ]; then
configureArgs="\
$configureArgs \
--disable-encoders \
--disable-devices \
--enable-hwaccels \
--enable-d3d11va \
--disable-dxva2 \
--disable-programs \
--extra-ldflags='-APPCONTAINER WindowsApp.lib' \
"
cflags="\
$cflags \
-DWINAPI_FAMILY=WINAPI_FAMILY_APP \
-D_WIN32_WINNT=0x0A00
"
if [ "$platform" = "x64" ] || [ "$platform" = "x86" ]; then
configureArgs="\
$configureArgs \
--extra-cflags='$cflags'
"
fi
if [ "$platform" = "ARM" ] || [ "$platform" = "ARM64" ]; then
configureArgs="\
$configureArgs \
--extra-cflags='$cflags -D__ARM_PCS_VFP'
"
fi
fi
if [ "$variant" == "Desktop" ]; then
configureArgs="\
$configureArgs \
--enable-libx264 \
--enable-libx265 \
--enable-libvpx \
--enable-gpl \
--enable-static \
--extra-ldflags='-APPCONTAINER:NO -MACHINE:$platform'
"
if [ "$sharedOrStatic" = "shared" ]; then
configureArgs="\
$configureArgs \
--extra-cflags='$cflags -D_WINDLL' \
"
else
configureArgs="\
$configureArgs \
--extra-cflags='$cflags' \
"
fi
fi
if [ "$platform" == "ARM" ]; then
configureArgs="\
$configureArgs \
--arch=arm \
--as=armasm.exe \
--cpu=armv7
"
fi
if [ "$platform" = "ARM64" ]; then
configureArgs="\
$configureArgs \
--arch=arm64 \
--as=armasm64.exe \
--cpu=armv8
"
fi
eval $DIR/Libs/ffmpeg/configure $configureArgs || exit 1
make -j$(nproc) || exit
make install || exit
exit 0