EasyPTZ: a new simple camera viewer for Windows

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
In my batch script I use below code, and can move camera without any problems.

@ECHO OFF

ECHO *** Goto preset 1...
CURL.EXE --user admin:pASSWORD http://192.168.0.45/cgi-bin/ptz.cgi?action=start^&channel=0^&code=GotoPreset^&arg1=0^&arg2=%PRESET%^&arg3=0

ECHO *** Pause...
PING 192.168.77.77 -n 1 -w 7000 > NUL

ECHO *** Taking snapshot...
WGET.EXE -O "preset1.jpg" http://admin:PASSWORD@192.168.0.45/cgi-bin/snapshot.cgi

:exit

I will try Tiny Cam Pro...
 

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
Unfortunately not working.

8:06:30pm: Changing to camera DAH04PTZ25X (#3)
8:06:30pm: Trying to get the presets from the camera...
8:06:30pm: Playing rtsp://admin:[password]@192.168.0.45:554/cam/realmonitor?channel=1&subtype=0
8:06:30pm: Restarting the player (1)
8:06:30pm: Trying to get the presets from the camera...
8:06:30pm: Playing rtsp://admin:[password]@192.168.0.45:554/cam/realmonitor?channel=1&subtype=0
8:06:37pm: Going to preset 1
8:06:37pm: There was an error reported by the camera! Response = None, text =
 

wrybread

Pulling my weight
Joined
Sep 12, 2018
Messages
249
Reaction score
115
Location
San Francisco
That's an odd one, I'm literally using curl in that test version... (With digestauth enabled of course). This version should give a more detailed error report:

gizmoware.net/easyptz
 

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
Installed version v0.899

I don't see a more detailed error report...

8:56:37pm: Changing to camera DAH04PTZ25X (#3)
8:56:37pm: Trying to get the presets from the camera...
8:56:37pm: Playing rtsp://admin:[password]@192.168.0.45:554/cam/realmonitor?channel=1&subtype=0
8:56:42pm: Going to preset 1
8:56:42pm: There was an error reported by the camera! Response = None, text =
8:56:43pm: Going to preset 2
8:56:43pm: There was an error reported by the camera! Response = None, text =
8:56:44pm: Going to preset 3
8:56:44pm: There was an error reported by the camera! Response = None, text =
8:56:45pm: Going to preset 4
8:56:45pm: There was an error reported by the camera! Response = None, text =
8:56:45pm: Going to preset 5
8:56:45pm: There was an error reported by the camera! Response = None, text =


Also I thing my 25X zoom camera use basic authentication...

 

wrybread

Pulling my weight
Joined
Sep 12, 2018
Messages
249
Reaction score
115
Location
San Francisco
I just added the option for Basic Authentication in the new version. To make it so a specific camera uses basic auth, add this line in it's config section:

camera_auth_mode = basic

For example this would make camera2 use basicauth:

Code:
[camera2]

camera_address = 192.168.1.50
camera_username = whatever
camera_password = whatever

camera_auth_mode = basic
If you try it, let me know if it fixes the issue with your camera.

gizmoware.net/easyptz
 
Last edited:

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
YES it works ! :)

Installed v0.8992 and in config file put line camera_auth_mode = basic.

Thank you for your time and fast support :))
 

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
I connected the Logitech gamepad to the PC and I am thrilled how much easier to move the camera :)

The only problem is that when using the joystick, the camera does not stop scrolling or zooming after I stop pressing the joystick keys.

To stop the camera I have to press the key on the keyboard.

When I use the keyboard or mouse, as soon as I stop holding the keypad or mouse, the camera stops moving or zooming.

Thank you :)
 

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
Logitech RumblePad 2

P/N: 863247-0000
M/N: G-UF13

863247-0000 - Google Search

Curently I dont have any other gamepad to try.

It seems that moving the camera through my joystick constant sends the camera CGI commands to move or zoom without stop command.

While the camera is in this condition, the camera does not respond to any other command until I press the left or right key on the keyboard.

All four of my Dahua cameras behave the same way with my joystick.
 

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
Here are a few suggestions for additional features :)

(1) mute camera audio stream
Most of the time I do not want to hear the sound of the video, but I don't want to turn off the sound of the whole system.

(2) in menu "Presets" somehow group camera preset
On 25X camera I have over 60 presets, so I must scrool up and down to show first four or last four.

(3) use numeric keypad to zoom and go to presets
plus and minus ---> zoom in out
1 - 0 for presets 1 to 10
numpad * or numpad ENTER and then two numbers for presets 11 to 99

(4) enter preset after pressing key P
- press P then type preset number and press ENTER to go to that preset


Thank you.
 
Last edited:

42er

Getting the hang of it
Joined
Oct 2, 2018
Messages
99
Reaction score
40
Location
Germany, Frankfurt/Main Area
On my wishlist is next:

"IR close" and "IR far", each with an "on/off" option

Focus "+" "-" (like zoom)

Hope, thats possible :)
 
