PTZ w/stored focus points and HTTP scripting?

TheWaterbug

Known around here
Oct 20, 2017
1,072
2,044
Palos Verdes
My live BeeCam (Reolink RLC-423) has been working reasonably well over the last 5+ years, and it's still running fine.
Mounted.jpg

I use ffmpeg to pull RTSP from the camera and push it out to a YouTube streaming channel, and then I have another script that commands it to rotate through N preset positions, once per minute:

Code:
#!/bin/bash

for (( ; ; ))

do

ReolinkToken=`curl -s GET "http://192.168.1.11/cgi-bin/api.cgi?cmd=Login&token=null" -d '[{"cmd":"Login","action":0,"param":{"User":{"userName":"admin","password":"password"}}}]' | /opt/homebrew/bin/jq -r '.[].value.Token.name'`

echo $ReolinkToken

Positions=$1
Dwell=$2
PositionPause=4
FocusPause=3

for TheLoop in `seq 1 $Positions`;
do
    curl -s POST "http://192.168.1.11/cgi-bin/api.cgi?cmd=PtzCtrl&token=$ReolinkToken" -d '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"ToPos","speed":32,"id":'$TheLoop'}}]'

sleep $PositionPause

curl -s POST "http://192.168.1.11/cgi-bin/api.cgi?cmd=PtzCtrl&token=$ReolinkToken" -d '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"ZoomInc","speed":32}}]'

sleep $FocusPause

curl -s POST "http://192.168.1.11/cgi-bin/api.cgi?cmd=PtzCtrl&token=$ReolinkToken" -d '[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"Stop"}}]'

sleep $Dwell

done

done

I'm also recording 24/7 in BI, albeit without the weather overlay.

My only major remaining issue is that the PTZ stored locations don't store focus, so I have also call a Zoom event and then rely on the camera's auto-focus every time I switch presets.

This doesn't work well when the scene is full of flying bees, and so it's often out of focus during the high season (e.g. now) when the bees are busy.

So I'm looking to replace the RLC-423 with a PTZ that has:
  1. IP/POE/PTZ/RTSP that stores focus points
  2. Works with BI
  3. Scriptable from bash, preferably with curl or something simple that I, as a non-programmer, can understand.
    1. In fact I found instructions here in IPCamTalk on how to control my RLC-423.
    2. Even if the camera's built-in "cruise" feature works properly (e.g. Reolink's doesn't), I'd still like to have scriptable control over it, as someday I'd like to have "voting" buttons on a page with the embedded stream, so viewers can vote on which preset they want to see.
  4. Solutions for mounting against a metal fence with square bars, like my existing camera.
    1. I probably didn't need to build that enclosure, as I found out after the fact that the camera supported 802.3af, so a simpler mount without a cavity would have worked fine, as long as I protected the cable ingress/egress from the camera body.
  5. Not hideously expensive. I paid $$229.99 for the RLC-423, five years ago, and I feel like I got my money's worth
  6. Decent image quality.
    1. Almost all the interesting bee stuff happens during daylight hours.
    2. But there are some very occasional exceptions to that.
  7. Will last another 5 years!
Suggestions? Thanks!
 
That has been an issue we have seen with PTZs is that they don't have a focus you can set it to like the fixed cams.

Not sure why.
 
That has been an issue we have seen with PTZs is that they don't have a focus you can set it to like the fixed cams.

Not sure why.
Ugh. So this is the rule rather than the exception?

Doesn't make any sense to me.
 
In my experience and that of others yes. I have had several PTZs and none had that option.
 
Last edited:
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Here's a perfect example of why I need stored focus points:

1714428488888.png
 
Swarm Alert! I'm predicting 10,000 bees will move in sometime in the next 3 hours:


And the stuttering every 5 seconds is killing me. I need to replace this camera, but if I'm going to drop $300 on a new BeeCam, I'd like to solve this focus issue.

Anything new on the market that stores focus points?
 
My Alibi PTZ camera will store Focus. Just keep in mind that if you want to setup like that you will need to make sure that you have your camera setup for such settings for them to work.. In other words if you have your camera setup for Auto Focus then when you setup that preset with a different focus point if you have auto focus turned on even though you have a focus point set that camera will then try to focus after the fact. However with One Click or Manual focus setup in the settings and when you setup a Preset to be in a different focus because of the area around it larger then the area you want to focus on.. For instance if I setup my camera to a preset at 25x on a dirt pile that I really use as area of interest for looking at deer. Anyway then in a different preset I setup with that view out of focus, When I call that preset it will be at the focus that I setup and stay as long as Auto Focus isn't enabled..
 
Last edited:
  • Like
Reactions: TheWaterbug


Your camera might be too old to support V8 of the http APIs, but looks like there is some ability to adjust the focus.

Screenshot from 2025-03-17 13-03-01.png

I have not tried this with my Reolink PTZ, so I am not sure how well it works. But just a few days ago, I needed to be able to set focus manually on another PTZ in very low light, and I was able to do it by calling similar focusDec and focusInc commands, and just time how long it takes for focus to go from a known point to another.
 
  • Like
