New plugin webcamRename ( and overlay )

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

New plugin webcamRename ( and overlay )

Post by davidefa » Fri Mar 12, 2021 7:38 pm

I'm 'fighting' with my ip camera to use as a weather cam. First problem is renaming the images, second add overlay image and text.
This plugin is my minimalistic approach ( no need for other hardware/software running 24h ):

- image rename
- image resize ( don't know why I added )
- logo overlay
- 2 lines of text ( with configurable format and colors )

NOTES
Text colors use R,G,B
Background colors use R,G,B,A ( with transparency )
R,G,B value from 0 to 255
A value from 0 to 127, note 0=opaque, 127=transparent
Fonts included in directory ttf: Calibri, CalibriB, Vera, VeraBd, VeraBI, VeraIt, VeraMoBd, VeraMoBI, VeraMoIt, VeraMono, VeraSe, VeraSeBd
Text may include following variables:
#dte# date extracted from image file
#dtf# date extracted from exif data ( if present )
#T# temperature ( last value in database )
#H# humidity
#P# pressure

INSTALLATION
After plugin installation the file awebcamRename.php have to be copied to directory /load/crons
If you have a cron job that calls /load/cron.php everything is ok
If not add a cron job ( see documentation of webcam plugin )

wr1.png
wr1.png (224.54 KiB) Viewed 2463 times
wr2.png
wr2.png (128.89 KiB) Viewed 2463 times
wr3.jpg
wr3.jpg (868.93 KiB) Viewed 2463 times
Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Fri Mar 12, 2021 7:39 pm

This is the plugin
Attachments
webcamRename_1.1a.zip
(784.34 KiB) Downloaded 63 times
Image

User avatar
LOBWX
Forecaster
Forecaster
Posts: 103
Joined: Sun Mar 11, 2018 6:43 pm
Location: Los Osos, CA
Station model: Ambient WS 1401-IP
Software: MeteoBridge
Contact:

Re: New plugin webcamRename ( and overlay )

Post by LOBWX » Fri Mar 12, 2021 11:42 pm

Looks Awesome. Thank You.
Just BE NICE! That's all it takes to be a decent human...
Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Fri Apr 23, 2021 10:29 pm

ver 1.2

Added option 'Dynamic Directory' to deal with cameras ( es Reolink ) that insert images in a directory structure year/month/day
The subsequent option 'Grace Time' is a small delay before deleting previous days directories
Attachments
webcamRename_1.2.zip
(763.71 KiB) Downloaded 70 times
Image

User avatar
Jolumarali
Forecaster
Forecaster
Posts: 203
Joined: Sun Aug 20, 2017 2:06 pm
Location: Lignerolles
Station model: Vantage Vue
Software: WlIP
Contact:

Re: New plugin webcamRename ( and overlay )

Post by Jolumarali » Tue May 18, 2021 6:53 am

Thanks Davide

For the pressure, could you format me Text for display on the banner please?

And thank you again

José Luis
Image
Station météo amateur Lignerolles
OS : Windows 10 Famille
Vantage Vue
Weatherlink 2.0 (WlIP)
Meteotemplate 18.0 Papaya

https://meteo-lignerolles.fr

José Luis

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Tue May 18, 2021 11:33 am

You should provide an example line.
If you set:

Code: Select all

First line left text = #T#,#H#,#P#,#W#,#S#
First line left text format = Temp %0.1f - Hum %d%% - Pres %0.1f - Wind %0.1f - Sun %d
you should get something similar to:
Temp 22.0 - Hum 32% - Pres 1001.2 - Wind 3.2 - Sun 450
Image

User avatar
Jolumarali
Forecaster
Forecaster
Posts: 203
Joined: Sun Aug 20, 2017 2:06 pm
Location: Lignerolles
Station model: Vantage Vue
Software: WlIP
Contact:

Re: New plugin webcamRename ( and overlay )

Post by Jolumarali » Tue May 18, 2021 2:51 pm

Modification made,
Thank you very much Davide

José Luis
Image
Station météo amateur Lignerolles
OS : Windows 10 Famille
Vantage Vue
Weatherlink 2.0 (WlIP)
Meteotemplate 18.0 Papaya

https://meteo-lignerolles.fr

José Luis

User avatar
amonphi
Observer
Observer
Posts: 45
Joined: Mon Sep 10, 2018 12:52 pm
Location: Italy
Station model: Ecowitt GW1003
Software: WU
Contact:

Re: New plugin webcamRename ( and overlay )

Post by amonphi » Sat Aug 06, 2022 1:29 pm

Hi Davidefa,
I finally installed the ipcamera to be used as Weathercam (a reolink) and I saw that your plugin solves the problem of tree folders and rename the images but, I was unable to make it work. Can you tell me where I'm wrong please?

1) I send the images via IPCam FTP every 5min, directly on the template server in a folder that I called "WeatherCam" URL/Path:/Template/WeatherCam. In Images Directory of your plugin I indicated that path.
2) In Image Prefix files I gave the name "PWS".
3) The remaining options of the plugin I have not changed them.
4) Lastly, I copied the awebcamRename.php to directory /load/crons file, where the dailyNotificationsCron.php and uploadWU.php were already present. In theory so I should already have at Cron Job that calls /load/cron.php right? Or do I have to create another chron job?

