Convert Figma logo to code with AI

deepch logoRTSPtoWeb

RTSP Stream to WebBrowser

1,250
302
1,250
210

Top Related Projects

11,584

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.

11,584

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.

open source、high performance、industrial rtsp streaming server,a lot of optimization on streaming relay,KeyFrame cache,RESTful,and web management,also EasyDarwin support distributed load balancing,a simple streaming media cloud platform architecture.高性能开源RTSP流媒体服务器,基于go语言研发,维护和优化:RTSP推模式转发、RTSP拉模式转发、录像、检索、回放、关键帧缓存、秒开画面、RESTful接口、WEB后台管理、分布式负载均衡,基于EasyDarwin构建出了一套基础的流媒体云视频平台架构!

25,280

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.

Cameradar hacks its way into RTSP videosurveillance cameras

Quick Overview

The deepch/RTSPtoWeb project is a web-based RTSP (Real-Time Streaming Protocol) video streaming application that allows users to view RTSP video streams directly in their web browsers. It provides a simple and user-friendly interface for accessing and managing RTSP video sources.

Pros

  • Cross-Platform Compatibility: The application is designed to work across various platforms, including Windows, macOS, and Linux, making it accessible to a wide range of users.
  • Easy Integration: The project can be easily integrated into existing web applications, allowing developers to add RTSP video streaming capabilities to their projects.
  • Customizable: The application provides options for customizing the user interface and settings, allowing users to tailor the experience to their needs.
  • Open-Source: The project is open-source, which means that users can contribute to its development, report issues, and suggest improvements.

Cons

  • Limited Documentation: The project's documentation could be more comprehensive, which may make it challenging for new users to get started.
  • Potential Performance Issues: Depending on the hardware and network conditions, the application may experience performance issues when streaming high-quality RTSP video.
  • Lack of Advanced Features: The project may not offer advanced features, such as multi-stream support or advanced video processing capabilities, which some users may require.
  • Dependency on External Libraries: The project relies on several external libraries, which may introduce additional complexity and potential compatibility issues.

Code Examples

The deepch/RTSPtoWeb project is a web-based application, and it does not provide a code library that can be easily integrated into other projects. However, you can find the source code for the application on the project's GitHub repository.

Getting Started

To get started with the deepch/RTSPtoWeb project, follow these steps:

  1. Clone the repository:
git clone https://github.com/deepch/RTSPtoWeb.git
  1. Navigate to the project directory:
cd RTSPtoWeb
  1. Install the required dependencies:
go get ./...
  1. Build the application:
go build
  1. Run the application:
./RTSPtoWeb
  1. Open your web browser and navigate to http://localhost:8080 to access the RTSP video streaming interface.

  2. Add your RTSP video sources by clicking the "Add" button and entering the appropriate RTSP URL.

  3. Start streaming the RTSP video by clicking on the video source in the list.

Please note that the specific steps may vary depending on your operating system and the version of the project you are using. Refer to the project's documentation for more detailed instructions and any additional configuration requirements.

Competitor Comparisons

11,584

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.

Pros of mediamtx

  • Written in Go, offering better performance and lower resource usage
  • Supports a wider range of protocols, including SRT, WebRTC, and HLS
  • More actively maintained with frequent updates and bug fixes

Cons of mediamtx

  • Less user-friendly configuration, requiring more technical knowledge
  • Fewer pre-built Docker images available for different architectures
  • Limited documentation compared to RTSPtoWeb

Code Comparison

mediamtx configuration example:

paths:
  all:
    source: rtsp://example.com/stream
    sourceProtocol: tcp
    sourceOnDemand: yes

RTSPtoWeb configuration example:

{
  "server": {
    "debug": true,
    "http_demo": true,
    "http_dir": "web"
  },
  "streams": {
    "demo1": {
      "url": "rtsp://example.com/stream"
    }
  }
}

Both projects aim to provide RTSP streaming capabilities, but mediamtx offers a more comprehensive solution with support for additional protocols. RTSPtoWeb, on the other hand, provides a simpler setup and more user-friendly interface. The choice between the two depends on specific requirements, technical expertise, and desired features.

11,584

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.

Pros of mediamtx

  • Written in Go, offering better performance and lower resource usage
  • Supports a wider range of protocols, including SRT, WebRTC, and HLS
  • More actively maintained with frequent updates and bug fixes

Cons of mediamtx

  • Less user-friendly configuration, requiring more technical knowledge
  • Fewer pre-built Docker images available for different architectures
  • Limited documentation compared to RTSPtoWeb

Code Comparison

mediamtx configuration example:

paths:
  all:
    source: rtsp://example.com/stream
    sourceProtocol: tcp
    sourceOnDemand: yes

RTSPtoWeb configuration example:

{
  "server": {
    "debug": true,
    "http_demo": true,
    "http_dir": "web"
  },
  "streams": {
    "demo1": {
      "url": "rtsp://example.com/stream"
    }
  }
}

Both projects aim to provide RTSP streaming capabilities, but mediamtx offers a more comprehensive solution with support for additional protocols. RTSPtoWeb, on the other hand, provides a simpler setup and more user-friendly interface. The choice between the two depends on specific requirements, technical expertise, and desired features.

