OpenALPR Webhook Processor for IP Cameras

mlapaglia

Getting comfortable
Apr 6, 2016
849
508
I have created a docker container and windows application that can listen for OpenALPR webhooks when license plates are detected, parse pertinent information from the payload (plate #, make, model), and place them on the camera's text overlay. It also has a small dashboard to show recorded plates, not limited by the "homeowner" license cloud.openalpr.com gives you. It also schedules cameras into day/night mode as well as control focus.

Either run it in docker or run the executable on your windows desktop. after initial startup all configuration is done through the web ui.

Screenshot 2023-11-05 001947.png


Example overlay image:
1623727692409.png

Confirmed working with:
Dahua IPC-HFW5231E-Z12E
Dahua IPC-HFW5241E-Z12E

Hikvision DS-2CD2335FWD-I
Hikvision DS-2CD2325FWD-I

There is an example configuration file in the repository to use as a starting point.



The service stores the plates in a local db. Camera and Agent configuration are done through the UI:
1623727850617.png



Github:
Docker:
 

Attachments

  • 1609577132761.png
    1609577132761.png
    561 KB · Views: 933
  • 1609822579964.png
    1609822579964.png
    159.9 KB · Views: 264
  • 1610485712344.png
    1610485712344.png
    269.8 KB · Views: 745
  • 1610942294449.png
    1610942294449.png
    84.4 KB · Views: 676
  • 1623727621808.png
    1623727621808.png
    354.8 KB · Views: 1,497
Last edited:
Ah this seems very interesting. I have dahua Cams doing alpr rite now will love to test this once this can work with my cams :D
 
if you can give me the URL and the json/xml payload that needs to be sent to change the overlay I can get it added.
also the make/model so i can start making a list of what is supported.
 
  • Like
Reactions: tech101
if you can give me the URL and the json/xml payload that needs to be sent to change the overlay I can get it added.
also the make/model so i can start making a list of what is supported.

I belive most of us here are using the HFW5231E-Z12E. for the lpr How do I go about getting you the url json xml ?
 
Does this seems to be the right area ?

1609456923375.png
 
ya, go to the network tab in the dev console then click save and see what appears in network tab
 
  • Like
Reactions: tech101
When I click Save this happens..

1609457102675.png
 
if you click on each of those RPC2 it'll open up a side window that will show what got sent in the request, look for something related to overlays
 
  • Like
Reactions: tech101
if you click on each of those RPC2 it'll open up a side window that will show what got sent in the request, look for something related to overlays
1609457320060.png
 
good, double click the text in the Form Data field and copy it in here. try searching each one for "TE-121" to narrow down which call is setting that text
 
  • Like
Reactions: tech101
good, double click the text in the Form Data field and copy it in here. try searching each one for "TE-121" to narrow down which call is setting that text
{"method":"system.multicall","params":[{"method":"configManager.setConfig","params":{"name":"ChannelTitle","table":[{"Name":"LPR 1 (TE-121)"}],"options":[]},"id":380,"session":"6edb1a0885860c4b008ea9cbb77cb9d3"},{"method":"configManager.setConfig","params":{"name":"VideoWidget","table":[{"ChannelTitle":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[148,7511,1773,7928],"TextAlign":2},"Covers":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[0,0,1024,1024]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[1024,1024,2048,2048]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[2048,2048,3072,3072]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[3072,3072,4096,4096]}],"CustomTitle":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5319,7445,7929,7862],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":""}],"FontSize":32,"FontSizeExtra1":32,"FontSizeExtra2":32,"FontSizeExtra3":32,"FontSizeScale":1,"FontSizeSnapshot":32,"OSDMobileState":{"BackColor":[0,1,1,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[6295,920,7929,1351]},"PTZCoordinates":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZDirection":{"BackColor":[0,1,1,128],"DisplayTime":5,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZOSDMenu":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZOSDMenuViaApp":{"BackColor":[0,1,1,128],"DisplayTime":60,"EncodeBlend":true,"EncodeBlendExtra1":true,"EncodeBlendExtra2":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[281,1477,2897,1542]},"PTZPreset":{"BackColor":[0,1,1,128],"DisplayTime":5,"EncodeBlend":false,"FrontColor":[255,255,255,3],"PreviewBlend":false,"Rect":[475,1442,475,1442]},"PTZZoom":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PictureTitle":{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"Name":"osd.bmp","PreviewBlend":false,"Rect":[0,0,128,128]},"PtzPattern":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PtzRS485Detect":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"Temperature":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320],"TemperatureUnit":"Centigrade"},"TimeTitle":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[5319,352,7929,769],"ShowWeek":false,"WeekPosition":"Right"},"UserDefinedTitle":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""}],"VoltageStatus":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[541,3320,541,3320]},"WideHeightRatio":0}],"options":[]},"id":381,"session":"6edb1a0885860c4b008ea9cbb77cb9d3"}],"id":382,"session":"6edb1a0885860c4b008ea9cbb77cb9d3"}:
 
Can you go into the text overlay options and populate some of the fields, then do the same copy paste of the payload? i found the channel title field but don't see the overlays
 
  • Like
Reactions: tech101
wow when I click over lay lot of stuff comes up..

1609458043197.png
 
no no, click on overlay, enable it, populate some of the fields, then click save. it'll be another RPC2 call
 
1609458194757.png
 
The first RPC 2 .. after clicking overlay..

{"method":"system.multicall","params":[{"method":"configManager.getConfig","params":{"name":"Encode"},"id":357,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"SmartEncode"},"id":358,"session":"416eaad9e266a4cea830c6ec143f7ab0"}],"id":359,"session":"416eaad9e266a4cea830c6ec143f7ab0"}:

The 2nd
{"method":"ptz.getCurrentProtocolCaps","params":null,"id":360,"session":"416eaad9e266a4cea830c6ec143f7ab0","object":790168624}:

The third rpc 2

{"method":"system.multicall","params":[{"method":"configManager.getConfig","params":{"name":"VideoWidget"},"id":361,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"ChannelTitle"},"id":362,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"VideoWidgetNumberStat"},"id":363,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"OSDSysAbnormal"},"id":364,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"VideoWidget2"},"id":365,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"GPS"},"id":366,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"VideoWidgetRoadInfo"},"id":367,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"AtmosphereOSD"},"id":368,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"LaserDistMeasure"},"id":369,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"FaceFlowStat"},"id":370,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"DevLocation"},"id":371,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.getConfig","params":{"name":"VideoWidgetSolarCellStat"},"id":372,"session":"416eaad9e266a4cea830c6ec143f7ab0"}],"id":373,"session":"416eaad9e266a4cea830c6ec143f7ab0"}:
 
This is the one for Text overlay..
1609458438675.png
{"method":"system.multicall","params":[{"method":"configManager.setConfig","params":{"name":"ChannelTitle","table":[{"Name":"LPR 1 (TE-121)"}],"options":[]},"id":378,"session":"416eaad9e266a4cea830c6ec143f7ab0"},{"method":"configManager.setConfig","params":{"name":"VideoWidget","table":[{"ChannelTitle":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[148,7511,1773,7928],"TextAlign":2},"Covers":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[0,0,1024,1024]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[1024,1024,2048,2048]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[2048,2048,3072,3072]},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[3072,3072,4096,4096]}],"CustomTitle":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[5319,7445,7929,7862],"Text":"Test","TextAlign":2},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[5321,7450,7931,7868],"Text":""}],"FontSize":32,"FontSizeExtra1":32,"FontSizeExtra2":32,"FontSizeExtra3":32,"FontSizeScale":1,"FontSizeSnapshot":32,"OSDMobileState":{"BackColor":[0,1,1,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[6295,920,7929,1351]},"PTZCoordinates":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZDirection":{"BackColor":[0,1,1,128],"DisplayTime":5,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZOSDMenu":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PTZOSDMenuViaApp":{"BackColor":[0,1,1,128],"DisplayTime":60,"EncodeBlend":true,"EncodeBlendExtra1":true,"EncodeBlendExtra2":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[281,1477,2897,1542]},"PTZPreset":{"BackColor":[0,1,1,128],"DisplayTime":5,"EncodeBlend":false,"FrontColor":[255,255,255,3],"PreviewBlend":false,"Rect":[475,1442,475,1442]},"PTZZoom":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PictureTitle":{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"Name":"osd.bmp","PreviewBlend":false,"Rect":[0,0,128,128]},"PtzPattern":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"PtzRS485Detect":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320]},"Temperature":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[541,3320,541,3320],"TemperatureUnit":"Centigrade"},"TimeTitle":{"BackColor":[0,0,0,128],"EncodeBlend":true,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[5319,352,7929,769],"ShowWeek":false,"WeekPosition":"Right"},"UserDefinedTitle":[{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""},{"BackColor":[0,0,0,128],"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":false,"Rect":[148,352,1773,769],"Text":""}],"VoltageStatus":{"BackColor":[0,1,1,128],"DisplayTime":0,"EncodeBlend":false,"FrontColor":[255,255,255,0],"PreviewBlend":true,"Rect":[541,3320,541,3320]},"WideHeightRatio":0}],"options":[]},"id":379,"session":"416eaad9e266a4cea830c6ec143f7ab0"}],"id":380,"session":"416eaad9e266a4cea830c6ec143f7ab0"}: