- Before you start
- Getting the code
- Contributing patches
- Example Applications
- AppRTCDemo (Android application using WebRTC Native APIs via JNI)
- Peerconnection (Application using WebRTC Native APIs)
- Call (Application that establishes a call using libjingle)
- WebRTCDemo (Android application using media engines)
- Relay server (specialized server application that can be used with Call)
- STUN server
- TURN server
Before you start
First, be sure to install the prerequisite software.
The currently supported platforms are Windows, Mac OS X, Linux, Android and iOS. See this page for iOS instructions.
Getting the code
Create a working directory, enter it, and run:
$ gclient config --name src http://webrtc.googlecode.com/svn/trunk
Linux & Android specific steps. *
Select build system (optional for all OSs except Android where ninja is mandatory). *
$ gclient sync --force
Starred (*) items are described in their own section below and should be performed, if at all, in place.
If you’re a committer, substitute
On Windows, use
gclient.batinstead (or prefix the commands by invoking python).
Android requires that you build on a Linux machine.
gclient sync command fetches dependencies and generates native build files for your environment using gyp (Windows: ninja/Visual Studio, OS X: ninja/XCode, Linux: ninja/make, Android: ninja). Ninja is the default build system for all platforms. It is possible to just generate new build files by calling:
$ gclient runhooks --force
Linux & Android Specific Steps
If building for Linux or Android these steps should be inlined above.
For Linux or Android:
$ export JAVA_HOME=<location of OpenJDK 7>
$ echo "target_os = ['android', 'unix']" >> .gclient $ gclient sync $ cd src $ source ./build/android/envsetup.sh $ export GYP_DEFINES="$GYP_DEFINES OS=android"
Select build system
You can directly specify which build system to use. This can be done if you
don’t want to use ninja. Set the
GYP_GENERATORS environment variable to the
msvsfor Visual Studio
msvs-ninjafor Visual Studio project building with ninja
Note, when the build environment is set to generate Visual Studio project files, gyp will by default, generate a project for the latest version of Visual Studio installed on your computer. It is possible to specify the desired Visual Studio version as described below:
Set environment variable
GYP_MSVS_VERSION=<version> before runhooks or
manually run the following gyp command from the src/ directory (this replaces
$ webrtc/build/gyp_webrtc -G msvs_version=<version>
<version> is on the form
Using git instead of svn
While the authoritative repo uses subversion, it’s possible to mostly ignore that during development and use git instead. A basic recipe for setting up git-svn in a new checkout on linux is:
gclient config --name src 'git+https://chromium.googlesource.com/external/webrtc' && \ gclient sync -j200 && \ cd src && \ git svn init --prefix=origin/ https://webrtc.googlecode.com/svn -Ttrunk --rewrite-root=http://webrtc.googlecode.com/svn && \ git config svn-remote.svn.fetch trunk:refs/remotes/origin/master && \ git svn fetch && \ git checkout master && \ git branch -vv && \ echo Yay
Binaries are by default (i.e. when building with ninja) generated in out/Debug/ and out/Release/ for debug and release builds respectively.
$ cd src
$ ninja -C out/Debug
$ ninja -C out/Release
With Visual Studio
Use Visual Studio to open and build the src/all.sln solution file.
Please see Contributing bug fixes for information on how to get your changes included in the webrtc codebase.
WebRTC contains several example applications which can be found under src/webrtc/examples and src/talk/examples. Higher level applications are listed first.
AppRTCDemo (Android application using WebRTC Native APIs via JNI)
Peerconnection (Application using WebRTC Native APIs)
Peerconnection consist of two applications. A server application, with target
name peerconnection_server, and a client application, with target name
peerconnection_client. Note that we currently don’t support
peerconnection_client for Mac and Android.
The client application has simple voice and video capabilities. The server enables client applications to initiate a call between clients by managing signaling messages generated by the clients.
Setting up P2P calls between peerconnection_clients
peerconnection_server. You should see the following message indicating
that it is running:
Server listening on port 8888
Start any number of
peerconnection_clients and connect them to the server.
The client UI consists of a few parts:
Connecting to a server: When the application is started you must specify which machine (IP-address) the server application is running on. Once that is done you can press Connect or the return button.
Select a peer: Once successfully connected to a server you can connect to a peer by double clicking or select+press return on a peer’s name.
Video chat: When a peer has been successfully connected to, a Video chat will be displayed in full window.
Ending chat session: Press Esc. You will now be back to selecting a peer.
Ending connection: Press Esc and you will now be able to select which server to connect to.
Start an instance of
src/talk/examples/peerconnection/server/server_test.html in your
browser. Click Connect. Observe that the
your connection. Open one more tab using the same page. Connect it too (with a
different name). It is now possible to exchange messages between the connected
Call (Application that establishes a call using libjingle)
Target name call (currently disabled). Call uses xmpp (as opposed to SDP used
by WebRTC) to allow you to login using your Gmail account and make audio/video
calls with your gmail friends. It is built on top of
libjingle to provide
Further, you can specify input and output RTP dump for voice and video. It
provides two samples of input RTP dump:
voice.rtpdump which contains a
stream of single channel, 16Khz voice encoded with G722, and
which contains a 320x240 video encoded with H264 AVC at 30 frames per second.
The provided samples will inter-operate with Google Talk Video. If you use
other input RTP dump, you may need to change the codecs in
(lines 215 - 222).
WebRTCDemo (Android application using media engines)
WebRTCDemo. This app does not use WebRTC native APIs. It can
send and receive media streams if manually connected to another
that is directly accessible (e.g. firewalls might prevent you from
establishing a connection). Further it allows setting, enabling and disabling
audio and video processing functionality (e.g. echo cancellation, NACK, audio
codec and video codec).
Relay server (specialized server application that can be used with Call)
relayserver. Relays traffic when a direct peer-to-peer
connection can’t be established.
stunserver. Implements the STUN protocol for Session Traversal
Utilities for NAT as documented in RFC5389.
turnserver. In active development to reach compatibility with