EasyPTZ: a new simple camera viewer for Windows

Discussion in 'Dahua' started by wrybread, Oct 9, 2018.

Share This Page

  1. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    9
    Location:
    Croatia
  2. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    Location:
    San Francisco
    I just posted a new version that should be the exact same as curl.exe under the hood. I'm curious if it works with your camera if you have a minute to test:

    gizmoware.net/easyptz
     
  3. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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 =
     
  4. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    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
     
  5. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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...

     
  6. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    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: Feb 20, 2019
  7. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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 :))
     
  8. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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 :)
     
  9. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    Location:
    San Francisco
    msantic likes this.
  10. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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.
     
  11. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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: Feb 20, 2019
  12. 42er

    42er Young grasshopper

    Joined:
    Oct 2, 2018
    Messages:
    59
    Likes Received:
    10
    Location:
    Germany
    On my wishlist is next:

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

    Focus "+" "-" (like zoom)

    Hope, thats possible :)
     
    Last edited: Feb 20, 2019
  13. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    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
    
    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?

    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?

    Good idea.

    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: Feb 20, 2019
    msantic likes this.
  14. 42er

    42er Young grasshopper

    Joined:
    Oct 2, 2018
    Messages:
    59
    Likes Received:
    10
    Location:
    Germany
    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...
     
  15. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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: Feb 20, 2019
  16. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    Location:
    San Francisco
    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.
     
    msantic and 42er like this.
  17. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    9
    Location:
    Croatia
    Great, it works. Thank you :)
     
  18. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    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: Feb 21, 2019
    msantic likes this.
  19. msantic

    msantic Young grasshopper

    Joined:
    Apr 11, 2014
    Messages:
    44
    Likes Received:
    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.
     
  20. wrybread

    wrybread Getting the hang of it

    Joined:
    Sep 12, 2018
    Messages:
    120
    Likes Received:
    49
    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: Feb 22, 2019