deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.18k stars 284 forks source link

Unable to accecss API Video endpoint. #357

Open Rayvenhaus opened 12 months ago

Rayvenhaus commented 12 months ago

Perhaps I am accessing this incorrectly, but I am attempting to access the WebRTC endpoint using this URL

http://wendycam.myndworx.com.au:8083/stream/WeatherCam/channel/WendyCam/webrtc

This is my config file (sanitized).

{
  "channel_defaults": {},
  "server": {
    "debug": false,
    "http_debug": false,
    "http_demo": true,
    "http_dir": "web",
    "http_login": "wendycam",
    "http_password": "***************************",
    "http_port": ":8098",
    "ice_servers": [
      "stun:stun.l.google.com:19302"
    ],
    "ice_username": "",
    "log_level": "debug",
    "rtsp_port": ":5541",
    "token": {
      "backend": "http://127.0.0.1/test.php",
      "enable": false
    },
    "webrtc_port_max": 0,
    "webrtc_port_min": 0
  },
  "streams": {
    "mainFeed": {
      "name": "WeatherCam",
      "channels": {
        "0": {
          "name": "WendyCam",
          "url": "***************************************"
        }
      }
    }
  }
}

That DNS is correct, wendycam.myndworx.com.au points to my external IP address and port 8098 is forwarded to the internal IP address of the machine running RTStoWeb, it just gives me a 404

404 Page not Found

According to the documentation, this should be working.

When I use the endpoint on the API: http://#####:*****@wendycam.myndworx.com.au:8098/streams I get the following response

{
    "status": 1,
    "payload": {
        "mainFeed": {
            "channels": {
                "0": {
                    "name": "WendyCam",
                    "status": 1,
                    "url": "rtsp://wendycam:asd124qwe-ather4!!@10.0.0.35:554/stream2"
                }
            },
            "name": "WeatherCam"
        }
    }
}

So, why is the Video Endpoint responding with a 404 Error?

HurtZMH commented 8 months ago

Did you change anything in your code, I mean client or server side that changes UUID generated? Looks like you give your stream a specific name on UUID and is not calling properly on your link.

See:

{
    "status": 1,
    "payload": {
        "mainFeed": {
            "channels": {
                "0": {
                    "name": "WendyCam",
                    "status": 1,
                    "url": "rtsp://wendycam:asd124qwe-ather4!!@10.0.0.35:554/stream2"
                }
            },
            "name": "WeatherCam"
        }
    }
}

Your payload says that your UUID is "mainFeed" and your CHANNEL is "0", could you see that? Example:

{
    "status": 1,
    "payload": {
       **This is where the APP will look for UUID ->** "mainFeed": {
            "channels": {
               **This is where APP will look for CHANNEL->** "0": {
                    "name": "WendyCam",
                    "status": 1,
                    "url": "rtsp://wendycam:asd124qwe-ather4!!@10.0.0.35:554/stream2"
                }
            },
            "name": "WeatherCam"
        }
    }
}

Get it? So, the API says you should look for your stream that way:

http://127.0.0.1:8083/stream/{STREAM_ID}/channel/{CHANNEL_ID}/webrtc

Keep in mind that {STREAM_ID} means UUID and {CHANNEL_ID} means CHANNEL, so your correct link should be this one:

http://wendycam.myndworx.com.au:8083/stream/mainFeed/channel/0/webrtc

You are misunderstanding the difference between Stream Name and where server really stores the identifier, in this case, called UUID (STREAM_ID), also that the link look for channel NUMBER and NOT channel NAME.

At least if you didn't change nothing on server side (GO LANG). Hope it can help!