We're hiring!
*

GStreamer on Windows: adding WebRTC support to a gst-build install

Aaron Boxer avatar

Aaron Boxer
January 28, 2021

Share this post:

Earlier this week, WebRTC became an official W3C and IETF standard for enabling real time communication (RTC) between browsers and other mobile applications via a set of simple APIs. GStreamer has a powerful and rapidly maturing WebRTC implementation. So, the obvious question is: how do we build this on Windows?

There are two ways of building GStreamer on Windows - either with cerbero or gst-build. For a simple GStreamer install with WebRTC support, cerbero will just work out of the box. However, for a more flexible solution that builds significantly faster, we use gst-build. Unfortunately, it's not just a matter of using gst-build. You also need the OpenSSL dependency so that gst-build will build the WebRTC element.

Here's how to add this support:

OpenSSL

If you haven't already followed my previous guide on GStreamer and Windows, please follow the steps there to build GStreamer from source.

Next, we will need to clone and build OpenSSL

  1. Install 64 bit Strawberry Perl
  2. Delete Strawberry Perl path entries from system path
  3. Install 64 bit NASM
  4. Enter the NASM install directory on your Windows PATH
  5. git clone https://github.com/openssl/openssl.git
  6. Open 64 bit VS command shell as Administrator
  7. build OpenSSL using steps below (this could take a while). Note: we set c:/bin/OpenSSl as our OpenSSL install directory, but this is easily changed to the directory of your choice.
> cd openssl
> set PATH=%PATH%;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin
> perl Configure VC-WIN64A --prefix=c:/bin/OpenSSL
> nmake
> nmake test
> nmake install

Now, download the OpenSSL pkg-config folder here and place it in the lib directory of your OpenSSL install directory.

Next, we need to add the OpenSSL install directory to the PKG_CONFIG_PATH environment variable that we set in my previous post:

Set PKG_CONFIG_PATH equal to %GSTREAMER_1_0_ROOT_X86_64%lib\pkgconfig;C:\bin\OpenSSL\lib\pkg-config

We also need to add the OpenSSL bin directory C:\bin\OpenSSL\bin to the Windows path.

And finally, we open a new 64 bit VS command shell and execute the following:

> cd %SOURCE_DIR%gst-build
> meson build --reconfigure --prefix=%GSTREAMER_1_0_ROOT_X86_64% -Dtls=disabled -Ddevtools=disabled && ninja -C build install

And now:

> gst-inspect-1.0 webrtcbin

should find the webrtcbin plugin!

If you have any questions about GStreamer WebRTC support on Windows or any other platform, please contact us!

Comments (6)

  1. Andrey:
    Apr 02, 2021 at 11:28 AM

    I wonder if prebuild OpenSSL from Github Releases will do. The build doesn't seem to be always easy:

    Microsoft (R) Program Maintenance Utility Version 14.28.29913.0
    Copyright (C) Microsoft Corporation. All rights reserved.

    "nasm" -Ox -f win64 -DNEAR -g -o crypto\bn\libcrypto-shlib-rsaz-avx512.obj "crypto\bn\rsaz-avx512.asm"
    crypto\bn\rsaz-avx512.asm:17: error: section alignment changed during code generation
    crypto\bn\rsaz-avx512.asm:436: error: section alignment changed during code generation
    crypto\bn\rsaz-avx512.asm:848: error: section alignment changed during code generation

    Reply to this comment

    Reply to this comment

  2. Andrey:
    Apr 02, 2021 at 11:39 AM

    Turned out to be necessary for successful OpenSSL build:

    git checkout OpenSSL_1_1_1-stable

    Reply to this comment

    Reply to this comment

    1. Aaron Boxer:
      Apr 02, 2021 at 04:56 PM

      Thanks, Andrey. Yes, you need to checkout out a stable release of OpenSSL. We
      will update the blog post to mention that.

      Reply to this comment

      Reply to this comment

  3. Andrey:
    Apr 03, 2021 at 02:51 PM

    These are getting built ok:
    - webrtcbin
    - gst-examples repo

    Binaries from gst-examples/webrtc are there but do not work though:

    Required gstreamer plugin 'vpx' not found
    Required gstreamer plugin 'dtls' not found
    Required gstreamer plugin 'srtp' not found

    I guess dtls and srtp need OpenSSL?

    A bit confused about this line:
    > meson build --reconfigure --prefix=%GSTREAMER_1_0_ROOT_X86_64% -Dtls=disabled -Ddevtools=disabled

    It should be -Dtls=enabled instead? Enabling makes glib-network unhappy at ninja build, though.

    Reply to this comment

    Reply to this comment

  4. Andrey:
    Apr 03, 2021 at 04:05 PM

    With dtls, installing pkg-config with msys2 and adding in to path helped.

    Reply to this comment

    Reply to this comment

  5. Aaron Boxer:
    Apr 07, 2021 at 05:01 PM

    Thanks, Andrey. My apologies for the confusion - were you able to build with dtls using pkg-config ?

    Reply to this comment

    Reply to this comment


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

An xrdesktop summer of code

10/09/2021

This summer, Christoph Haag and I had the pleasure of taking part in Google Summer of Code as mentors for xrdesktop, the Open Source project…

Adding VP9 and MPEG2 stateless support in v4l2codecs for GStreamer

23/06/2021

Earlier this year, from January to April 2021, I worked on adding support for stateless decoders for GStreamer as part of a multimedia internship…

Bag of Freebies for XR Hand Tracking: Machine Learning & OpenXR

17/06/2021

In our previous post, we presented a project backed by INVEST-AI which introduces a multi-stage neural network-based solution. Now let's…

Testing cameras with lc-compliance on KernelCI

15/06/2021

Initiated as a joint effort by the Google Chrome OS team and Collabora, the recent KernelCI hackfest brought the addition of new tests including…

Zink: Summer 2021 update

14/06/2021

There's a lot that has happened in the world of Zink since my last update, so let's see if I can bring you up to date on the most important…

Open Source OpenGL ES 3.1 on Mali GPUs with Panfrost

11/06/2021

Panfrost, the open source driver for Arm Mali, now supports OpenGL ES 3.1 on both Midgard (Mali T760 and newer) and Bifrost (Mali G31, G52,…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2021. All rights reserved. Privacy Notice. Sitemap.

Collabora Limited is registered in England and Wales. Company Registration number: 5513718. Registered office: The Platinum Building, St John's Innovation Park, Cambridge, CB4 0DS, United Kingdom. VAT number: 874 1630 19.