Coder Social home page Coder Social logo

rtsptowebrtc's Introduction

Go - RTSPtoWebRTC

RTSP Stream to WebBrowser over WebRTC based on Pion (full native! not using ffmpeg or gstreamer).

Note: This repository is a fork of RTSPtoWebRTC

The goal of this fork is to create a dynamic way of restreaming a rtsp connection to webrtc

Installation

go get github.com/salfel/RTSPtoWebRTC

Api

Set config

rtsptowebrtc.SetConfig(&rtsptowebrtc.ConfigST{
   Server: rtsptowebrtc.ServerST{
      ICEServers: []string{"stun:stun.l.google.com:19302"},
   },
})

Serve Routes (only gin for now)

r := gin.Default()

rtsptowebrtc.ServeGin(r)

Start Stream

rtsptowebrtc.ServeStream("test", rtsptowebrtc.StreamST{
   OnDemand:     false,
   DisableAudio: true,
   URL:          "rtsp://127.0.0.1:8554/stream",
})

Remove Stream

rtsptowebrtc.RemoveStream("test")

Web

Include both the webrtc-adapter.js and webrts.js scripts in your html markup

<script src="/js/webrtc-adapter.js"></script>
<script defer src="/js/webrtc.js"></script>

Changes applicable for webrtc.js

Be aware that you might need to change the suuid, depending on where in your url the suuid is located at or however you define it

You can also change the querySelector for the videoElement for more fine-grained control over the videoElement

Example

A example application on how to integrate the RTSPtoWebRTC package can be found in this repository under the server dir

rtsptowebrtc's People

Stargazers

Liviu Birjega avatar

Watchers

Felix Salcher 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.