CCTV password authenication

Discussion in 'C-Bus Automation Controllers' started by Hollywoodperth, Aug 2, 2019.

  1. Hollywoodperth

    Hollywoodperth

    Joined:
    Sep 9, 2018
    Messages:
    38
    Likes Received:
    0
    I'm running a SHAC and a Hikvision CCTV.

    I've got the URL address to update the jpeg from the Hikvision but unless my browser is logged into the camera in another tab the SHAC visualisation just shows a broken image link as the authenication/password doesn't work.

    How does every one get around this?
     
    Hollywoodperth, Aug 2, 2019
    #1
  2. Hollywoodperth

    Hollywoodperth

    Joined:
    Sep 9, 2018
    Messages:
    38
    Likes Received:
    0
    Hollywoodperth, Aug 3, 2019
    #2
  3. Hollywoodperth

    Nobes

    Joined:
    Oct 7, 2004
    Messages:
    164
    Likes Received:
    1
    Location:
    Hobart
    I've got the same problem with a different brand of camera (albeit same hardware, different firmware). Anyone have any success?
    I'm trying the http feed, but same issue as hollywoodperth.
    I'm presuming most cameras are going to want a login.
     
    Nobes, Aug 15, 2019
    #3
  4. Hollywoodperth

    Hollywoodperth

    Joined:
    Sep 9, 2018
    Messages:
    38
    Likes Received:
    0
    Hollywoodperth, Aug 17, 2019
    #4
  5. Hollywoodperth

    Hollywoodperth

    Joined:
    Sep 9, 2018
    Messages:
    38
    Likes Received:
    0
    I've had some success on this.

    Step 1: Create a new user on the hikvision camera that isn't "admin". In my case I used user=remote, password=Remote99 (dumb secure password rules)

    Step 2: Use the following URL
    http://ip-address/streaming/channels/1/picture/?auth=cmVtb3RlOlJlbW90ZTk5

    Where auth="user:password" encoded in Base64. The above is "remote:Remote99" in Base64.

    You can easily find a Base64 translator online. Works perfectly in chrome on my laptop.

    Here's the problem - it doesn't work on the Schneider touch screen panel 5000ETP10WB. Does anyone have any information on what the embedded browser is on this and what will work?
     
    Hollywoodperth, Oct 11, 2019
    #5
  6. Hollywoodperth

    RichieP

    Joined:
    May 21, 2018
    Messages:
    7
    Likes Received:
    0
    Hi im trying to connect Dahua 6MP cameras to the Shac through an ipad, All cameras are on the same network as the Shac through a POE switch, should be able to get it to work but no image on the Visualisation page, i think it maybe a password issue. anyone have any suggestions would be gratly appriciated, spent weeks making the visulization look good now just stuck on the cameras. want to display live feed not a jpeg.
    Thanks
     
    RichieP, Aug 14, 2020
    #6
  7. Hollywoodperth

    Hollywoodperth

    Joined:
    Sep 9, 2018
    Messages:
    38
    Likes Received:
    0
    Richie, it's the same password issue.
     
    Hollywoodperth, Aug 14, 2020
    #7
  8. Hollywoodperth

    RichieP

    Joined:
    May 21, 2018
    Messages:
    7
    Likes Received:
    0
    Hi Hollywoodperth or anyone,

    i don't suppose you could give me a bit more help, i created a new user user:user1234.
    is the path in previous posts for hikvision cameras http://ip-address/streaming/channels/1/picture/?auth=cmVtb3RlOlJlbW90ZTk5

    i tried various paths http://ip-address/?auth=user:user1234 and tried converting that into base 64.
    how would i find the path for the dahua cameras ie the /streaming/channels/1/picture/ part of the path for my camera.

    Any help would be greatly appreciated. only trying to get them to work on shac, should be easy but i'm struggling.

    Got everything else working on the shac just the camera are keeping me from finishing the project.
     
    RichieP, Aug 24, 2020
    #8
  9. Hollywoodperth

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    chromus, Aug 25, 2020
    #9
  10. Hollywoodperth

    Ben7777

    Joined:
    Apr 13, 2020
    Messages:
    1
    Likes Received:
    0
    HI did you have any luck with this? I have Dahua camera's too. I can get the link to stream via VLC but not through the SHAC
     
    Ben7777, Sep 21, 2020
    #10
  11. Hollywoodperth

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    248
    Likes Received:
    31
    Location:
    New Zealand
    Streaming video in web page is complex and problematic this is because most modern browsers for security reasons don’t allow credentials user/pass to be included in the URL Like
    User:password@ipaddress/streaming/etc
    Anymore

    But there are a couple of ways I know work
    if ip cam has mjpeg secoundary stream
    If ip cam has a static image URL you can get that and refresh every 1 sec it won’t be stream as such.
    Or you can pass the credentials in the URL as base 64 encoded as some have done above in this thread, but this would be hardware/brand specific

    @ Ben7777
    Rtsp can’t be displayed in the shac as rtsp in most cases requires The h.264 or higher codec
    Vlc can decode it that is why the stream works on it But the web page can’t decipher it.

    The limitations here is the Web browser, you may be able to install some plugins, but you would need to install them on every client.
    Have a look at https://m.habr.com/en/company/flashphoner/blog/479008/
    there are some services Like https://rtsp.me/
    that are available to proxy the rtsp stream and serve it up as mjpeg or other format but there is a cost associated etc
     
    Pie Boy, Sep 21, 2020
    #11
  12. Hollywoodperth

    infin8

    Joined:
    May 1, 2005
    Messages:
    22
    Likes Received:
    0
    Did you ever get the dahua to work?
     
    infin8, Feb 9, 2023
    #12
  13. Hollywoodperth

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    I’ve had success getting a snapshot to work with auto auth.

    I created a lua script on the NAC to act as a reverse proxy and then set the iframe url to the proxy ip and port.

    The reverse proxy sends the request to the NVR and set’s the auth headers on each request, then reply’s back to the iframe with the image.
    I’ve tried it on a hikvision NVR with basic auth and with a Dahua NVR with digest auth.

    Unfortunately I haven’t had any success with the MJPEG streams. The NAC doesn’t seem to enough grunt to proxy the continuous MJPEG stream and I haven’t yet found a solution that can just proxy the auth and have the stream handled between the NVR and iframe directly thereafter. If I put the MJPEG stream as the source in the iframe I get the login prompt, which does display correctly after entering the credentials, but yeah, it’s a nuisance to have to enter it each time.

    Curious if this can be done with JavaScript and event listeners to fill the auth?

    Im going to try hosting the reverse proxy on an Rpi and see if that gives better results.
     
    Diggerz, Aug 2, 2023
    #13
  14. Hollywoodperth

    Ks04

    Joined:
    Dec 28, 2019
    Messages:
    107
    Likes Received:
    9
    Did you ever try this? I'm wondering if I do a digest auth using JS on pageload if that might be a workaround - not sure.

    What are you using as a reverse proxy on pi?
     
    Ks04, Aug 20, 2023
    #14
  15. Hollywoodperth

    Diggerz

    Joined:
    Jan 24, 2017
    Messages:
    43
    Likes Received:
    7
    Location:
    Australia, Melbourne
    It took me a few weekends of trial and error, but i got there.
    On the pi i used node.js with express to create the proxy and a webserver, and used the request module to have the proxy send the auth. Using the request module, there's no need to encode the auth as basic or digest.

    Now im trying to get some custom css working to scale the MJPEG stream to fit whatever size the iframe is.
     
    Diggerz, Aug 20, 2023
    #15
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.