Difference between revisions of "GstWebRTC - Building GstWebRTC"

From RidgeRun Developer Connection
Jump to: navigation, search
m
m
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{GstWebRTC Page|
+
{{GstWebRTC/Head|previous=Getting the code|next=Building GstWebRTC - x86|metakeywords=building WebRTC, building GstRrWebRTC, WebRTC dependencies, GstRrWebRTC dependencies, GstRrWebRTC Yocto Build,signaling}}
[[GstWebRTC - Getting the code|Getting the code]]|
 
[[GstWebRTC - Examples |Examples]]|
 
  
This page provides a guide to install GstWebRTC.
+
This Section presents the instructions to install the GstRrWebRTC element on x86, Jetson and Yocto platforms;
 
 
==Dependencies==
 
 
 
GstWebRTC has the following dependencies:
 
 
 
* Gstreamer 1.0
 
* GStreamer 1.0 Development Package
 
* Gstreamer 1.0 Base Plug-ins Development Package
 
* Gstreamer 1.0 Bad Plug-ins
 
* Gstreamer 1.0 Good Plug-ins
 
* LibSoup Development Package (libsoup2.4-dev)
 
* JSON-GLib Development Package (libjson-glib-dev)
 
* OpenSSL Development Package (libssl-dev)
 
* LibNice Development Package (libnice-dev)
 
* GTK-Doc Tools (Optional) (gtk-doc-tools)
 
 
 
Make sure you have the following GStreamer elements:
 
* gst-inspect-1.0 rtpmanager
 
* gst-inspect-1.0 dtls
 
* gst-inspect-1.0 nice
 
* gst-inspect-1.0 srtp
 
 
 
=== Linux ===
 
In Debian based systems, you may install them with the following command:
 
 
 
<syntaxhighlight lang='bash'>
 
sudo apt install \
 
gstreamer1.0-x \
 
libgstreamer1.0-dev \
 
libgstreamer-plugins-base1.0-dev \
 
gstreamer1.0-plugins-bad \
 
libsoup2.4-dev \
 
libjson-glib-dev \
 
libnice-dev \
 
autoconf \
 
libtool \
 
gtk-doc-tools \
 
libglib2.0-dev \
 
gstreamer1.0-nice \
 
libssl-dev \
 
libreadline-dev \
 
gstreamer1.0-plugins-ugly \
 
libsrtp0-dev
 
</syntaxhighlight>
 
 
 
====Other Dependencies====
 
In Ubuntu 16.04 the following dependencies were also required:
 
<syntaxhighlight lang='bash'>
 
sudo apt install \
 
faad \
 
libasound2-dev \
 
libfaad-dev \
 
libjack-jackd2-dev \
 
libmad0-dev \
 
libogg-dev \
 
liborc-0.4-dev \
 
libpulse-dev \
 
libtheora-dev \
 
libv4l-dev \
 
libv4l2rds0 \
 
libvorbis-dev \
 
libvpx-dev \
 
libx264-dev \
 
libxv-dev \
 
x11proto-video-dev
 
</syntaxhighlight>
 
 
 
=== Mac OSX ===
 
 
 
Using MacPorts
 
 
 
<syntaxhighlight lang='bash'>
 
sudo port install \
 
gstreamer1 \
 
gstreamer1-gst-plugins-base \
 
gstreamer1-gst-plugins-bad \
 
gstreamer1-gst-plugins-good \
 
gstreamer1-gst-plugins-ugly \
 
json-glib \
 
autoconf \
 
libtool \
 
gtk-doc \
 
glib2 \
 
libsoup \
 
openssl \
 
readline \
 
libnice \
 
libsrtp
 
</syntaxhighlight>
 
=== Data channel support dependencies===
 
In order to have support for WebRTC data channel you need to build these libraries from the scratch:
 
 
 
* SCTP libraries
 
<syntaxhighlight lang='bash'>
 
git clone https://github.com/sctplab/usrsctp
 
cd usrsctp
 
./bootstrap
 
./configure <platform configuration option, see Table 1>
 
make
 
sudo make install
 
cd ..
 
</syntaxhighlight>
 
 
 
* GStreamer SCTP elements
 
<syntaxhighlight lang='bash'>
 
git clone https://github.com/EricssonResearch/openwebrtc-gst-plugins
 
cd openwebrtc-gst-plugins
 
./autogen.sh
 
./configure <platform configuration option, see Table 1>
 
make
 
sudo make install
 
cd ..
 
</syntaxhighlight>
 
 
 
If you get the error ''''UINT16_MAX' undeclared''' while running '''make''', add the library '''#include <stdint.h>''' to the '''openwebrtc-gst-plugins/ext/sctp/sctpassociation.c''' file.
 
 
 
==Install RidgeRun GstWebRTC plugin==
 
Please refer [[GstWebRTC - Getting the code|Getting the code]] page and RidgeRun will provide you the full source version of the plugin path once you place the order.<br>
 
Checkout the latest tag and run the commands mentioned below:
 
<syntaxhighlight lang='bash'>
 
./autogen.sh $OPTIONS # CHOOSE THE APPROPRIATE CONFIGURATION FROM THE TABLE BELOW
 
make
 
sudo make install
 
</syntaxhighlight>
 
  
 +
== Building Instructions Index ==
 
<html>
 
<html>
    <table class='wikitable'>
+
  <div class="toc" style="font-size:80%;">
    <tr>
+
     <ol>
      <th>System</th>
+
       <li> <a href=https://developer.ridgerun.com/wiki/index.php?title=Building_GstWebRTC_-_x86>Building x86 Platforms</a></li>
      <th>Configure Option</th>
+
      <li> <a href=https://developer.ridgerun.com/wiki/index.php?title=Building_GstWebRTC_-_Jetson>Building Jetson Platforms: TX1, TX2 and Xavier </a></li>
    </tr>
+
      <li> <a href=https://developer.ridgerun.com/wiki/index.php?title=Building_GstWebRTC_-_Yocto>Building Yocto Platforms: i.MX6 and i.MX8</a></li>
    <tr>
+
    </ol>
      <td>Ubuntu 64 bits</td>
+
  </div>
      <td>--prefix /usr/ --libdir /usr/lib/x86_64-linux-gnu/</td>
+
</html>
     </tr>
 
    <tr>
 
       <td>RidgeRun's Embedded FS</td>
 
      <td>--prefix /usr/</td>
 
    </tr>
 
    <tr>
 
      <td>Tegra TX1/TX2</td>
 
      <td>--prefix /usr/ --libdir /usr/lib/aarch64-linux-gnu/</td>
 
    </tr>
 
    <caption>Table 1. Platform configuration options</caption>
 
  </table>
 
  </html>
 
=== Mac OSX ===
 
 
 
Export the PKG_CONFIG_PATH variable to /opt/local/
 
 
 
<syntaxhighlight lang='bash'>
 
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig
 
</syntaxhighlight>
 
 
 
<syntaxhighlight lang='bash'>
 
./autogen.sh --prefix /opt/local/
 
make
 
sudo make install
 
</syntaxhighlight>
 
 
 
==Verify==
 
The plugin installation can be verified by running:
 
<syntaxhighlight lang='bash'>
 
gst-inspect-1.0 rrwebrtc
 
</syntaxhighlight>
 
 
 
==Building Gst-WebRTC on Yocto==
 
 
 
RidgeRun offers a Yocto layer containing RidgeRun commonly used packages. You can download this package from https://github.com/RidgeRun/meta-ridgerun.<br>
 
It contains a recipe to build Gst-WebRTC but you need to purchase GstWebRTC with full source code, from: https://www.ridgerun.com/store/GSTWebRTC-p74337777
 
 
 
===Adding meta-ridgerun to your Yocto build===
 
 
 
First you need to copy meta-ridgerun in your '''sources''' directory:
 
 
 
<syntaxhighlight lang='bash'>
 
cp -r meta-ridgerun $YOCTO_DIRECTORY/sources/
 
</syntaxhighlight>
 
 
 
Then add the RidgeRun meta layer to your '''bblayers.conf''' file. First go to the build configuration directory
 
 
 
<syntaxhighlight lang='bash'>
 
cd $YOCTO_DIRECTORY/build/conf/
 
</syntaxhighlight>
 
 
 
Open the '''bblayers.conf''' file and add the RidgeRun meta layer path '''$YOCTO_DIRECTORY/sources/meta-ridgerun''' to '''BBLAYERS'''
 
 
 
===Building Gst-WebRTC===
 
 
 
*Once you have access to the repository, please open gst-webrtc_xxx.bb in '''$YOCTO_DIRECTORY/sources/meta-ridgerun/recipes-multimedia/gstreamer/'''
 
*Modify the following line in SRC_URI with the correct gst-webrtc URL by changing '''<Customer-Directory>''' with your own.
 
 
 
<syntaxhighlight lang='bash'>
 
git://git@gitlab.com/RidgeRun/orders/<Customer-Directory>/gst-webrtc.git;protocol=ssh;branch=${SRCBRANCH};name=base \
 
</syntaxhighlight>
 
 
 
*Make sure you have added your ssh key to your GitLab account. For more information: [[#SSH Information|SSH Information]]
 
 
 
*Finally build recipe:
 
<syntaxhighlight lang='bash'>
 
bitbake gst-webrtc
 
</syntaxhighlight>
 
 
 
===SSH Information===
 
 
 
The recipe will fetch the repository using your ssh key, thus it's necessary to add the key in Gitlab page.<br>
 
For adding it, go to Settings->SSH Keys and add your key, if don't have one you can find there a link about how to generate it.<br>
 
 
 
'''SHH Issue'''<br>
 
If GitLab key hasn't added to your list of known hosts on the PC, you will have fetch errors when trying to build Gst-WebTRC recipe.<br>
 
One easy way to add the key is when cloning the repository for the first time from gitlab, it will ask if you want to add the key to your list of known hosts.<br>
 
 
 
Example:
 
<syntaxhighlight lang='bash'>
 
git clone git@gitlab.com:RidgeRun/orders/<Customer-Directory>/gst-webrtc.git
 
</syntaxhighlight>
 
 
 
|keywords=building WebRTC, building GstWebRTC, WebRTC dependencies, GstWebRTC dependencies, GstWebRTC Yocto Build}}
 
  
[[Category:GStreamer]][[Category:WebRTC]][[Category:GstWebRTC]]
+
{{GstWebRTC/Foot|previous=Getting the code|next=Building GstWebRTC - x86}}

Latest revision as of 10:21, 9 March 2023