Embed zoneminder footage on webpage?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
IncompleteString
Posts: 33
Joined: Wed May 01, 2019 11:57 pm

Embed zoneminder footage on webpage?

Post by IncompleteString »

I'm trying to embed real time video from certain zoneminder monitors on a website, thats viewable by anyone. These would be traffic cams.

My first thought was to see if there was a way to enable basic auth for a single user, but I don't think this possible and possibly not a good idea anyway.



I also thought maybe set up a dedicated "Stream" account that would only have access to the desired monitors, then set up another web server that would log into the ZM Stream account via a script and then be able to retrieve and display the video on another website. I was able to find a script that would allow this server to log into ZM, but I'm not enough of a web designer or Apache guru to know really know how to go about this.

Im using hashed auth, so as far as I know if I just copy the image location from zoneminder webpage, the hash will only be valid for an hour or so.

Can anyone give me advice on this?
IncompleteString
Posts: 33
Joined: Wed May 01, 2019 11:57 pm

Re: Embed zoneminder footage on webpage?

Post by IncompleteString »

So after some more reading, it looks like I can use the API to log into ZM.

I'm thinking set up a webserver that, uses a script to log in to zoneminder via the API every 60 minutes.

I guess the webserver would then have to download the video from zoneminder and rehost it on the webservers webpage via a named pipe or something.

Alternately I guess I could just use a script that updates the link on the webpage ever hour with the login info returned from the API.

I think the former is a better solution, as it would not expose as much information about my zoneminder setup to the web, but the latter would probably be easier to implement.

Suggestions?
bbunge
Posts: 2934
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Embed zoneminder footage on webpage?

Post by bbunge »

It is easy to embed a Zoneminder stream into a web page. I have a system where "everyone" in the office thinks they need to "see the cameras." Using Montage and managing log ins as people came and went became a pain so I have created camera walls served by the Zoneminder server with a simple html page. My code:

<html>
<meta http-equiv="refresh" content="300">
<body>
<h1>Org Namel</h1>
<p>Camera Group</p>

<img src="http://ip-addr/cgi-bin/nph-zms?mode=jpe ... &pass=user">

<img src="http://ip-addr/cgi-bin/nph-zms?mode=jpe ... &pass=user">

<img src="http://ip-addr/cgi-bin/nph-zms?mode=jpe ... &pass=user">

</body>
</html>

Have the page set to refresh every 300 seconds
the user is non privileged with view only
the ip-addr is the address of the Zoneminder server. If you port forward through a firewall the ip-addr needs to be the ip address of the firewall or the URL
I do not use hashed passwords but you can try it.

Edit: I just set my test server to hashed and my existing camera wall still works.
IncompleteString
Posts: 33
Joined: Wed May 01, 2019 11:57 pm

Re: Embed zoneminder footage on webpage?

Post by IncompleteString »

Thanks, Bbunge, that seems to work perfectly.

Also thanks Snake, that was exactly what I was originally looking for.
Post Reply