Giter VIP home page Giter VIP logo

baresip-webrtc's Introduction

baresip-webrtc

Baresip WebRTC Demo

  1. Install libre and librem

  2. Install baresip dev:

$ sudo make install install-dev -C ../baresip

  1. Compile this project:

cmake . && make

  1. Start it:
$ ./baresip-webrtc -i stun:stun.l.google.com:19302
Local network addresses:
        en0:  172.20.10.3
medianat: ice
mediaenc: dtls_srtp
aucodec: opus/48000/2
aucodec: G722/16000/1
aucodec: PCMU/8000/1
aucodec: PCMA/8000/1
ausrc: ausine
vidcodec: H264
vidcodec: H264
vidcodec: H263
vidcodec: H265
avcodec: using H.264 encoder 'libx264' -- libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
avcodec: using H.264 decoder 'h264' -- H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
avcodec: using H.265 encoder 'libx265' -- libx265 H.265 / HEVC
avcodec: using H.265 decoder 'hevc' -- HEVC (High Efficiency Video Coding)
vidcodec: VP8
vidcodec: VP9
ausrc: avformat
vidsrc: avformat
vidisp: sdl
vidsrc: fakevideo
vidisp: fakevideo
demo: listening on:
    http://172.20.10.3:9000/
    https://172.20.10.3:9001/
  1. Open this URL in Chrome and follow the instructions:

http://localhost:9000/

Protocol Diagram

This diagram shows how a WebRTC capable browser can connect to baresip-webrtc. Baresip-WebRTC has a small embedded HTTP(S) Server for serving JavaScript files and for signaling.

The media stream is compatible with WebRTC, using ICE and DTLS/SRTP as media transport. The audio codecs are Opus, G722 or G711. The video codecs are VP8, H264.

                  (Signaling)
.----------.       SDP/HTTP       .-----------.
| Browser  |<-------------------->|  Baresip  |
| (Chrome) |                      |  WebRTC   |<==== A/V Backend
|          |<====================>|           |
'----------'    ICE/DTLS/SRTP     '-----------'
                (Audio,Video)

API Mapping

WebRTC: this:
MediaStream n/a
MediaStreamTrack struct media_track
RTCConfiguration struct rtc_configuration
RTCPeerConnection struct peer_connection
RTCSessionDescription struct session_description
RTCRtpTransceiver struct stream

Signaling

.------.                                 .------.
|Client|                                 |Server|
'------'                                 '------'
    |             HTTP POST                  |
    +--------------------------------------->+
    |        201 Created (SDP offer)         |
    +<---------------------------------------+
    |                                        |
    |                                        |
    |        HTTP PUT (SDP Answer)           |
    +--------------------------------------->+
    |        200 OK                          |
    +<---------------------------------------+
    |                                        |
    |                                        |
    |        HTTP PATCH (ICE Candidate)      |
    +--------------------------------------->+
    |        200 OK                          |
    +<---------------------------------------+
    |                                        |
    |                                        |
    |                                        |
    |          ICE REQUEST                   |
    <========================================>
    |          ICE RESPONSE                  |
    <========================================>
    |          DTLS SETUP                    |
    <========================================>
    |          RTP/RTCP FLOW                 |
    <========================================>
    |                                        |
    |                                        |
    |                                        |
    |                                        |
    | HTTP DELETE                            |
    +--------------------------------------->+
    | 200 OK                                 |
    <----------------------------------------+


Reference

https://www.ietf.org/archive/id/draft-ietf-wish-whip-03.html

baresip-webrtc's People

Contributors

alfredh avatar lmangani avatar sreimers avatar viordash 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.