open source、high performance、industrial rtsp streaming server,a lot of optimization on streaming relay,KeyFrame cache,RESTful,and web management,also EasyDarwin support distributed load balancing,a simple streaming media cloud platform architecture.高性能开源RTSP流媒体服务器,基于go语言研发,维护和优化:RTSP推模式转发、RTSP拉模式转发、录像、检索、回放、关键帧缓存、秒开画面、RESTful接口、WEB后台管理、分布式负载均衡,基于EasyDarwin构建出了一套基础的流媒体云视频平台架构!

Pros of EasyDarwin

  • More comprehensive media server solution with additional features
  • Better documentation and community support
  • Supports multiple streaming protocols (RTSP, RTMP, HLS)

Cons of EasyDarwin

  • More complex setup and configuration
  • Higher resource usage due to additional features
  • Steeper learning curve for beginners

Code Comparison

EasyDarwin (Go):

func (rtsp *RTSP) SendRTP(pack *RTPPack) {
    if pack == nil {
        return
    }
    rtsp.OutgoingProxy <- pack
    atomic.AddInt64(&rtsp.OutBytes, int64(len(pack.Raw)))
}

RTSPtoWeb (Go):

func (element *StreamClientElement) Play() {
    for packet := range element.outgoingPacket {
        element.socket.WriteMessage(websocket.BinaryMessage, packet)
    }
}

Both projects use Go and handle streaming, but EasyDarwin's code appears more focused on RTSP-specific functionality, while RTSPtoWeb's code snippet shows WebSocket integration for web-based streaming.

25,280

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181.

Pros of SRS

  • More comprehensive streaming solution supporting multiple protocols (RTMP, HLS, WebRTC, etc.)
  • Better scalability and performance for large-scale deployments
  • Active development with frequent updates and a larger community

Cons of SRS

  • Steeper learning curve due to more complex architecture
  • Requires more system resources for full functionality
  • May be overkill for simple RTSP to web streaming scenarios

Code Comparison

RTSPtoWeb (Go):

func (element *RTSPStream) runStream() {
    for {
        element.clientTest()
        if !element.runLock {
            return
        }
        element.socket()
        time.Sleep(1 * time.Second)
    }
}

SRS (C++):

int SrsRtspConn::cycle()
{
    int ret = ERROR_SUCCESS;
    
    while (true) {
        if ((ret = do_cycle()) != ERROR_SUCCESS) {
            return ret;
        }
        
        if (!is_active()) {
            break;
        }
    }
    
    return ret;
}

RTSPtoWeb is more focused on RTSP to web streaming, with a simpler codebase and easier setup. SRS offers a more comprehensive streaming solution with support for multiple protocols and advanced features, but comes with increased complexity and resource requirements.

Cameradar hacks its way into RTSP videosurveillance cameras

Pros of Cameradar

  • Focused on security auditing and vulnerability detection for IP cameras
  • Provides automated credential discovery and access to RTSP streams
  • Lightweight and easy to deploy as a standalone tool

Cons of Cameradar

  • Limited to discovery and access, doesn't provide streaming functionality
  • May require additional tools for stream handling and processing
  • Less suitable for production environments or continuous streaming needs

Code Comparison

Cameradar (Go):

func (s *Scanner) ScanNetwork(targets []string) ([]Stream, error) {
    streams := make([]Stream, 0)
    for _, target := range targets {
        streams = append(streams, s.ScanIP(target)...)
    }
    return streams, nil
}

RTSPtoWeb (Go):

func (element *Element) runStream() {
    for {
        element.Status = RUNNING
        err := element.runStreamLoop()
        if err != nil {
            element.Status = ERROR
            log.Printf("Stream %s Error: %s", element.ID, err)
        }
    }
}

RTSPtoWeb provides a more comprehensive solution for handling RTSP streams, including web-based management and multi-protocol support. It's better suited for production environments and continuous streaming needs. However, it may be more complex to set up and manage compared to Cameradar's focused approach on security auditing.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

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
    

Installation from docker

  1. Run docker container
    $ docker run --name rtsp-to-web --network host ghcr.io/deepch/rtsptoweb:latest 
    
  2. Open Browser
    open web browser http://127.0.0.1:8083 in chrome, safari, firefox
    

You may override the configuration /PATH_TO_CONFIG/config.json and mount as a docker volume:

$ docker run --name rtsp-to-web \
    -v /PATH_TO_CONFIG/config.json:/config/config.json \
    --network host \
    ghcr.io/deepch/rtsptoweb:latest 

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
ice_servers     - array of servers to use for STUN/TURN
ice_username    - username to use for STUN/TURN
ice_credential  - credential to use for STUN/TURN
webrtc_port_min - minimum WebRTC port to use (UDP)
webrtc_port_max - maximum WebRTC port to use (UDP)

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)
audio           - enable audio
status          - default stream status

Authorization play video

1 - enable config

"token": {
"enable": true,
"backend": "http://127.0.0.1/file.php"
}

2 - try

rtsp://127.0.0.1:5541/demo/0?token=you_key

file.php need response json

   status: "1" or "0"

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",
    "ice_servers": ["stun:stun.l.google.com:19302"],
    "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,
          "audio": true,
          "status": 0
        },
        "1": {
          "name": "ch2",
          "url": "rtsp://admin:admin@YOU_CAMERA_IP/uri",
          "on_demand": true,
          "debug": false,
          "audio": true,
          "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
        }
      }
    }
  },
  "channel_defaults": {
    "on_demand": true
  }
}

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)

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. :tea: