Text Overlay from Arduino Serial....?
Text Overlay from Arduino Serial....?
Hi- I'd like to take senor data coming in from serial on an Arduino and overlay that text data on the ZoneMinder video. Is that possible? Can you point me in the right direction?
Thanks!
Thanks!
Re: Text Overlay from Arduino Serial....?
Hello! maybe using zmTrigger.pl you can insert your overlay without having to change or add to much code.
look here http://zoneminder.readthedocs.org/en/la ... nitor.html
search for :
look here http://zoneminder.readthedocs.org/en/la ... nitor.html
search for :
I hope this sets some wheels in motion in your quest.Timestamp Label Format
This relates to the timestamp that is applied to each frame. It is a ‘strftime’ style string with a few extra tokens. You can add %f to add the decimal hundredths of a second to the frame timestamp, so %H:%M:%S.%f will output time like 10:45:37.45. You can also use %N for the name of the monitor and %Qwhich will be filled by any of the ‘show text’ detailed in the zmtriggers.pl section.
Re: Text Overlay from Arduino Serial....?
Thanks for the reply! I thought about that and figured modifying the code would shut me out from ZM updates. I was hoping there was some means of interfacing it.
Thanks
Thanks
Re: Text Overlay from Arduino Serial....?
I am envisioning something like an aquarium that has a camera pointed at it streamed using zoneminder. The water temp needs to be cold and constant, cooled by a chiller. A Arduino temp sensor sends its signal via serial port or receives a signal? But the end effect is the water temp is in real time displayed on top of the video stream of the aquarium.
This is an interesting feature. Someway of overlaying text/image onto the video stream. Some code could be added perhaps that is separated from the main zoneminder code so updates won't overwrite the modifications. But this may also mean zms needs to be modified. Not sure. But this is worth looking into.
This is an interesting feature. Someway of overlaying text/image onto the video stream. Some code could be added perhaps that is separated from the main zoneminder code so updates won't overwrite the modifications. But this may also mean zms needs to be modified. Not sure. But this is worth looking into.
Re: Text Overlay from Arduino Serial....?
Wouldn't using a ffmpeg source work?
I think ffmpeg can add a text overlay to a video source, and if I'm not wrong ZM can use ffmpeg to capture images (with with the ability to set options per monitor). I've never used ffmpeg source in ZM so I'm not sure if this is a possible way.
I think ffmpeg can add a text overlay to a video source, and if I'm not wrong ZM can use ffmpeg to capture images (with with the ability to set options per monitor). I've never used ffmpeg source in ZM so I'm not sure if this is a possible way.
Re: Text Overlay from Arduino Serial....?
Very perceptive, that's exactly what I'm doing.rockedge wrote:I am envisioning something like an aquarium that has a camera pointed at it streamed using zoneminder. The water temp needs to be cold and constant, cooled by a chiller. A Arduino temp sensor sends its signal via serial port or receives a signal? But the end effect is the water temp is in real time displayed on top of the video stream of the aquarium.
This is an interesting feature. Someway of overlaying text/image onto the video stream. Some code could be added perhaps that is separated from the main zoneminder code so updates won't overwrite the modifications. But this may also mean zms needs to be modified. Not sure. But this is worth looking into.

