shbatm / MMM-RTSPtoWeb

MagicMirror2 Module for viewing IP cameras RTSP stream in real time using WebRTC technology.
MIT License
14 stars 3 forks source link

MM does not show camera #8

Open partach opened 1 year ago

partach commented 1 year ago

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:demo@127.0.0.1:8083/streams
{
    "status": 1,
    "payload": {
        "7bbc70f3-1cf3-4723-9c12-dcc684297213": {
            "name": "mystream",
            "channels": {
                "0": {
                    "url": "rtsp://admin:pswd@192.168.1.74:554/h264Preview_01_sub",
                    "status": 1
                },
                "1": {
                    "url": "rtsp://admin:pswd@192.168.1.74:554/h264Preview_02_sub",
                    "status": 1
                },
                "2": {
                    "url": "rtsp://admin:pswd@192.168.1.74:554/h264Preview_03_sub",
                    "status": 1
                },
                "3": {
                    "url": "rtsp://admin:pswd@192.168.1.74:554/h264Preview_04_sub",
                    "status": 1
                },
                "4": {
                    "url": "rtsp://admin:pswd@192.168.1.74: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.

hillaliy commented 1 year ago

Your URL is wrong. use this: url: "http://192.168.1.XXX:8083/stream/7bbc70f3-1cf3-4723-9c12-dcc684297213/channel/0/webrtc", change the XXX to whatever your server ip

partach commented 1 year ago

Thanks! but, I did (meant with mystream but did not know if unique to me:) but it still does not work. http://192.168.1.134:8083/stream/7bbc70f3-1cf3-4723-9c12-dcc684297213/channel/0/codec does work and returns content. The URL as per your suggestion returns '404 page not found'

Installed RTSPToWeb with docker and via some searching found the config.json. Removed the user and pswd (left empty) but that also does not help. Did i forget some setting somewhere?

Kree47 commented 1 year ago

I had the same problem. Could get the stream and codec info, but got a 404 on the webpage.

pi@pi04:~ $ curl http://demo:demo@192.168.47.153:8083/stream/0f10d9e2-225d-482a-a407-cbb63a0d89a4/channel/0/codec { "status": 1, "payload": [ { "Record": "AU1AHv/hACBnTUAemmQFAX/L/4BegF83AQEBQAAA+gAAOpgnaCIRqAEABGjuPIA=", "RecordInfo": { ...

pi@pi04:~ $ curl http://192.168.47.153:8083/stream/0f10d9e2-225d-482a-a407-cbb63a0d89a4/channel/0/webrtc 404 page not foundpi@pi04:~ $

flamtapgt commented 1 year ago

By watching the http debug while I loaded the stream via the web interface, it looks like it wants the url in this form:

url: "http://127.0.0.1:8083/stream/b042<your uuid here>123/channel/0/webrtc?uuid=b042<your uuid here>123&channel=0"

You can use the IP address, or 127.0.0.1, if RTSPtoWeb is running on the same raspberry pi.

Kree47 commented 1 year ago

Thanks for the suggestion. I tried following your format but still got a 404 with curl or a web browser.

flamtapgt commented 1 year ago

I believe it needs to be a POST request rather than a GET request, which is default for browsers/curl.

https://reqbin.com/req/c-g5d14cew/curl-post-example

If I remember right, when I tried the above with curl, I got a non-404 message. When I used that url in the config.js it worked.

lawrence-jeff commented 1 year ago

Anyone have any luck with this - I have tried every example listed in all these issues and can't get anything to display.

flamtapgt commented 1 year ago

In the end I found that my MagicMirror would slow down and crash after a few minutes when using this module, so I just went back to https://github.com/shbatm/MMM-RTSPStream which is kind of hacky but works consistently. (I have omxplayer set to restart using a cron job every 15 minutes or else the stream gets behind or goes blank)

lawrence-jeff commented 1 year ago

In the end I found that my MagicMirror would slow down and crash after a few minutes when using this module, so I just went back to https://github.com/shbatm/MMM-RTSPStream which is kind of hacky but works consistently. (I have omxplayer set to restart using a cron job every 15 minutes or else the stream gets behind or goes blank)

I finally got the format correct and it seems to be working ok, its ran a few days now. I have used MMM-RTSPStream for a few years and just got tired of the long delay to pull up a video (i use carousel so switch to a new screen when the camera is displayed) as well as the constant crashes and it taking over the screen overlay. Hoping this works better although my setup is slightly different. I hope to move this to an existing Home Assistant restream using go2RTC but can't get that to work yet.

For the record and anyone else looking here is the working config format - at least works for me, it uses the GUID of the stream not the name.. . I also did not add the additional characters in the URL mentioned in this thread. Note: This won't work in a browser as-is

{
  module: 'MMM-RTSPtoWeb',
  position: 'top_left',
  config: {
    url: 'http://192.168.0.152:8083/stream/4e33dfa0-4227-4f6e-b321-008f30f4b365/channel/0/webrtc',
    width: "75%"
  }
},
AceTheFace commented 1 year ago

Same problem here. Video is not displayed in MMM. Where do I find the GUID of the stream I want to display? In RTSPtoWEB the stream seems to be only referenced by name.....

EDIT: Okay, got it - by using CURL to list the streams I get:


    "status": 1,
    "payload": {
        "haustuer": {
            "channels": {
                "0": {
                    "name": "High",
                    "on_demand": true,
                    "status": 1,
                    "url": "rtsp://XXX:XXX@192.168.178.172:88/videoMain"
                },
                "1": {
                    "name": "Low",
                    "on_demand": true,
                    "url": "rtsp://XXX:XXX@192.168.178.172:88/videoSub"
                }
            }
        }
    }
}```

But using URL http://wertstoffhof2:8083/stream/haustuer/channel/0/webrtc does not work :(
Joern-HAP commented 10 months ago

Hello,

GUID/UUID of the HomeAssistant server seems:

"payload": {
    "7c9a729f-2a2e-4e54-8941-6a0e97db9be4": {
        "name": "door",

Which letters shall be added?

Proposed MM config just show black windows, even if Stream is nicely visible in RTSPtoWEB surface...

            module: "MMM-RTSPtoWeb",
            position: "top_center",
            header: "Door",
            config: {
                    width: "100%",
                    url: "http://192.168.0.xxx:8083/stream/7c9a729f-2a2e-4e54-8941-6a0e97db9be4/channel/0/webrtc"
                    }
            },
Joern-HAP commented 10 months ago

or is it only:

url: "http://192.168.0.103:8083/stream/7c9a729f-2a2e-4e54-8941-6a0e97db9be4/channel/0/webrtc?uuid=7c9a729f-2a2e-4e54-8941-6a0e97db9be4&channel=0"

Joern-HAP commented 10 months ago

For all searching for same challenge, never use H.265, only H.264.... ;-)

String: url: "http://**<HA-IP>**:8083/stream/**<UUID>**/channel/0/webrtc?uuid=**<UUID>**&channel=0"