Giter VIP home page Giter VIP logo

gst-wpe-webrtc-demo's Introduction

GStreamer WPE Web Overlay WebRTC Broadcast demo

This application allows the live video input (webcam) to be mixed with the contents of a web page and streamed to a Janus WebRTC server.

Installation

No binary package is provided for this demo yet. For the time being you need to build it from source.

The pre-requirements on the publisher side are:

  • NodeJS
  • Rust
  • GStreamer (including gst-plugins-bad with wpesrc enabled)

Then you need a Janus instance, running on a remote server. This Janus instance should have the video-room plugin enabled and the WebSocket transport plugin enabled. You might need to open the TCP port 8989 and some UDP ports as well, as required for RTP. Then copy the contents of the janus-web-app to the server HTTP htdocs directory. We will assume the location of the Janus instance is https://janus.example.com.

The next step is to build the publisher app:

  1. Ensure you have Rust/Cargo installed with rustup
  2. Make sure you have GstWPE available on your Linux machine. It is provided by gst-plugins-bad since version 1.16. This command should show the details of the plugin: gst-inspect-1.0 wpesrc.
  3. Compile the Rust app: cargo build --release
  4. Start the Node app: npm i wpe-graphics-overlays; node wpe-graphics-overlays/server.js
  5. Open the admin web-ui located at http://127.0.0.1:3000/admin
  6. Start the Rust app: cargo run --release -- -s wss://janus.example.com:8989 -r 1234 -f 42

So the app will connect to Janus over WebSockets and hopefully publish the live stream in the room 1234, with a feed ID of 42. These values are also referenced in the webrtc.js file of the janus-web-app.

You should also see a GTK window popup on your desktop, showing the video preview. This could be made optional though.

Finally, more clients can connect to the janus-web-app, to watch the live stream.

Further configuration

By default the publisher app will encode the video in VP8. You can switch to VP9 or H264 by editing the ~/.config/com.igalia.gstwpe.broadcast.demo/settings.toml file. You can also change the video resolution there.

Credits

The code is adapted from the RustFest 2019 Barcelona Rust/GTK/GStreamer workshop app. Many thanks to Sebastian Dröge [email protected]!

The HTML/CSS template is based on the Pure CSS Horizontal Ticker codepen.

The NodeJS app is a fork of the Roses CasparCG Graphics authored by Luke Moscrop.

gst-wpe-webrtc-demo's People

Contributors

zrus avatar philn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.