summaryrefslogtreecommitdiffstats
path: root/Building_Source_v2_0.md
blob: 8b7504fb0370afcd3ec35c84116d1af087b32518 (plain)
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
This section explains how to build the project using **CentOS 64** but could be easily adapted for any _Linux_, _Windows_ or _OS X_.<br />




## Preparing the system ##
```
sudo yum update
sudo yum install make libtool autoconf subversion git wget libogg-devel gcc gcc-c++ pkgconfig nasm
```

The first step is to checkout Doubango 2.0 source code:
```
git clone https://github.com/DoubangoTelecom/doubango.git
```

### Building libsrtp ###
libsrtp is optional.
```
git clone https://github.com/cisco/libsrtp/
cd libsrtp
git checkout v1.5.0
CFLAGS="-fPIC" ./configure --enable-pic && make && make install
```

### Building OpenSSL ###
**OpenSSL** is required if you want to use the _RTCWeb Breaker_ module or Secure WebSocket transport (WSS). **OpenSSL version _1.0.1_ is required if you want support for _DTLS-SRTP_**.<br />
This section is only required if you don’t have _OpenSSL_ installed on your system or using version prior to _1.0.1_ and want to enable _DTLS-SRTP_.<br />
A quick way to have _OpenSSL_ may be installing **openssl-devel** package but this version will most likely be outdated (prior to _1.0.1_). Anyway, you can check the version like this:
```
openssl version 
```
To build OpenSSL:
```
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar -xvzf openssl-1.0.1c.tar.gz
cd openssl-1.0.1c
./config shared --prefix=/usr/local --openssldir=/usr/local/openssl && make && make install
```

### Building libspeex and libspeexdsp ###
**libspeex** (audio codec) an **libspeexdsp** (audio processing and jitter buffer) are optional. It’s highly recommended to enable libspeexdsp.

You can install the devel packages:
```
sudo yum install speex-devel
```
Or build the source by yourself:
```
wget http://downloads.xiph.org/releases/speex/speex-1.2beta3.tar.gz
tar -xvzf speex-1.2beta3.tar.gz
cd speex-1.2beta3
./configure --disable-oggtest --without-libogg && make && make install
```

### Building YASM ###
**YASM** is only required if you want to enable **VPX** (VP8 video codec) or **x264** (H.264 codec).
```
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar -xvzf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure && make && make install
```

### Building libvpx ###
_Date: December 1, 2012_ <br />
**libvpx** adds support for **VP8** and is optional but highly recommended if you want support for video when using Google Chrome or Mozilla Firefox.

You can install the devel packages:
```
sudo yum install libvpx-devel
```
Or build the source by yourself:
```
git clone http://git.chromium.org/webm/libvpx.git
cd libvpx
./configure --enable-realtime-only --enable-error-concealment --disable-examples --enable-vp8 --enable-pic --enable-shared --as=yasm
make && make install
```

### Building libyuv ###
**libyuv** is optional. Adds support for video scaling and chroma conversion.
```
mkdir libyuv && cd libyuv
svn co http://src.chromium.org/svn/trunk/tools/depot_tools . 
./gclient config http://libyuv.googlecode.com/svn/trunk
./gclient sync && cd trunk
make -j6 V=1 -r libyuv BUILDTYPE=Release
#cp out/Release/obj.target/libyuv.a /usr/local/lib
#mkdir /usr/local/include/libyuv && cp -r include/* /usr/local/include/libyuv
```

### Building libopus ###
**libopus** is optional but highly recommended as it’s an MTI codec for WebRTC. Adds support for [Opus audio codec](http://www.opus-codec.org/).
```
wget http://downloads.xiph.org/releases/opus/opus-1.0.2.tar.gz
tar -xvzf opus-1.0.2.tar.gz
cd opus-1.0.2
./configure --with-pic --enable-float-approx && make && make install
```

### Building opencore-amr ###
**opencore-amr** is optional. Adds support for **AMR** audio codec.
```
git clone git://opencore-amr.git.sourceforge.net/gitroot/opencore-amr/opencore-amr
cd opencore-amr && autoreconf --install && ./configure && make && make install
```

### Building libgsm ###
**libgsm** is optional. Adds support for **GSM** audio codec.

You can install the devel packages (**recommended**):
```
sudo yum install gsm-devel
```
Or build the source by yourself:
```
wget http://www.quut.com/gsm/gsm-1.0.13.tar.gz
tar -xvzf gsm-1.0.13.tar.gz
cd gsm-1.0-pl13 && make && make install
#cp -rf ./inc/* /usr/local/include
#cp -rf ./lib/* /usr/local/lib
```

### Building g729 ###
**G729** is optional. Adds support for **G.729** audio codec.
```
svn co http://g729.googlecode.com/svn/trunk/ g729b
cd g729b
./autogen.sh && ./configure --enable-static --disable-shared && make && make install
```

### Building iLBC ###
**iLBC** is optional. Adds support for **iLBC** audio codec.
```
svn co http://doubango.googlecode.com/svn/branches/2.0/doubango/thirdparties/scripts/ilbc
cd ilbc
wget http://www.ietf.org/rfc/rfc3951.txt
awk -f extract.awk rfc3951.txt
./autogen.sh && ./configure
make && make install
```

### Building x264 ###
_Date: December 2, 2012_ <br />
**x264** is optional and adds support for **H.264** video codec (requires FFmpeg).
```
wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar -xvjf last_x264.tar.bz2
# the output directory may be difference depending on the version and date
cd x264-snapshot-20121201-2245
./configure --enable-shared --enable-pic && make && make install
```

### Building FFmpeg ###
_Date: December 2, 2012_ <br />
**FFmpeg** is optional and adds support for **H.263**, **H.264** (requires **x264**) and **MP4V-ES** video codecs.
```
git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
cd ffmpeg

# grap a release branch
git checkout n1.2

# configure source code
./configure \
--extra-cflags="-fPIC" \
--extra-ldflags="-lpthread" \
\
--enable-pic --enable-memalign-hack --enable-pthreads \
--enable-shared --disable-static \
--disable-network --enable-pthreads \
--disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe \
\
--enable-gpl --enable-nonfree \
\
--disable-debug

# to force enabling h264, append to the configure command: --enable-libx264 --enable-encoder=libx264 --enable-decoder=h264
# to force enabling h263 and h263+, append to the configure command: --enable-encoder=h263 --enable-encoder=h263p --enable-decoder=h263

# build and install
make && make install
```

### Building `OpenH264` ###
**OpenH264** is optional. Adds support for **H.264** constrained baseline video codec.
```
git clone https://github.com/cisco/openh264.git
cd openh264
git checkout v1.5.0
make ENABLE64BIT=Yes # Use ENABLE64BIT=No for 32bit platforms
make install
```

### Building Doubango ###
  * Minimal build
```
cd doubango && ./autogen.sh && ./configure --with-ssl --with-srtp --with-speexdsp
make && make install
```
  * Recommended build
```
cd doubango && ./autogen.sh && ./configure --with-ssl --with-srtp --with-speexdsp --with-ffmpeg --with-opus
make && make install
```
  * Full build
```
cd doubango && ./autogen.sh && ./configure --with-ssl --with-srtp --with-vpx --with-yuv --with-amr --with-speex --with-speexdsp --enable-speexresampler --enable-speexdenoiser --with-opus --with-gsm --with-ilbc --with-g729 --with-ffmpeg
make && make install
```

<br />
Et voilà
OpenPOWER on IntegriCloud