Overlay lots of Data

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
Burtski
Posts: 28
Joined: Thu May 14, 2020 3:34 pm

Overlay lots of Data

Post by Burtski »

Hello All
So I have been running ZM for quite a while now but I have not really done much configuration with it.
I am an old NOOB.

I would like to overlay lots of data, 15 - 20 parameters.
I have seen many people use the camera name to overlay 1 parameter, but not lots of stuff.
I would also like to position the parameters around the screen (give X,Y of where to put it on the screen )

Currently I am gathering all this data and putting in in a file along side the ZM files and matching Time stamps to correlate when necessary.

Some data updates fairly slowly ( once a minute ) and some quite quickly (10 times / sec )

Ideally I would like to (via the API) send each parameter as they come in seperately.

But I could just as easily build a txt file some where with all the bits in it formatted as needed.
I suppose I could even build an image file that could just be blindly overlayed.


(
I am monitoring a large mechanical plant -- kinda like a large refrigeration plant.
I currently record 100's of parameters around the plant.
From time to time something goes wrong ( but always in the middle of the night ;-)
So I go back and dig through the data to find the start of the event then go to ZM and see what it caught on camera.

I have caught no end of critters crawling into places or chewing on things.
Lightning strikes ( just close by might cause a glitch )

It happens often enough that I would like to have the important bits right on the screen.
)


I hope that I am not asking redundant questions.
Maybe I just don't have the correct search terms.

Thanks!!
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Overlay lots of Data

Post by bbunge »

Am a bit confused by what you are calling parameters. Do you mean recorded events? Positioning these "parameters around the screen" seems to me that you want to create a custom web page to view monitors and position the monitors in a specific order?
Please, try explaining again what you want. If English is not your primary language just use your native language and let us translate it.
Thanks.
bb
Burtski
Posts: 28
Joined: Thu May 14, 2020 3:34 pm

Re: Overlay lots of Data

Post by Burtski »

If English is not your primary language just use your native language and let us translate it. :D :D :D :D :D
Yes English is my native language but you could never tell :)

Example:
One camera is looking at some outdoor fans and heat exchanges.
At the same time there is a SCADA system recording lots of data about the equipment.
One of the things that is being recorded is the current draw (amps) of one of the fans.
I would like to overlay the value of the current for that fan over the top of the fan in the video.

Then at 3:23 AM when I get an alarm that the fan is drawing too much current I can go to 3:23AM in the recording and see the current that the fan is drawing and watch the raccoon crawl into it and see the current go way up.

on any given camera there may be from 2 to 20 items that I am keeping an eye on.
So the camera I am talking about right now can 'see' about 20 different things that I want to overlay their parameters on.
ie. there are 7 fans. So I would like to overlay the current draw of each fan over the top of the fan in the field of view.
There are 14 heat exchangers in the field of view. I would like to overlay the in and out temperatures over the top of each in the field of view.

There is another camera watching some pumps. On this camera I would like to overlay some operating parameters about these pumps.
So the next time one of these goes into high temp alarm I can see the cleaning guy turn the cooler off because it is too hot in there to take a nap. :roll:

I have all the data gathered up. Don't work about that part.
I just want to know if there is a way to position a bunch of this stuff in specific spots on the monitor.

I do see people putting weather info but it does not seem to be positioned.

I also see that some of the AI tracking stuff can position information on the screen and the info follows the object around.

I can come at this from lots of different directions.

Ideally I could just feed the API with a monitor ID, an X,Y position and text to overlay.
So I would feed camera 1 the X,Y position of FAN 1 and its current
Then feed camera 1 the XY of FAN 2 and its current.
ect.....


Or could generate some sort of text file with the XY and Text of each bit that I want overlayed.
I would update this Text file on the fly. ZM would just read this file every so often and update the screen.

I could even generate a "transparency" where I have positioned the text over each fan as needed. ZM would just read this file and just over lay it.

I will try to gin up a picture of what I want to better show.
Hope this makes more sense.
Burtski
Posts: 28
Joined: Thu May 14, 2020 3:34 pm

Re: Overlay lots of Data

Post by Burtski »

Here is a photoshop of what I am looking for.
This is just text painted over a picture.
I want to update this info live.
Attachments
Coolers.png
Coolers.png (319.91 KiB) Viewed 3866 times
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Overlay lots of Data

Post by iconnor »

So while ZM has most of the bits in place to do something like this, it will take some coding to make it happen.

in terms of implementation details, in general I wouldn't actually embed the text in the stream... I would just display it in a transparent div over the image...

Although for completeness we can also have the option to have zms overlay it.

I have been meaning to add a new table for storing this type of data, indexed to frame/time. I was looking at it more from the object detection side of things, but in the end it is just text.
Burtski
Posts: 28
Joined: Thu May 14, 2020 3:34 pm

Re: Overlay lots of Data

Post by Burtski »

@iconnor
I have been meaning to add a new table for storing this type of data, indexed to frame/time.
That is pretty much what I am doing now.
When a parameter alarms, it is time stamped. I just manually go find that timestamp in ZM.

Can you further explain what you mean by 'transparent div'?

I am not beyond rolling up my sleeves but I would not know where to ever begin to look.
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Overlay lots of Data

Post by iconnor »

First off... not just for you but anyone else who is reading... you can always throw money at me to make your feature dreams come true. I have a long todo list, and I need money, so I tend to prioritise things that pay my bills.

by transparent div.. I mean.. in html, I can layer stuff over the image without modifying the image. a div is a generic html element that I can position over the image, with the same dimensions, into which we can put whatever we want. Text/other images, etc.
Burtski
Posts: 28
Joined: Thu May 14, 2020 3:34 pm

Re: Overlay lots of Data

Post by Burtski »

Ah, so the short answer is "no", but maybe some day.
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Overlay lots of Data

Post by iconnor »

That's generally the answer to every feature.

I'm finding life a bit insane at the moment in terms of job, parent, teacher, etc. Until ZM development can actually replace job again (in terms of funding), development is slowed.
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: Overlay lots of Data

Post by burger »

You can do a proxy for a network stream with ffmpeg and overlay a transparent image on it.
I'd think it would be practical for one or two streams. I wouldn't do many. You also have
to be concerned with ffmpeg disconnecting.

But as a reference this is handled in ffmpeg with the below. You may want to adjust the udp output as needed. I haven't tested the above in Zoneminder, only with ffplay. see: https://wiki.zoneminder.com/Ffmpeg#Over ... deo_stream

Code: Select all

 ffmpeg -i "rtsp://user:pass@ipaddress:554/videostream" -f image2 -stream_loop -1 -i overlay.png -filter_complex overlay -f h264 udp://127.0.0.1:12345
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Burtski
Posts: 28
Joined: Thu May 14, 2020 3:34 pm

Re: Overlay lots of Data

Post by Burtski »

Thanks for the pointers.
I ( like everyone else ) need to try to find some time to circle back around to this.

From the little google'ing that I have done, I think the ffmpeg approach to create a virtual camera would be an elegant way to do this.
The camera feed that I am using is only VGA quality so I don't think ffmpeg will create much load for my server.

I will update here if I come up with a solution that I am not embarrassed to share :wink:

Edit: I have since upgraded to 1.36.25. This post just started here.
User avatar
iconnor
Posts: 2879
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Overlay lots of Data

Post by iconnor »

In master, we now have an Event_Data table, where we can stuff whatever data we want... still to do is how to overlay that data over the video stream.

I figure it's more useful to be able to query/export that data than to have it actually embedded in the video...
Post Reply