Giter Site home page Giter Site logo

rtsptoweb's Introduction

RTSPtoWeb share you ip camera to world!

RTSPtoWeb converts your RTSP streams to formats consumable in a web browser like MSE (Media Source Extensions), WebRTC, or HLS. It's fully native Golang without the use of FFmpeg or GStreamer!

Table of Contents

Installation

Installation from source

  1. Download source
    $ git clone https://github.com/deepch/RTSPtoWeb
  2. CD to Directory
     $ cd RTSPtoWeb/
  3. Test Run
     $ GO111MODULE=on go run *.go
  4. Open Browser
    open web browser http://127.0.0.1:8083 work chrome, safari, firefox

Configuration

Server settings

debug         - enable debug output
log_level     - log level (trace, debug, info, warning, error, fatal, or panic)

http_demo     - serve static files
http_debug    - debug http api server
http_login    - http auth login
http_password - http auth password
http_port     - http server port
http_dir      - path to serve static files from

https
https_auto_tls
https_auto_tls_name
https_cert
https_key
https_port

rtsp_port     - rtsp server port

Stream settings

name          - stream name

Channel settings

name          - channel name
url           - channel rtsp url
on_demand     - stream mode static (run any time) or ondemand (run only has viewers)
debug         - enable debug output (RTSP client)
status        - default stream status

RTSP pull modes

  • on demand (on_demand=true) - only pull video from the source when there's a viewer
  • static (on_demand=false) - pull video from the source constantly

Example config.json

{
  "server": {
    "debug": true,
    "log_level": "info",
    "http_demo": true,
    "http_debug": false,
    "http_login": "demo",
    "http_password": "demo",
    "http_port": ":8083",
    "rtsp_port": ":5541"
  },
  "streams": {
    "demo1": {
      "name": "test video stream 1",
      "channels": {
        "0": {
          "name": "ch1",
          "url": "rtsp://admin:admin@YOU_CAMERA_IP/uri",
          "on_demand": true,
          "debug": false,
          "status": 0
        },
        "1": {
          "name": "ch2",
          "url": "rtsp://admin:admin@YOU_CAMERA_IP/uri",
          "on_demand": true,
          "debug": false,
          "status": 0
        }
      }
    },
    "demo2": {
      "name": "test video stream 2",
      "channels": {
        "0": {
          "name": "ch1",
          "url": "rtsp://admin:admin@YOU_CAMERA_IP/uri",
          "on_demand": true,
          "debug": false,
          "status": 0
        },
        "1": {
          "name": "ch2",
          "url": "rtsp://admin:admin@YOU_CAMERA_IP/uri",
          "on_demand": true,
          "debug": false,
          "status": 0
        }
      }
    }
  }
}

Command-line

Use help to show available args

./RTSPtoWeb --help

Response

Usage of ./RTSPtoWeb:
  -config string
        config patch (/etc/server/config.json or config.json) (default "config.json")
  -debug
        set debug mode (default true)

Web UI

The web UI is available at http://127.0.0.1:8083/.

Parameters for full-page multiview

Grid size

http://localhost:8083/pages/multiview/full?grid=5

Show additional options

  • Video protocol (MSE, WebRTC, or HLS)
  • Grid size
  • Background image
http://localhost:8083/pages/multiview/full?controls

API documentation

See the API docs

Limitations

Video Codecs Supported: H264 all profiles

Audio Codecs Supported: no

Performance

CPU usage โ‰ˆ0.2%-1% one (thread) core cpu intel core i7 per stream

Authors

  • Andrey Semochkin - Initial work video - deepch
  • Dmitriy Vladykin - Initial work web UI - vdalex25

See also the list of contributors who participated in this project.

License

This project licensed. License - see the LICENSE.md file for details

webrtc follows license MIT license.

joy4 follows license MIT license.

Other Example

Examples of working with video on golang

paypal.me/AndreySemochkin - You can make one-time donations via PayPal. I'll probably buy a coffee tea. ๐Ÿต

rtsptoweb's People

Contributors

deepch avatar vdalex25 avatar superman32432432 avatar

Watchers

James Cloos 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.