The images have a size of 100 KB, 2560x1920 pixels, 96 dpi, 24 bits, with 0664 permits. The resolution is too large and do I have to activate the Resize Image option on your plugin?

It is certainly nonsense.

For now good weekend ;)

UPDATE
Reading the instructions of the Jachym webcam plugin, I noticed that I had the programmed execution for Cron.php at 30 min, now I tried to put it at 1 minute (hoping that you do not create problems) and I see if the problem is that, even if It seems not to work the same.
Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Sat Aug 06, 2022 11:09 pm

Try executing the load/cron.php script with the browser ( http://meteopaparano.altervista.org/tem ... TEPASSWORD ) and take a screenshot of the result
Image

User avatar
amonphi
Observer
Observer
Posts: 45
Joined: Mon Sep 10, 2018 12:52 pm
Location: Italy
Station model: Ecowitt GW1003
Software: WU
Contact:

Re: New plugin webcamRename ( and overlay )

Post by amonphi » Sun Aug 07, 2022 3:42 pm

davidefa wrote: Sat Aug 06, 2022 11:09 pm Try executing the load/cron.php script with the browser ( http://meteopaparano.altervista.org/tem ... TEPASSWORD ) and take a screenshot of the result
Hello,
I don't know what happened but from this morning nothing works anymore, not even the update of the data, yesterday I have to have compromised something but, I do not come to the head. I also reinstalled ecowitt v2.10a plugin, and ecowittModules v1.5 but, nothing.
Immagine.jpg
Immagine.jpg (34.93 KiB) Viewed 600 times
Immagine_2.jpg
Immagine_2.jpg (36.33 KiB) Viewed 600 times
UPDATE
I did some adjustments and now the result is this but, it also continues not to update the data from the weather station.
Attachments
Immagine_4.jpg
Immagine_4.jpg (67.92 KiB) Viewed 596 times
Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Sun Aug 07, 2022 7:16 pm

There is something happening I don't understand. Could you pm me the credentials of your altervista control panel so I can take a look( you can change them after everithing is ok )?
Image

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Wed Aug 17, 2022 11:30 am

davidefa wrote: Fri Mar 12, 2021 7:39 pm This is the plugin
Hi.
I have a Reolink cam and have installed webcamRename_1.2.
Is this the right way to write the pats to the images?
The Meteotemplate is on the same server but in a different folder.

Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Wed Aug 17, 2022 2:23 pm

You can try this updated version:
ver 1.3
- duplicated output files: renamed only file in addition to renamed and overlaid file.
- added local directory path ( as an help to define images path )

Main configuration:
1) IMAGES DIRECTORY: insert the path to directory containing images ( take as a reference the local directory path written above )
2) RENAMED IMAGE NAME: insert the filename of the renamed image ( path + file name + extension )
3) OUTPUT IMAGE NAME: insert the filename of the renamed image ( path + file name + extension )
4) DYNAMIC DIRECTORY: insert /#YY#/#MM#/#DD# if your camera create a directory structure like /year/month/day
5) RENAME IMAGE: set to yes

