Giter VIP home page Giter VIP logo

mmm-rtsptoweb's Introduction

MMM-RTSPtoWeb

MagicMirror2 Module for viewing IP cameras RTSP stream in real time using WebRTC technology.

Requires a RTSPtoWeb or RTSPtoWebRTC server running in the background. If you use Home Assistant, this can be the the RTSPtoWeb Add-On (e.g. http://homeassistant.local:8083).

Configuration

Option Default value Description
width 50% Max video width
url WebRTC stream URL from the RTSPtoWeb* server

To get the list of the streams available: curl http://demo:[email protected]:8083/streams

Example Config:

    {
      module: "MMM-RTSPtoWeb",
      position: "top_center",
      header: "Front Door",
      config: {
        width: "100%",
        url: "http://homeassistant.local:8083/stream/camera.front_door/channel/0/webrtc"
      }
    },

Based on the work done by @Anonym-tsk for MMM-HomeAssistant-WebRTC and @deepch for the RTSPtoWeb(RTC servers.

mmm-rtsptoweb's People

Contributors

anonym-tsk avatar shbatm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mmm-rtsptoweb's Issues

Stream falls behind, then freezes

I am using this module along with https://github.com/deepch/RTSPtoWeb, which is running on a separate RPI.

The stream displays on the MM, at first the timestamp on the video matches the time on the board, but it begins to fall behind. After two minutes, the video stream is ~30 seconds behind.

After another minute or two, the stream just freezes, and I see this message on the RTSPtoWeb output:

ERRO[2023-02-26T14:53:31-05:00] WebRTC Client Offline                         call=WritePacket channel=0 func=HTTPAPIServerStreamWebRTC module=http_webrtc stream=b042c288-1752-49e1-8406-a877e10695db
2

Is there a way to debug this issue or prevent it from happening?

Doesn't display Frigate/Go2RTC WebRTC Stream

The latest beta of frigate (home assistant camera add-on) includes go2rtc and it provides a number of webRTC streams.
However using these in the config doesn't display anything but the header, if I open chromium on the same pi and paste in the URL it opens it without issue.

Any advice of what I would look for?

Module Config
{
module: "MMM-RTSPtoWeb",
position: "top_center",
header: "Driveway",
config: {
width: "50%",
url: "http://homeassistant.local:5000/live/webrtc/webrtc.html?src=driveway_small"
}
},

Multiple Peer Connections (multiple screens) results in errors

When displaying the Mirror on multiple screens, the RTCPeerConnections are not properly handled between all parties and there will be the following error:

Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Called in wrong state: stable

It appears benign, as the video stream will still load properly.

RTSPtoWeb - Running out out RAM and crash

RTSPtoWeb is running fine but after few hours, the RAM goes to 0 and PI is crashing completely.

Checking via SSH, I see with free -h, that free RAM with 991 MB at start - is going done to 40 and then crash somewhen...
Is there anyhow a way to free RAM or keep free?

Only Show a single 640x480 H.264 Stream...

Before start:
gesamt benutzt frei gemns. Puffer/Cache verf?gbar
Speicher: 1,8Gi 372Mi 991Mi 56Mi 609Mi 1,4Gi
Swap: 99Mi 0B 99Mi

After 2h:
gesamt benutzt frei gemns. Puffer/Cache verf?gbar
Speicher: 1,8Gi 820Mi 557Mi 283Mi 860Mi 1,0Gi
Swap: 99Mi 0B 99Mi

... just making log how fast it happens...

Get stream URL

Hello i tried to add this to my mirror . I read out the streams

image

but now i am stuck at the url Dunno how to build the url according to my screenshot

Video toggling

Hi, would it be possible to make the module toggle through multiple video streams?

Position

Hello!
Ive installed module and it works normally.

But with the position bottom right and widh 50% I have real position in all bottom and the image on the left side?
How to fix position only in the right bottom?

Thank you!

Bad wifi connection

Hi and thanks for the cool module,

Due to some thick walls my wifi connection sometimes have fallouts, and when this happens the video turns black and never recover when the signal gets back.

When testing the video in the browser/RTSPtoWeb provided web page and there's a fallout, the webpage will show a loading screen followed by a resuming video feed when the signal comes back.

MM is running on a Pi4 along with the RTSPtoWeb service, the PI and the camera have fixed IP's and access point.

The Pi's internet download speed 6.89 Mbyte/s.
The Pi's internet uploadspeed 11.74 Mbyte/s.

Not able to view more than 1 stream

I have found this works great, but if i want to add another feed, it will only show the one. I have tested this in side by side in the same region and in 2 seperare regions. Will only show one feed, other one will be blank, ie just the header

Thanks
James

issue with multiple streams

trying to setup two cameras and I'm running into an issue. Main one is the video does not update in either instance after the initial load, if I remove a camera the other shows live video as expected.

config for the two instances

{
  module: "MMM-RTSPtoWeb",
  position: "bottom_right",
  header: "Front Door",
  config: {
    width: "63%",
    url: "http://xx.xx.xx.xx:8083/stream/xxx/channel/0/webrtc"
  }
},
{
  module: "MMM-RTSPtoWeb",
  position: "bottom_left",
  header: "Front Driveway",
  config: {
    width: "25%",
    url: "http://xx.xx.xx.xx:8083/stream/xxx/channel/0/webrtc"
  }
},

MM does not show camera

Hi,
Have installed and things work mostly. Via the RTSPToWeb page (on 8083) configured 5 camera's and they can be streamed.

pi@magicmirror:~ $ curl http://demo:[email protected]:8083/streams
{
    "status": 1,
    "payload": {
        "7bbc70f3-1cf3-4723-9c12-dcc684297213": {
            "name": "mystream",
            "channels": {
                "0": {
                    "url": "rtsp://admin:[email protected]:554/h264Preview_01_sub",
                    "status": 1
                },
                "1": {
                    "url": "rtsp://admin:[email protected]:554/h264Preview_02_sub",
                    "status": 1
                },
                "2": {
                    "url": "rtsp://admin:[email protected]:554/h264Preview_03_sub",
                    "status": 1
                },
                "3": {
                    "url": "rtsp://admin:[email protected]:554/h264Preview_04_sub",
                    "status": 1
                },
                "4": {
                    "url": "rtsp://admin:[email protected]:554/h264Preview_05_sub",
                    "status": 1
                }
            }
        }
    }

In config.js of MM i added the lines as per example:

                {
                        module: "MMM-RTSPtoWeb",
                        position: "upper_third",
                        header: "mystream",
                        config: {
                        width: "50%",
                        url: "http://127.0.0.1:8083/stream/mystream/channel/0/webrtc"
                        }
                },

Yet this does not show the camera. Can't figure out if i am doing something wrong.
Also tried this via remote PC browser: http://<raspberrypi-ip>:8083/stream/mystream/channel/0/webrtc
This brings a small 404 not found page.

Am i doing something wrong?
In advance thanks for the help.

Installation commands

I know I can result a noob, but.. what are the installation commands?
I am not sure if all modules have the same installation procedure so to be sure I'm asking here.
Thanks!

problem with go2rtc

Hi all,
Just to know if anybody made this module to work with go2rtc

It works with rtsptoweb and webrtc card 2.x, but no with the upgraded card to 3.x an go2rtc.

Any possibility?

Thanks in advance

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.