Hello,

I’ve attached a diagram of the setup I’m trying to achieve. Hopefully its clearer than trying to explain it with text…

Basically I’m trying to stream the camera to a selfhosted webpage.

The camera is connected to the VPN server

The stream is picked up on the Media Server (MediaMTX)

The stream is available from anywhere on the local network via whatever protocol MediaMTX offers. All good here.

The webserver set up is Nginx. Works fine.

A basic Wordpress site is set up and I can access it via a domain name over the internet with HTTPS.

What I’m struggling with is getting the “local stream” (read local IP) in to the website. I have WP plugins that let me embed streams, but I suspect the issue is the local IP is not available over the internet so you cant just point it to 192.X.X.X. Saying that though, even on my local network I cant see the stream.

So the questions are,

  1. how can I serve the stream to nginx/ wordpress and
  2. can I somehow have nginx treat the stream as a locally hosted resource that can proxy the stream to remote web browsers?

Ideally I dont want to open up a port on the LAN for a direct streaming to the internet which the website then points to as it seems a unsafe… But if that’s the only way then I guess it can’'t be helped.

Happy to provide more info if needed.

TIA

Edit: Wordpress is for a separate website project outside of the scope of this post. Only 1 page will be for the video player/ stream but there will be other uses for the website. Not just streaming

  • Baggins [he/him]
    link
    fedilink
    English
    260 minutes ago

    Configuring nginx as a reverse proxy seems like the simplest way to expose your stream.

    • @abominable_pandaOP
      link
      English
      156 minutes ago

      Reverse proxy the stream and reference itself in the reverse proxied website? Is there no way to do it internally in nginx?

    • @abominable_pandaOP
      link
      English
      1
      edit-2
      1 hour ago

      I dont know… you tell us! There is a market for all sorts of things

      In any case this isn’t an OF/ kink kind of website, rest assured :)

  • @just_another_person
    link
    English
    52 hours ago

    You can either connect whatever the WordPress host is on to your VPN and access the camera that way, or create a reverse proxy off of something connecting to the VPN. There’s no other way to transport a live video stream like this between points except by direct connection though.

    • @abominable_pandaOP
      link
      English
      22 hours ago

      Is that just to bring the webserver/ WordPress on to the same subnet? Because they already are at this point… everything’s on the 192.X subnet.

      At this point we can ignore the VPN and just assume I’m trying to pick the stream up from mediaMTX

      • @just_another_person
        link
        English
        22 hours ago

        I’m missing something in your post then.

        Are you asking exactly what the mechanism for getting a direct video stream from a camera is? Depends on your camera, but it’s almost always RTSP.

        Are you sure your camera even supports streaming off camera? You can try opening an RTSP stream from the camera with VLC as a quick and simple test to find out.

        • @abominable_pandaOP
          link
          English
          2
          edit-2
          2 hours ago

          Apologies if it wasn’t clear.

          Yes, I have an RTSP stream all the way to my local network. I can pick up the RTSP stream and also HLS, WebRTC etc. all locally. For all intents and purposes I have a stream ready to go on the local network at 192.168.X.A

          The webserver is also on 192.168.X.Y and serves wordpress just fine.

          I just dont know how to make the two talk. When I go to https:// website. com the embedded stream looking for 192.168.X.A doesn’t work

          However if I go directly to 192.168.X.A in my browser the stream works just fine (I’ve ommited ports in this comment)

          • @just_another_person
            link
            English
            22 hours ago

            Then you need to go looking in your logs. You mentioned nginx, so go check those logs, or the WordPress logs and see if you can get any info. Wouldn’t hurt to also check your browser console output and see if there are any errors there when attempting to load the page.

            • @abominable_pandaOP
              link
              English
              12 hours ago

              Nothing obvious in the browser logs. Not even a 404 but ill check the other logs again. Thanks!

  • @lordnikon
    link
    English
    42 hours ago

    Why Wordpress seems like a heavy solution for a basic web page and lots of maintenance and security vulnerabilities.

    • @abominable_pandaOP
      link
      English
      2
      edit-2
      2 hours ago

      Free, self hostable, not subscription based, and lots of support. I’m making a whole website of which one page will be a “live stream”. Happy to explore other options though!

      Edit: It won’t be a high traffic production website btw. Just a basic one for a select few users

  • @[email protected]
    link
    fedilink
    English
    3
    edit-2
    1 hour ago

    Not seeing why you need WordPress.

    The safest way I can see to make a secure connection across an untrusted network is to use a VPN of some sort, specifically a mesh network like Wireguard or Tailscale.

    Tailscale has the advantage of being almost zero config, plus has the Serve and Funnel features which provide a mechanism to allow specific traffic into your Tailscale network.

    Edit: Tailscale Serve is probably what I’d use.

    • @abominable_pandaOP
      link
      English
      12 hours ago

      I need the website to serve to public users but the website itself is out of scope of this post.

      One of the pages will be a video player

      • @[email protected]
        link
        fedilink
        English
        12 hours ago

        Yea, if you use Tailscale with Funnel, you get a secure connection with no config required by the web user.

        • @abominable_pandaOP
          link
          English
          11 hour ago

          Ooh i see. So Funnel provides an encrypted tunnel and proxy URL for the camera stream out of my network?

          So i point the video player to that “public” address and its good to go?

          Interesting!