PTZ IR Mode On Manual Focus Doesn't Remember Focus Point

Oct 6, 2025
11
4
South Africa
Hi,

I have around 40 presets at night 100m+ away.
I have saved the preset when the picture was in focus.

However, every night, it is out of focus again. Not terribly out of focus, but the picture is not sharp.
And if I set it to auto focus, it goes WAY out of focus.

What do you suggest?

I'm pointing the camera at a riverbed with wildlife on the other side.

Dahua - DH-SD6CE225DB-HNY
2MP 25x Startlight IR Network PTZ Camera
Powerful 25x optical zoom.
Starlight Technology.
Max. 25/30fps@2MP.
IR distance up to 250 m.
Deep-learning-based perimeter protection.
SMD 3.0.
PoE+.
IP67, IK10.

Settings:

1759772119683.png
1759772159833.png
 
Did you save the preset at night? Focus can be different in color vs B&W/IR

Also I'd look at reducing DNR. Its got to be a pretty soft image with it that high making it difficult to focus

Also when you set focus, the default step is 20, set it to 1 before you focus. This gives a much finer control of the focus point
 
Last edited:
Then Id start with reducing DNR and setting focus with 1 step instead of the default 20
 
Can't see the attachments..

It may be called "Speed" should be a setting right where you are using the Zoom/Focus from 1-20

Also I just noticed 1/12 exposure. Coupled with the really high DNR its going to be very very soft at night. This could hurt the cameras ability to get a clean focus
 
Ah, ok I see it. It was on the middle point. So I've changed it to slow:
1759773553471.png

I've also reduced the DNRs to a much lower level.

1759773714143.png
Anything lower than that, it's very grainy.

Should I do semi-auto? Or, what does that mean?

But, it's actually a lot better already!! Auto focus is working a lot better with the DNR lower.

Thank you!!
 
  • Like
Reactions: bigredfish
Yep try that first and then see if you can increase the exposure to at least 1/30
 
So, just to understand the algorithm, when DNR is high, the picture is just so smooth, the autofocus algorithm struggles to find sharp edges?
And when the speed is high, it is more likely to overshoot past the right focal point, and therefore, it will struggle to find the focal point?

Thanks again!
 
  • Like
Reactions: bigredfish
Generally speaking yes.

I'm sure there are others who have deeper technical knowledge, but those seem logical to me having played with them for some years.
 
It will go back to default every time you leave the page, thats just for adjusting focus, it doesnt control the normal movement of the ptz other than that

I would set Zoom & Focus on your main "Camera" page to Manual. Save
Then go to Live View, adjust slider to 1 and dial in your focus.
Then go back to the Zoom Focus tab and Save again


*Of course the problem is going to be if you have tracking it will run out of focus. You're picking a point of predetermined focus. Honestly I havent tried that so I'm guessing

Maybe do the same but try Semi Auto
 
This may assist if it works on your PTZ model.

Here using it on a Dahua PTZ SD5A425XA -HNR and it reports back the "Focus Position". It is a nice way to see if the focus number changes during the day. However, there is not a way to reposition to that focus number as best I can tell.

Place URL in a browser that has access to your cameras and change the user, password and camera IP as needed.

Code:
http://admin:[email protected]/cgi-bin/ptz.cgi?action=getStatus&channel=1

Output - The "Focus.FocusPosition" will change based on your focus settings.

Too bad that some of PTZs do not have a way to see zoom and focus numbers like in the var focus non PTZ Dahua cams. Or using a SET statement to actually set the value in the PTZ cam per preset ID.

Sample Output
status.AbsPosition[0]=14666
status.AbsPosition[1]=815
status.AbsPosition[2]=760
status.Action=Preset
status.ActionID=1
status.Focus.FocusPosition=2574.257254
status.Focus.Status=Idle
status.FocusMapValue=13107
status.Iris.IrisValue=1.000000
status.Iris.Status=Idle
status.MoveStatus=Idle
status.PanTiltStatus=Idle
status.Postion[0]=146.660000
status.Postion[1]=8.150000
status.Postion[2]=38.912000
status.PresetID=1
status.TaskName=Manual
status.TrackStatus=Idle
status.ZoomMapValue=11951
status.ZoomStatus=Idle
status.ZoomValue=570
 
  • Like
Reactions: bigredfish and marq
Yeah I have no idea why they dont have zoom/focus numbers?

They (well some) have coordinates though which can help, but not as precise as zoom/focus values
(upper left corner)

HOARearP2P_IP PTZ Camera_main_20250821154057_@3.jpg
 
Last edited:
The auto focus after reducing DNS is working a lot better!
But, there are still a few presets where it auto focuses out of focus.

Is there something wrong with the manual focus that it doesn't work every night?
Would a cloudy night vs a clear night change the focal point?
 
Not theoretically. More likely there are objects in the scene the auto focus keys on and those aren’t exactly the objects you want in focus
 
Thanks again, everyone, for all the input so far. It’s been really helpful!

But, just to clarify my original question, if I manually focus the image perfectly at night and then save that preset, why does the camera not recall that exact focus position later, so that it doesn’t have to re-run autofocus each time? Then it shouldn't matter if it's too dark for it to focus on something, no?

I completely understand the points about ambient lighting, and objects in the scene confusing the auto focus, but it seems like the camera should still be able to return to the same manual focus value if it was saved with the preset.
Is this just a limitation of Dahua PTZ firmware, or am I missing a setting somewhere that would allow manual focus values to be stored per preset?
 
Thanks again, everyone, for all the input so far. It’s been really helpful!

But, just to clarify my original question, if I manually focus the image perfectly at night and then save that preset, why does the camera not recall that exact focus position later, so that it doesn’t have to re-run autofocus each time? Then it shouldn't matter if it's too dark for it to focus on something, no?

I completely understand the points about ambient lighting, and objects in the scene confusing the auto focus, but it seems like the camera should still be able to return to the same manual focus value if it was saved with the preset.
Is this just a limitation of Dahua PTZ firmware, or am I missing a setting somewhere that would allow manual focus values to be stored per preset?

That has been our biggest complaint with PTZs (most brands) compared to fixed cameras - you cannot set a focus for a preset.

It is because of this that makes using a PTZ for LPR so difficult because you would have to essentially turn the PTZ into a fixed camera and at that preset while there is still enough light out for it to find something to focus on.

They are just designed to focus after every movement, including going to a preset. Probably because the field of view can slightly change based on where it previously spun from.
 
  • Like
Reactions: bigredfish
Thanks again, everyone, for all the input so far. It’s been really helpful!

But, just to clarify my original question, if I manually focus the image perfectly at night and then save that preset, why does the camera not recall that exact focus position later, so that it doesn’t have to re-run autofocus each time? Then it shouldn't matter if it's too dark for it to focus on something, no?

I completely understand the points about ambient lighting, and objects in the scene confusing the auto focus, but it seems like the camera should still be able to return to the same manual focus value if it was saved with the preset.
Is this just a limitation of Dahua PTZ firmware, or am I missing a setting somewhere that would allow manual focus values to be stored per preset?

I assume you’re running IR at night

Try placing something static (2x4) with reflective tape on it at your desired focus.

Also is the camera always at max zoom at your presets?