webRen01.png
webRen01.png (188.61 KiB) Viewed 491 times
Attachments
webcamRename_1.3.zip
(355.95 KiB) Downloaded 8 times
Image

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Wed Aug 17, 2022 6:16 pm

Thanks for answering and your efford to help. This is a bit difficult.
I have installed both the webcam-block and the webcamTimelapse-block but nothing works.
Have also installed webcam-plugin and webcamRename-plugin. My webcam puts the images in the /public_html/template/plugins/webcamRename/cam3 folder in a year/month/day strukture.
There is no images going to the s/webcamRename/images folder.
I guess I must give up this webcam efford if some magic doesnt happen. :)
Thx

Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Wed Aug 17, 2022 8:11 pm

In the plugin setup:
IMAGES DIRECTORY is ok ( /home/fjrvofei/public_html/template/plugins/webcamRename/cam3 )
DYNAMIC DIRECTORY is ok ( /#YY#/#MM#/#DD# )
IMAGE FILE PREFIX insert: "West" ( without quotes )
RENAMED IMAGE NAME insert: /home/fjrvofei/public_html/template/plugins/webcamRename/images/webcam.jpg
OUTPUT IMAGE NAME is ok ( /home/fjrvofei/public_html/template/plugins/webcamRename/images/webcam1.jpg )

Remember to copy the script awebcamRename.php in the load/crons folder ( and set a cron job to execute load/cron.php )
You should be able to access the images at the following urls:
a) https://fjaervollan.no/template/plugins ... webcam.jpg ( renamed image, without overlay )
b) https://fjaervollan.no/template/plugins ... ebcam1.jpg ( image with overlay )

If the above urls do not contain an image you can test what's going wrong executing the script ( in your browser )
https://fjaervollan.no/template/load/cr ... ORD&errors

Substitute your password and post the result.

P.S.
Paths and urls ( I have written ) are not 'super correct', amend as required.

P.P.S.
What does the first line ( which is not shown in your image ) LOCAL DIRECTORY PATH contain?
( is it /home/fjrvofei/public_html/template/plugins/webcamRename ?)
Image

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Wed Aug 17, 2022 8:38 pm

Thank you. I´m getting closer. :)
My cronjob at cron-job.org failed, but now I have something to work with.
Thanks.
First line:
Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Wed Aug 17, 2022 9:11 pm

This is how I've setup mine:

cronjob2.png
cronjob2.png (44.92 KiB) Viewed 467 times
Image

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Thu Aug 18, 2022 5:44 pm

I set up mine too. But it do not work.

Image

---

Image

This is the setup for the webcam plugin:

Image

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Thu Aug 18, 2022 7:37 pm

