Coder Social home page Coder Social logo

rtsp2web's Introduction

⚠️ This is NOT MAINTAINED anymore.

RTSP2Web

RTSP2Web

A simple script that brings RTSP to web. Usually helpful if you want to bring your video or IP cam streams to web.

Installation

  1. Rename .env.example to .env

  2. Replace .env variables respectively:

    RTSP_NAME=YourNameHere
    RTSP_URL=rtsp://user:pass@ip
    
  3. Build this container by running this command:

    docker build --tag rtsp2web .
    
  4. After building the container, you can run it as follow:

    docker run -p 8000:80 -p 1935:1935 rtsp2web
    

Accessing Your Live Stream

You can access the link to your stream as follows:

RTMP

rtmp://localhost/live/<RTSP_NAME>

http-flv

http://localhost/live/<RTSP_NAME>.flv

websocket-flv

ws://localhost/live/<RTSP_NAME>.flv

HLS

http://localhost/live/<RTSP_NAME>/index.m3u8

DASH

http://localhost/live/<RTSP_NAME>/index.mpd

via flv.js over http-flv

<script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
<video id="videoElement"></video>
<script>
    if (flvjs.isSupported()) {
        var videoElement = document.getElementById('videoElement');
        var flvPlayer = flvjs.createPlayer({
            type: 'flv',
            url: 'http://localhost/live/<RTSP_NAME>.flv'
        });
        flvPlayer.attachMediaElement(videoElement);
        flvPlayer.load();
        flvPlayer.play();
    }
</script>

via flv.js over websocket-flv

<script src="https://cdn.bootcss.com/flv.js/1.5.0/flv.min.js"></script>
<video id="videoElement"></video>
<script>
    if (flvjs.isSupported()) {
        var videoElement = document.getElementById('videoElement');
        var flvPlayer = flvjs.createPlayer({
            type: 'flv',
            url: 'ws://localhost/live/<RTSP_NAME>.flv'
        });
        flvPlayer.attachMediaElement(videoElement);
        flvPlayer.load();
        flvPlayer.play();
    }
</script>

Note: <RTSP_NAME> is the value you set in for <RTSP_NAME> in your .env file.

Access Dashboard

You can access the dashboard at: http://localhost/admin

For more info

If you want to customize the settings, you can refer to Node-Media-Server which this script is based on.

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.