-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure_ffmpeg_dash_client.sh
More file actions
executable file
·151 lines (134 loc) · 3.65 KB
/
configure_ffmpeg_dash_client.sh
File metadata and controls
executable file
·151 lines (134 loc) · 3.65 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
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
#!/bin/bash
# This is a helper script to configure ffmpeg for dash demuxing. THIS DOES NOT BUILD ANYTHING!
# It will enter the source directory and run the configuration script. It will
# then return to this directory and you will have to manually enter the ffmpeg
# directory type 'make'.
########## BEGIN USER EDIT SECTION #############
srcDir=~/code/FFmpeg
# Set the HSOT OS (the OS currently running this script). Options are:
# WIN64
# LINUX64
# MACOS
HOST_OS=MACOS
# Set the TARGET OS (the OS we are building for). Options are:
# WIN64
# LINUX64
# LINUXARM
# MACOS
TARGET_OS=MACOS
# Set to 1 for Debug build, 0 for release build
DEBUG=0
# Enabled features.
# This example is for a streaming client, but you can
# put anything you want here. See ./configure --help for more info.
ENABLED="--enable-protocol=file,https,http
--enable-avformat
--enable-avcodec
--enable-muxer=segment,image2
--enable-decoder=h264,aac,hevc
--enable-demuxer=aac,h264,hevc,dash,matroska,mpegvideo
--enable-parser=mpeg4video,aac,h264,hevc
--enable-filter=showinfo
--enable-libxml2
--enable-zlib
--enable-gnutls"
# Disabled features
# This compiles SOOOO much faster and easier if you only
# compile what you need.
DISABLED=""
balh="--disable-ffprobe
--disable-ffplay
--disable-symver
--disable-encoders
--disable-decoders
--disable-muxers
--disable-demuxers
--disable-parsers
--disable-bsfs
--disable-protocols
--disable-indevs
--disable-outdevs
--disable-filters
--disable-doc
--disable-avdevice"
# Temporary features that should be removed before checking in this file
TEMPORARY=""
########## END USER EDIT SECTION #############
# Let's begin. First, enter the new directory
originalDir=`pwd`
cd $srcDir
CFLAGS=""
LDFLAGS=""
OS_SPECIFIC=""
# Depending on the host OS
case "$HOST_OS" in
WIN64)
case "$TARGET_OS" in
WIN64)
OS_SPECIFIC="--toolchain=msvc"
CFLAGS+=""
LDFLAGS+="-nodefaultlib:LIBCMT "
;;
esac
;;
LINUX64)
case "$TARGET_OS" in
WIN64)
# Select the mingw toolchain
# x86 is probably i686-w64-mingw32-
# x64 is probably x86_64-w64-mingw32-
OS_SPECIFIC="--cross-prefix=x86_64-w64-mingw32- --arch=x86 --target-os=mingw32 --enable-w32threads"
CFLAGS+="-D__USE_MINGW_ANSI_STDIO=0 "
;;
LINUX64)
export CFLAGS="-I /usr/include"
export LDFLAGS="-L /usr/lib/x86_64-linux-gnu"
OS_SPECIFIC="--arch=x86 --enable-pic"
CFLAGS+="-mcmodel=large "
;;
LINUXARM)
echo "Linux ARM not supported yet! But you are welcome to put it in ;)"
;;
esac
;;
MACOS)
case "$TARGET_OS" in
ARMV7A)
# JH: This is a purely llvm compilation, gcc isn't used at all.
# I found lots of older "gcc" ways of doing this but this is the
# most modern and best way, methinks.
SYSROOT="${NDK}/toolchains/llvm/prebuilt/darwin-x86_64/sysroot"
TOOLCHAIN="${NDK}/toolchains/llvm/prebuilt/darwin-x86_64"
CFLAGS="--target=armv7-linux-androideabi26,--gcc-toolchain=$TOOLCHAIN,mfloat-abi=softfp"
OS_SPECIFIC="--disable-runtime-cpudetect \
--arch=arm \
--cpu=armv7-a \
--cc=$TOOLCHAIN/bin/armv7a-linux-androideabi26-clang \
--target-os=android \
--disable-symver \
--sysroot=$SYSROOT \
--enable-cross-compile"
;;
MACOS)
;;
esac
;;
esac
if [ $DEBUG == 1 ]; then
OPTIMIZATIONS="--disable-optimizations --enable-debug=3"
else
# Don't enable --enable-runtime-cpudetect if cross-compiling!
OPTIMIZATIONS="--disable-debug"
fi
# Run the configure script
ARGS="$OS_SPECIFIC \
$OPTIMIZATIONS \
$DISABLED $ENABLED \
--enable-lto \
--extra-cflags=\"$CFLAGS\" \
--extra-ldflags=\"$LDFLAGS\" \
$TEMPORARY"
./configure $ARGS
echo $ARGS
# Finally, return to the original directory
cd $originalDir