As the error reported is 301, try using the 'final url' ( i think is: https://www.fjærvollan.no/template/load ... URPASSWORD )

Also try executing the script ( in your browser )
https://www.fjaervollan.no/template/loa ... ORD&errors

Substitute your password and post the result.

P.S.
The webcam plugin is a second step ( after webcamRename is working )
Image

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Thu Aug 18, 2022 9:07 pm

davidefa wrote: Thu Aug 18, 2022 7:37 pm As the error reported is 301, try using the 'final url' ( i think is: https://www.fjærvollan.no/template/load ... URPASSWORD )

It looks like it loaded when using HTTPS:
Image

Also try executing the script ( in your browser )
https://www.fjaervollan.no/template/loa ... ORD&errors

The images are in the /webcamRename/cam3/2022/08/17 but crontab do not find it:

load/crons
including /home/fjrvofei/public_html/template/plugins/webcamRename/settings.php
font=/home/fjrvofei/public_html/template/plugins/webcamRename/ttf/VeraBd.ttf
delYearDir:
delMonthDir:
delDayDir:1
2022 08 17
22 8 17
directory:/home/fjrvofei/public_html/template/plugins/webcamRename/cam3/2022/08/17 does not exists
delYearDir:
delMonthDir:
delDayDir:
2022 08 18
22 8 18
directory:/home/fjrvofei/public_html/template/plugins/webcamRename/cam3/2022/08/18 does not exists
ERROR: file: /home/fjrvofei/public_html/template/plugins/webcamRename/images/webcam.jpg does not exists.Loaded CRON: /home/fjrvofei/public_html/template/load/crons/awebcamRename.php

P.S.
The webcam plugin is a second step ( after webcamRename is working )

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Fri Aug 19, 2022 6:47 am

Not sure why it does not find the directory ( maybe some 'unicode chars'?! ).
To overcome this we can use 'relative paths', I'll add a #BASEDIR# constant to handle this easier ( and a couple of test buttons to check directories )
Image

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Fri Aug 19, 2022 12:43 pm

I put one of the webcam images manually into the folder /public_html/template/plugins/webcamRename/images and renamed the image to webcam.jpg.
Soon after a new image was saved (not by me) in the same folder: webcam1.jpg.
This image is not updatet but the dates and time are updated. Of course because the script can´t find the folder with the year/mont/day folder.
So, muybe it is that part of the script (year/month/day) that is the reson....

https://fjærvollan.no/template/plugins/ ... ebcam1.jpg

davidefa
Expert
Expert
Posts: 652
Joined: Tue Jan 12, 2021 8:03 am
Location: Italy
Station model: WH2650
Software: WH2650 (direct upload)
Contact:

Re: New plugin webcamRename ( and overlay )

Post by davidefa » Fri Aug 19, 2022 1:51 pm

Thanks, I'll double check it.
Can you please post your settings.php configuration file ( inside the plugins/webcamRename folder ), so I can check with your own settings.

P.S.
Meanwhile I verified that the function I use for directory reading is 'unicode sensitive' so you may try to change this setting:
IMAGES DIRECTORY set to

Code: Select all

../plugins/webcamRename/cam3
Image

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Fri Aug 19, 2022 3:39 pm

davidefa wrote: Fri Aug 19, 2022 1:51 pm Thanks, I'll double check it.
Can you please post your settings.php configuration file ( inside the plugins/webcamRename folder ), so I can check with your own settings.
<?php
// setup file


$imageInURL = '/home/fjrvofei/public_html/template/plugins/webcamRename/cam3';
$dynamicDirectory = '/#YY#/#MM#/#DD# ';
$graceTime = 8;
$imagePrefix = 'West';
$renameImages = true;
$image_name = '/home/fjrvofei/public_html/template/plugins/webcamRename/images/webcam.jpg';
$output_image_name = '/home/fjrvofei/public_html/template/plugins/webcamRename/images/webcam1.jpg';
$resizedWidth = 800;
$resizedHeight = 600;
$resizeImages = true;
$imageFileOverlay = '/home/fjrvofei/public_html/template/plugins/webcamRename/images/logo.png';
$overlayXPos = 700;
$overlayYPos = 20;
$overlayAlpha = 100;
$overlayImages = true;
$bar_height = 30;
$font = 'VeraBd';
$text_size = 15;
$first_line_vposition = 'bottom';
$first_line_right = '#dtf#';
$first_line_right_format = '%s';
$flrfc = '255, 255, 255';
$first_line_left = '#T#,#H#,#W#,#S#';
$first_line_left_format = 'Temp %0.1f - Hum %d%% - Wind %0.1f - Sun %d';
$fllfc = '255, 0, 0';
$second_line = '';
$second_line_format = '%s';
$slfc = '255, 255, 255';
$flbgc = '1, 0, 128, 0';
$slbgc = '1, 0, 170, 0';
?>

P.S.
Meanwhile I verified that the function I use for directory reading is 'unicode sensitive' so you may try to change this setting:
IMAGES DIRECTORY set to

Code: Select all

../plugins/webcamRename/cam3

User avatar
tobydude
Forecaster
Forecaster
Posts: 120
Joined: Sun Jan 07, 2018 6:43 pm
Location: Norway
Station model: Netatmo
Software: Weatherdiaplay
Contact:

Re: New plugin webcamRename ( and overlay )

Post by tobydude » Fri Aug 19, 2022 5:45 pm

Not sure what you mean by this:

P.S.
Meanwhile I verified that the function I use for directory reading is 'unicode sensitive' so you may try to change this setting:
IMAGES DIRECTORY set to

Code: Select all

../plugins/webcamRename/cam3
[/quote]

Post Reply