Reactions: TheWaterbug


Your camera might be too old to support V8 of the http APIs, but looks like there is some ability to adjust the focus.

I have not tried this with my Reolink PTZ, so I am not sure how well it works. But just a few days ago, I needed to be able to set focus manually on another PTZ in very low light, and I was able to do it by calling similar focusDec and focusInc commands, and just time how long it takes for focus to go from a known point to another.

I could add "FocusDec" and "FocusInc" to my rotator script, but the timer doesn't have nearly enough granularity to focus reliably, at least not when I last fiddled with it , and especially at this short distance (typically 12" - 48"). I also fiddle with the number of presets that I want to rotate through, as the number of hives I manage goes up and down during the year, and having to keep track of calculated focus points would be hard.

The other problem is that this Reolink camera is dying. The video stutters every few seconds, and it won't store certain types of settings, such as the time-of-day nor an NTP server address. Though it will store new preset coordinates, which I find odd. So I need to replace it in any case, and probably not with a Reolink, unless they've gotten a whole lot better in the last 5 years.
 
My Alibi PTZ camera will store Focus. Just keep in mind that if you want to setup like that you will need to make sure that you have your camera setup for such settings for them to work.. In other words if you have your camera setup for Auto Focus then when you setup that preset with a different focus point if you have auto focus turned on even though you have a focus point set that camera will then try to focus after the fact. However with One Click or Manual focus setup in the settings and when you setup a Preset to be in a different focus because of the area around it larger then the area you want to focus on.. For instance if I setup my camera to a preset at 25x on a dirt pile that I really use as area of interest for looking at deer. Anyway then in a different preset I setup with that view out of focus, When I call that preset it will be at the focus that I setup and stay as long as Auto Focus isn't enabled..
Interesting. What model?
 
ALI-PZ40-VUZAI

Edit: Thought I would also mention that if anyone reading this is looking to get this camera and a Alibi NVR.. Camera is great NVR BITES.. I have never felt like I went back in time until I bought the Alibi PTZ camera and a few zoom Turrets and the POE NVR for them. Thinking that it would be something like my Amcrest and or Dahua.. NO.. The NVR and camera are not well together. In fact my 2016 Amcrest camera acts better with it lol Even that is not great but works lol..Main issue is when you set a preset in the camera in lets say preset 20 but you only have 6 preset setup in the NVR that preset that you setup in camera will show up at 7 and won't even let you know what preset it was meant to be lol.. Then if you delete a preset in the NVR will not delete from camera so then you add back lets say preset 1 it will move it to a different number in the camera lol.. Just dumb. Plus Ai in Camera don't translate to the NVR well.. Making a change in camera will not show up. Like when I have Ai with Tripwire enabled and was working in both camera and NVR. Then I go to camera and setup Face Detection and setting up all that needs to be when I go back to the NVR it still has IVS setup lol hahahahaha.. Not working but setup lol.. So NVR and Camera don't talk well to each other even though they are Vigilant Devices.. I mean I could understand if it was a Witness camera as it is an older device and different format in theory.. There are other things as well but that is good for now lol

Edit two: Oh yeah they were bought in 2021ish might have been 2020 hard to remember as I am getting to old for my brain to work well. before the last update after I complained was when things started to work kind of well together before that camera and NVR didn't talk well at all and presets never translated if you put them in the camera.. at least now they will get in the camera and or NVR but isn't anything like my Dahua or Amcrest devices.. SO Yeah you need the last update to get a little feeling like you were not ripped off because not cheap lol..
 
Last edited:
  • Like
Reactions: TheWaterbug
Understand.. Well then there is another camera that I have that also will store focus points. I don't log into this camera often so I don't remember all the features it offers. I have it just setting behind a POE NVR with presets that I setup before adding to the NVR. Then all presets were always done with Auto enabled so I never looked until after you mention cost was to much for the other and seeing this one is a Mini PTZ with only 4 x maybe it won't be what you need either but thought I would put it out there.. I just tested it to confirm that it will setup preset and go back to the preset with a set Focus point and after running 20 other presets and returning to the one I made a few times between it did keep going to the set focus point.. Now I am not 100% sure what the Real offering is seeing this is a OEM camera from Hikvision. Anyway this camera is a LTS PTZIP204WX4IR. It is a mini dome PTZ with 4mp camera and quality image. Personally don't know the sensor size to MP and to be fair for this camera the picture night or day in B/W with IR or in color in the location with loads of light it works well. It has also one feature that a lot of cameras don't and you can choose what you want to close focus to be setup for. In my case watching doves I had it setup for the shortest and image quality was very nice. 3.9inches. So yeah it has some features for the crazy little thing that it is lol.. So the focus is 3.9in to 65feet and to get what you want might need to setup the focus part under image in settings to help. Seeing the zoom lens is smaller with only a 4x zoom so focus set out to far then you trying to do a up close preset focus might not be good. But with the right focus point setup it will work great for preset focus points..
 
  • Like
