Ubuntu12.4 under WEBRTC compilation

Source: Internet
Author: User

For project reasons, audio and video is required, so the open source WebRTC (with BDS open source agreement) and Google supported open source project are selected. On the HTML5 side, Google's ambition is generally visible, why so, WEBRTC support browser. Currently support WebRTC Browser has Chrome,firefox,opera (the latest version, the old version is not supported), that is, the browser supports AV, no longer need to install plug-ins. But Microsoft IE does not support WEBRTC, it is not a technical problem, this you understand. For me to wait for the cock silk, at least one way, can realize the non-plug-in browser visual audio. You know, the use of active in IE is a very painful thing, of course, with flex, installation, not like the browser built directly. Google is vigorously promoting HTML5, and to WEBRTC as the standard of AV, I believe the future is very good.

WEBRTC currently supports Linux,windows,android,ios, the browser (currently only chrome,firefox,opera) each platform can realize the audio and video interoperability. The Web page and mobile phone, mobile phone and PC side can achieve audio and video. Isn't it cool! To build WEBRTC, the official recommendation is to compile under Ubuntu. Of course there are also in Windows compiled on the web, but I this is according to the official website instructions, to compile Android, all selected Ubuntu compilation. If you want to compile under Windows, please refer to: http://www.chromium.org/developers/how-tos/build-instructions-windows.

WebRTC's official website is http://www.webrtc.org. To access, in the domestic estimate to pass the VPN, this you understand.

VPN, suggest or buy a bar, here omit 100 words.

1, Environment Preparation: VMware Player installs Ubuntu12.04 (64-bit), of course you can also choose a high version of the Ununtu version. Do not know how to install Ubuntu, Baidu or Google under, you can, and ensure that Ubuntu can surf the internet, and access to foreign sites.

2. Work to prepare before compiling Android (please refer to: http://www.webrtc.org/native-code/android)

1) Install JDK (for Android WEBRTC later): sudo apt-get install OPENJDK-7-JDK (64-bit Java version "1.7.0_65")

2) Install git (to download depot_tools): sudo apt-get install git (version 2.2.2)

3) Download Depot_tools, get Source tool: Git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

Please refer to: https://sites.google.com/a/chromium.org/dev/developers/how-tos/install-depot-tools

4) Configure Depot_too path: Export path= ' pwd '/depot_tools: "$PATH"
Gedit ~/.BASHRC at the end of the file add Export path= ' pwd '/depot_tools: "$PATH" saved at exit.

5) Install additional tools (for later compilation, refer to HTTP://WWW.WEBRTC.ORG/NATIVE-CODE/DEVELOPMENT/PREREQUISITE-SW)

sudo apt-get install g++ (>= 4.2)
sudo apt-get install python
sudo apt-get install g++
sudo apt-get install Libnss3-dev
sudo apt-get install Libasound2-dev
sudo apt-get install Libpulse-dev
sudo apt-get install Libjpeg62-dev
sudo apt-get install Libxv-dev
sudo apt-get install Libgtk2.0-dev
sudo apt-get install Libexpat1-dev
sudo apt-get install Lib32asound2-dev
sudo apt-get install Ia32-libs

3. Download source code

1) Create a directory: mkdir WEBRTC
CD webrtc/
2) Create the downloaded configuration file: gclient config Http://webrtc.googlecode.com/svn/trunk

[email protected]: ~/webrtc$ ll
Drwxrwxr-x 3 tjb tjb 4096 January 25 23:58./
Drwxr-xr-x tjb tjb 4096 January 28 10:48.. /
-rw-rw-r--1 tjb tjb 275 January 23:58. gclient
-rw-rw-r--1 tjb tjb 339 January 12:18. gclient_entries

3) Edit the configuration file. Gclient:

VI. gclient

Solutions = [
{"name": "src",

"url": "Http://webrtc.googlecode.com/svn/trunk",
"Deps_file": "Deps",
"Managed": True,
"Custom_deps": {
},
"Safesync_url": "",
},
]
Cache_dir = None
Target_os = [' Android ', ' Unix ', ' windows ']

"Name": "src", trunk changed to SRC, indicating the source code to be stored in the directory.

Finally add target_os = [' Android ', ' Unix ', ' windows ']//, which means to compile the target platform, Android,unix, Windows, if it is to compile iOS, add an iOS,

Then save the Exit command: Wq.

4) Sync Code:

Gclient Sync--force

Description: This step takes a long time, I was downloaded three days, under 11G, the size of the download, with target_os = [' Android ', ' Unix ', ' windows ') inside the target platform to be under. If you only download Android, do not write Unix and Windows, I am for future needs, so first download, and then compile. If the intermediate discovery is interrupted. You don't have to run Gclient sync--force until the download is successful. (Perseverance, until success!) )

4. Compile Code:

1) switch to the following directory: CD SRC
2) Read and execute the Environment command: source./build/android/envsetup.sh
3) Configure target compilation platform: Export gyp_defines= "$GYP _defines os=android"
4) Download the Compiled Dependent toolkit (some time required):./build/install-build-deps.sh
5) Download the build file required for compilation (some time required): Gclient runhooks--force
6) Compile Debug version: Ninja-c out/debug
7) Compile release version: Ninja-c out/release

After successful execution of the above steps:

There is a Debug and Release directory under Src/out with a compiled demo file (the code of the Apprtcdemo program is then src/talk/examples/android/the directory ).

[email protected]: ~/webrtc/src/out$ ll
Total 20
Drwxrwxr-x 5 tjb tjb 4096 January 27 14:52./
Drwxrwxr-x tjb tjb 4096 January 27 14:52. /
Drwxrwxr-x tjb tjb 4096 January 17:10 debug/
Drwxrwxr-x 5 tjb tjb 4096 January 14:52 gypfiles/
Drwxrwxr-x tjb tjb 4096 January 19:10 release/

In the release and debug directories: apprtcdemo-debug.apk and webrtcdemo-debug.apk

-rw-rw-r--1 tjb tjb 2552878 January 19:09 apprtcdemo-debug.apk
-rw-rw-r--1 tjb tjb 7455 January 19:10 apprtcdemotest-debug.apk

-rw-rw-r--1 tjb tjb 1679104 January 17:04 webrtcdemo-debug.apk

Note that the difference between Apprtcdemo and Webrtcdemo

Webrtcdemo: In the LAN, know the other side of the IP and port number can be seen audio, but the effect is not very good.

Apptrcdemo: This time need to set up a server, by the server to achieve AV relay or to achieve hole, establish channel and AV stream.

The next article will write about the realization of AV relay or the implementation of the hole-punched server. Please pay attention.

Ubuntu12.4 under WEBRTC compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.