This would also be useful in a weather station, quad copters, and all kinds of monitoring situations.
Re: Text Overlay from Arduino Serial....?
The video sources are usb webcams. I'm not very familiar with video capture stuff, so I need to do some research on ffmpeg.Nerre wrote:Wouldn't using a ffmpeg source work?
I think ffmpeg can add a text overlay to a video source, and if I'm not wrong ZM can use ffmpeg to capture images (with with the ability to set options per monitor). I've never used ffmpeg source in ZM so I'm not sure if this is a possible way.
Thanks
Re: Text Overlay from Arduino Serial....?
I stream a tank here: http://farmillriver.rockedge.org/?page_id=504
We also would like to set up a sensor pack to stream real time water data.It is not anywhere near a salt water reef tank in complexity. It is all part of Trout in the Classroom Project run by Trout Unlimited Nutmeg Chapter. Small side project. I am experimenting with X10 and a CM19a USB Transceiver and triggering events and activating motors.
We also would like to set up a sensor pack to stream real time water data.It is not anywhere near a salt water reef tank in complexity. It is all part of Trout in the Classroom Project run by Trout Unlimited Nutmeg Chapter. Small side project. I am experimenting with X10 and a CM19a USB Transceiver and triggering events and activating motors.
Re: Text Overlay from Arduino Serial....?
Ah! Nice find rockedge. I did not notice timestamp supported the %Q token. Good idea to use it with zmtrigger.
rockedge wrote:Hello! maybe using zmTrigger.pl you can insert your overlay without having to change or add to much code.
look here http://zoneminder.readthedocs.org/en/la ... nitor.html
search for :I hope this sets some wheels in motion in your quest.Timestamp Label Format
This relates to the timestamp that is applied to each frame. It is a ‘strftime’ style string with a few extra tokens. You can add %f to add the decimal hundredths of a second to the frame timestamp, so %H:%M:%S.%f will output time like 10:45:37.45. You can also use %N for the name of the monitor and %Qwhich will be filled by any of the ‘show text’ detailed in the zmtriggers.pl section.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
Re: Text Overlay from Arduino Serial....?
Very nice!! Did you use zmTrigger.pl to inject the text banner at the top? Any more insight?rockedge wrote:I stream a tank here: http://farmillriver.rockedge.org/?page_id=504
We also would like to set up a sensor pack to stream real time water data.It is not anywhere near a salt water reef tank in complexity. It is all part of Trout in the Classroom Project run by Trout Unlimited Nutmeg Chapter. Small side project. I am experimenting with X10 and a CM19a USB Transceiver and triggering events and activating motors.
Thanks!
Re: Text Overlay from Arduino Serial....?
The text banner is created when a camera is configured. In the config look under config.jpg the Timestamp tab.Did you use zmTrigger.pl to inject the text banner at the top? Any more insight?
I did inject successfully text by using %Q in the time format and sending this string to zmTrigger.pl
format :
Code: Select all
<id>|<action>|<score>|<cause>|<text>|<showtext>
Code: Select all
1|on|255|test run|cam control|cam controller
‘showtext’ is up to 32 characters of text that can be displayed in the timestamp that is added to images. The ‘show’ action is designed to update this text without affecting alarms but the text is updated, if present, for any of the actions. This is designed to allow external input to appear on the images captured, for instance temperature or personnel identity etc.
- Attachments
-
- config.jpg (38.7 KiB) Viewed 12628 times
Re: Text Overlay from Arduino Serial....?
using this PHP script I called monck-v.php is modified to accept a string like:
or to turn it off:
This is working good.
Code: Select all
http://localhost/zm/monck-v.php?extTrigger=1|show|255|display txt|cam-control|control text here
Code: Select all
http://localhost/zm/monck-v.php?extTrigger=1|off|0|display txt|cam-control|control text here
Code: Select all
<?php
////monck-v.php
$extTrigger = $_REQUEST['extTrigger'];
$cfgServer = "localhost";
$cfgPort = 6802;
// $crtlTrigger = explode("|",$extTrigger);
$conn_handle = fsockopen($cfgServer, $cfgPort);
if(!$conn_handle) {
echo "Connection failed ";
exit();
}else{
// echo "Connected <br>";
fputs($conn_handle, $extTrigger);
}
fclose($conn_handle);
?>
Re: Text Overlay from Arduino Serial....?
Wow!!! Thank you for the detailed write up! I think that should fit the bill. I will test it out when I can.
Thanks again!
Thanks again!
Re: Text Overlay from Arduino Serial....?
Your welcome.
How does your sensor setup work? What components are you using? I am interested in building a system with real time streaming via ZoneMinder with real-time water temp,pH and oxygen saturation data collection and display. Maybe ammonia levels/detection as well. Always looking for a relatively inexpensive sensor array solution.
How does your sensor setup work? What components are you using? I am interested in building a system with real time streaming via ZoneMinder with real-time water temp,pH and oxygen saturation data collection and display. Maybe ammonia levels/detection as well. Always looking for a relatively inexpensive sensor array solution.
Re: Text Overlay from Arduino Serial....?
Right now it's nothing more than cheap Arduino and temp problem from eBay combined with some dirty code. Reading serial data on Windows seems pretty straightforward, but I haven't tried it with Linux yet.
There are several inexpensive (and expensive!) pH probes, ORP probes, float switches, etc etc etc that can be controlled by them. You can control pumps for wave cycles. You can also control LED drivers to create cool lighting schedules, lightning storms, passing clouds, moon cycles...
There are several home brew, Arduino based reef controllers that could be adapted to freshwater use. Here's very interesting one that includes a mobile app... http://www.reefcentral.com/forums/showt ... ?t=2332822
There are several inexpensive (and expensive!) pH probes, ORP probes, float switches, etc etc etc that can be controlled by them. You can control pumps for wave cycles. You can also control LED drivers to create cool lighting schedules, lightning storms, passing clouds, moon cycles...
There are several home brew, Arduino based reef controllers that could be adapted to freshwater use. Here's very interesting one that includes a mobile app... http://www.reefcentral.com/forums/showt ... ?t=2332822