Reactions: TheWaterbug
Seeing I am doing some work on its brother here is the size and quality build of the little guy compared to a 2mp 25x zoom ptz lens. Only working on changing it's gel packs but thought I would remove lens from mount so you could see not just some little lens on camera, it's a quality built device.
 

Attachments

  • 20250318_125251.jpg
    20250318_125251.jpg
    1.7 MB · Views: 0
Understand.. Well then there is another camera that I have that also will store focus points. I don't log into this camera often so I don't remember all the features it offers. I have it just setting behind a POE NVR with presets that I setup before adding to the NVR. Then all presets were always done with Auto enabled so I never looked until after you mention cost was to much for the other and seeing this one is a Mini PTZ with only 4 x maybe it won't be what you need either but thought I would put it out there.. I just tested it to confirm that it will setup preset and go back to the preset with a set Focus point and after running 20 other presets and returning to the one I made a few times between it did keep going to the set focus point.. Now I am not 100% sure what the Real offering is seeing this is a OEM camera from Hikvision. Anyway this camera is a LTS PTZIP204WX4IR. It is a mini dome PTZ with 4mp camera and quality image. Personally don't know the sensor size to MP and to be fair for this camera the picture night or day in B/W with IR or in color in the location with loads of light it works well. It has also one feature that a lot of cameras don't and you can choose what you want to close focus to be setup for. In my case watching doves I had it setup for the shortest and image quality was very nice. 3.9inches. So yeah it has some features for the crazy little thing that it is lol.. So the focus is 3.9in to 65feet and to get what you want might need to setup the focus part under image in settings to help. Seeing the zoom lens is smaller with only a 4x zoom so focus set out to far then you trying to do a up close preset focus might not be good. But with the right focus point setup it will work great for preset focus points..
Thanks! I found it on amazon for $278, which is certainly within my budget, seeing as I paid $229 for my RLC-423, 7 years ago. 4X zoom is fine, as that's what I have now. Low-light performance is not of concern, since the bees don't come out at night, and they only get night-time intruders occasionally.

But it's also clear that this is a pretty old model, as the user manual specifies Win XP and Internet Explorer 8.

Is there an HTTP API for calling set points? Or maybe I won't need that if it has a built-in "cruise" feature with stored focus points.

And now that I know Hik/LTS actually knows about storing focus points, maybe one of their newer models would do this as well. Time to shop!
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Anyway this camera is a LTS PTZIP204WX4IR
Anyone know the equivalent HikVision model? The datasheet for the DS-2DE2A404IW-DE3 appears to be very, very similar to the datasheet for the LTS PTZIP204WX4IR, but I can't be sure.

Searching amazon for DS-2DE2A404IW-DE3(C0)(USA-STD)(S6)(C) results in mostly international/English models with allegedly upgradeable firmware, despite my explicitly putting USA in the search string, for $140 - $160.

That said, I wouldn't mind paying an extra $20 - $30 for true U.S. firmware, just for peace of mind against brickness.

Also, just to confirm, I'm assuming HikVision and LTS cameras speak ONVIF, and would work with BI, right?
 
As an Amazon Associate IPCamTalk earns from qualifying purchases.
Yes it is Onvif and would work in Bi, when I get home I will move to my local network and setup in Bi to confirm there is no issues. Should be home in couple of hours.
 
Sorry had some other things to do when I got home and didn't get to it until now. So I am lazy ok and didn't want to change the IP of the camera coming off my POE NVR, Lucky for me the computer with Blue Iris works on a good few IPs and that cameras IP was one of them lol. So did a search for the device by IP and password, It found it listed all the Presets and all other things that it can find form a camera and was online with no effort like I have had to do with other cameras. Zoom and presets worked and pan and tilt all worked without having to make any changes from just the search install.. So yes works great with Bi. So I am not sure how they do things. But some people like to make the same name camera and make changes and never say what the changes are. If you are able I would try to confirm that the Camera is New Old Stock and not some version of the camera 4 or 5 Generations and now has different features and functions. The camera is older and my Firmware is from 2018 as you can see in the picture below.. Most listings can offer pictures on the outside of box that might have a Copyright with date or like some of my Amcrest cameras have Build dates on the box.. Seeing I need to pay more attention of that when I decide to go Brick one of my own cameras for trying to help someone repairs theirs lol.. The one I bricked was only one I had of that Hardware revision and until I get a replacement of same hardware I am in the dark to what is dead seeing no Schematics and parts# on chips don't match anything that I can find lol.. Oh well it happens..
 

Attachments

  • Screenshot (176).png
    Screenshot (176).png
    78.8 KB · Views: 0
  • Like
Reactions: TheWaterbug
Got 'em! Swarm moved into today:



Go to 12:54:50 on the burned-in time stamp (4:05:57 on the YouTube timeline) if you lose your place.