Last edited:

wrybread

Pulling my weight
Joined
Sep 12, 2018
Messages
249
Reaction score
115
Location
San Francisco
I just posted a new version with some volume control:

Code:
[camera6]

# optional initial camera volume, from 0 to 100
camera_volume = 0

# can also make buttons to control volume
button13 = voldown
button14 = volup
button15 = mute
It seems that moving the camera through my joystick constant sends the camera CGI commands to move or zoom without stop command.
I wonder if the joystick needs calibration? You can try this if so.

FYI the way commands are sent to the camera is that there's a "start pan" action (which happens when the joystick is first moved) then a "stop pan" action (when the joystick axis or button is released). It sounds like it might be continually sending the start action? In other words it's never reaching that stop state? I can't reproduce with my joystick, which makes me wonder about the calibration.

Does anyone else have a joystick they can test with?

(2) in menu "Presets" somehow group camera preset
I just tried automatically adding a separator every 10 presets but it looked cluttered, and probably doesn't help with organization anyway. Can you think of a way to group them that would work here?

(4) enter preset after pressing key P
- press P then type preset number and press ENTER to go to that preset
Good idea.

On my wishlist is next: "IR close" and "IR far" with an "on/off" option
Do you know if that's possible? I don't have any experience with IR, I always use forced color mode. Looking through the Dahua API I'm not seeing anything about infrared settings, but I didn't look that closely. Let me know if you see something in the docs that might do that. You can also look at theAmcrest API, which seems to work with Dahua cameras (mine at least) and be more up to date. (And if anyone has a Dahua API that's more up to date, I'd love to see it.).
 
Last edited:

42er

Getting the hang of it
Joined
Oct 2, 2018
Messages
99
Reaction score
40
Location
Germany, Frankfurt/Main Area
Well, my biggest "which/problem" to Dahua is (and to all vendors, but we are talking here about Dahua), saving "all wanted settings" to a preset, and not the camera in global... I dont know, why this feature isn't in place, or requested by many people?

In the moment, you can edit IR close (near) and far like this (up to 100):

upload_2019-2-20_20-33-0.png

So I thought, it is maybe easier just to leave the setting as is and just turn on/off...
 

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
Volme control works great :)

The only problem with mapping keys is that these three keys can no longer be used to call preset.
Solution might be to control the sound just with keyboard. M for mute, CTRL + UP for volume up and CTRL + DOWN for volume down.
I think numbers from 1 to 100 are best used only for presets.

Calibrated joystick but that did not help...

For preset grouping...
After you see how many preset are defined in camera, show first 30 presets and then submenu for every other 30 presets.

Presets
================
Random preset [R]
----------------------
Preset 1
Preset 2
...
Preset 30
----------------------
Presets 31 - 60
----------------------
Presets 61 - 90
 
Last edited:

wrybread

Pulling my weight
Joined
Sep 12, 2018
Messages
249
Reaction score
115
Location
San Francisco
CTRL + UP for volume up and CTRL + DOWN for volume down.
I'm planning to make control-up/down swap cameras so I just made it so shift-control-up/down controls volume. I just uploaded the new version but didn't bother updating the webpage text yet.
 

wrybread

Pulling my weight
Joined
Sep 12, 2018
Messages
249
Reaction score
115
Location
San Francisco
I think I found the issue with the joystick, should be fixed in the new version.

It will also now remember individual camera volume when switching through cameras, and control up/down arrow cycles through cameras.

Edited to add: and as of version .89942 you can look at the bottom of the log window (File -> Show Log) to see which joystick axis is detected as active. So if the joystick is still sticking, let me know what it says there.
 
Last edited:

msantic

Young grasshopper
Joined
Apr 11, 2014
Messages
44
Reaction score
9
Location
Croatia
v0.89942

Excellent! Joystick now works :)

Only now at the right stick is replaced the zoom and focus function.
Moving the right stick up or down changes the focus, while moving right or left changes zoom.
 

wrybread

Pulling my weight
Joined
Sep 12, 2018
Messages
249
Reaction score
115
Location
San Francisco
Good to hear!

I just uploaded version v0.8995, which lets you assign whatever action you want to each stick:

gizmoware.net/easyptz

There's a lot of other improvements to joystick functionality as well, like diagonals and proportional panning speed (the camera will pan faster as you press the joystick farther).

See the "[joystick1]" section in the config file here for notes on adding the joystick section to your config file, or just reset your configs when installing (check the box labelled "reset all configurations") and build out your config again. If the "[joystick1]" section is missing it'll just use defaults, which hopefully work fine too.

The defaults are built to work well with my old thriftshop Flight Sim style joystick, I'll have a gamepad to test with tomorrow. It *should* work with multiple joysticks too, but that's also as yet untested. Feedback definitely invited.

And I added submenus to the Presets list when there's more than 30 presets, let me know how that works for you. I only have 40 presets so I can't get a good sense of how it works with very large lists.
 
Last edited:
Top