Giter Site home page Giter Site logo

dahua-rtsp-web's Introduction

Dahua - Stream video in browser

Try the url before using the code below. This will play substream video without much overkill. If this is not working then proceed to next

http://host:port/cgi-bin/mjpg/video.cgi?channel=1&subtype=1

RTSP over WS

Stream RTSP over websocket and use RTSP direclty in web browser. Made possible by new feature in Dahua camera which implements rtspoverwebsocket functionality. This would reduce the need for a server to translate the video stream to HLS or DASH to make RTSP work on web browsers. Kudos to Dahua for this thought.

NOTE: Need support for /rtspoverwebsocket support for using this feature

    <video width=400 height=400 id="videoplayer"></video>
import PlayerControl from './src/index.js';

var options = {
    wsURL: "ws://host:port/rtspoverwebsocket",
    rtspURL: "rtsp://host:port/cam/realmonitor?channel=1&subtype=0",
    username: "",
    password: ""
}

let player = new PlayerControl(options)
player.on("Error", (j) => { if (j) console.log(j.errorCode) })
player.init(document.querySelector("#videoplayer"))
player.connect()

NOTE: Audio is currently not supported. This is a working PoC for video stream. Audio Streaming is also possible.

Snapshots

Try this url to take snapshots

http://username:password@host:port/cgi-bin/snapshot.cgi?0

Notice

This project is made possible by using RTSP over WebSocket functionality implemented by Dahua for their IP Cameras. Code available in this project is extracted from an Dahua IP Camera and made to work standalone. We have no intent to commercialize this project.

dahua-rtsp-web's People

Contributors

naveenrobo avatar dependabot[bot] 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.