How to view Dahua cameras without browser plugins

Discussion in 'Dahua' started by tangent, May 18, 2018.

Share This Page

  1. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    It's 2018 and browser plugins are going the way of the dodo so how can I view/setup my cameras?

    Browser plug-ins are generally awfully coded monstrosities full of security vulnerabilities, so it's a good thing most browsers are dropping support. If you keep a browser with plug-in support, I suggest only using it for your cameras or only allowing plugins to run on the pages for your cameras. At this point browser plugins and native apps like SmartPSS still provide the best experience.

    Some high end Dahua PTZs just got a flash based web interface via firmware update (8/2018). While more browsers will support this, flash has as many problems as their own plugins and Adobe plans to kill flash completely in 2020.

    Some recent threads discussing this in more detail:
    Dahua camera web interface - OS support, plugins in 2018
    Safari plugin for Dahua IPCs.
    Dahua Web plugin has stopped working in Firefox


    View your cameras on windows using:
    • Internet Explorer 11
    • Pale Moon 32-bit (you need 32-bit because the plugins are 32-bit)
    • Other browsers you've never heard of like Basilisk (pale moon fork) and Midori that still support plugins
    • Use The chrome NACL Web Plug-in chrome app
      • Google plans to kill these native client chrome apps too, but there might be a fork of chromium that maintains support... time will tell.
      • How do I use this?
      • Go to chrome://apps
      • Click NACL Web Plug-in
      • A new window will appear that looks a little different, load your camera / nvr's webpage
      • It's generally a bit awful and prone to memory leaks but it's easier than WINE.
      • upload_2018-5-18_20-35-28.png
    • SmartPSS
    But I use linux (I haven't tested these):
    • On linux, your best option that doesn't require a VM or WINE is to use Google Chrome and the NACL Web Plug-in chrome app (see windows section). I think this works in linux, but haven't tested it.
    • Open the video stream in VLC or similar software
    • Use VMS software that works in linux like veyesys | Video Management Platform

    I use a mac, I think different:
    • It's official, Safari 12 is out and has dropped plugin support.
    • Safari 11 still supports browser plugins, but you may have to whitelist the plugin.
      • On a mac plugins are generally stored in ~/Library/Internet Plugins or /Library/Internet Plugins to find these folders you'll need to use the Go menu or hit command-shift-g
      • Safari is supposed to drop plugin support this year
      • Your cameras must be set to use H.264 codecs not H.265, smart codec must be off
    • Firefox ESR 52 can be made to work. oddly, yes the 64 bit version works
      • You might have to change a setting in about:config
      • I recommend you rename the Firefox ESR app so you can tell it apart from the regular version, renaming it Firefox ESR.app instead of Firefox.app would be a good choice. This way you can still use the current version of firefox if you want, but probably not at the same time without some extra effort.
    • the chrome NACL plugin app works (see windows section above)
    • Use Smart PSS

    Troubleshooting Plug-in Issues

    Start by going to
    Code:
    about:plugins
    this will make most browsers show information about plugins that are installed.
    here's the dahua plugin in palemoon:
    upload_2018-5-24_22-25-44.png
    Different devices (cameras / nvrs) and different firmware versions often require different versions of the plugins. This can get pretty messy.
    Always try simple things like quitting and reopening the browser or rebooting your computer.


    BUT I WANT SOMETHING THAT DOESN'T REQUIRE A PLUGIN AT ALL!

    Well, you can use Dahua's Smart PSS software. I works pretty well but does have a few bugs.
    you can get it for Mac OS X and Windows here: Dahua Wiki

    Some VMS software you can use to record your cameras can re-stream or transcode the stream to a format like HLS which modern web browsers support. Blue Iris can do this using the UI3 webserver. There are even some open source vms that can do this.
    HLS typically adds about a 1 second delay.

    You can also view the video stream using software like VLC or TinyCam (android) that can view the RTSP stream.
    The stream address is formatted like this:
    Code:
    http://192.168.1.108/cgi-bin/realmonitor.cgi?action=getStream&channel=1&subtype=0
    Substitute your camera's ip address
    Change the channel number to view other cameras on an NVR
    Change the subtype to switch between substreams.  0 = main, 1 = sub stream 1, 2 = sub stream 2.
    
    You can add user:password@ to the beginning of the stream URL right after http:// if desired
    NOTE: Newer firmware default to using digest authentication which may not be compatible with some software.
    Your camera may have the option to change the type of authentication used for the rtsp stream.
    
    More information can be found in the HTTP API Documentation

    To view a camera in VLC choose "Open Network Stream" in the media menu. Then enter your stream URL. If VLC gives you any trouble click "show more options" and set caching to something like 200-500 ms which will add a slight delay to the video but will fix most issues.
    upload_2018-5-18_18-0-48.png


    BUT I WANT SOMETHING DIFFERENT!

    Well, the good news is Dahua appears to be working on HLS video support.
    The bad news is it will probably be a while and will likely find its way to new products first if it makes it to the old ones at all.

    upload_2018-5-18_21-8-18.png


    But I want a way to quickly view my camera in a browser that doesn't support plugins anymore!

    Good news, there's an easy way to do this too using a bookmarklet. I wrote two simple bookmarklets that provide a simple fallback you can use if your browser doesn't support plugins. They are very simple, one displays a snapshot that reloads if you click it and the other displays an mjpg feed.

    Limitations:
    • You can't define IVS or motion detection rules
    • No audio
    • No playback of recordings, live view only
    • Can't easily display multiple cameras (not very useful on NVRs)
    • Browser snapshot and record buttons don't work
    • Can't make the mjpeg or snapshot full screen at this point
    • Lower quality than using SmartPSS or VLC
    • Lots of other things I forgot to mention.

    What's a bookmarlet? Bookmarlets are bookmarks that contain javascript instead of a link to a web page and modify the current page. They can be extremely useful. You can use them to do things like apply a dark theme to a website, reformat a website for easier printing, autofill a TPS report, generate a random password, or in this case display your cameras without plug-ins.

    To create a bookmarlet, make a new bookmark then edit the location and name of the bookmarlet. In chrome, copy the java script code, right click on your bookmark bar and choose add page. Then edit the name, keep it short, paste in the code from one of the code blocks below and save.
    upload_2018-5-18_18-15-9.png

    MJPG Bookmarlet:
    Enable substream 2 and set it to mjpg 720p in order to use this. The video quality of MJPEG isn't as good as the normal RTSP stream.
    Code:
    javascript:(document.getElementById("video").style.background = "url('cgi-bin/mjpg/video.cgi?channel=1&subtype=2') 50% 50% / contain no-repeat rgb(0, 0, 0)")();
    Didn't work? You have to enable substream 2 and set it to mjpeg as directed. Not all cameras support 2 substreams and some only support mjpg at lower resolution (which still works, it just looks worse). Modify the code if required (eg. change subtype=2 to subtype=1 and you'll get substream 1).

    Snapshot Bookmarlet:
    Display a snapshot using this code, click the image to reload the snapshot. This one's a little uglier to read as it contains % encoded characters
    Code:
    javascript:(function()%7Bvar vidDiv %3D document.getElementById("video")%3B function loadSnapshot()%7B%09vidDiv.style.background %3D "url('cgi-bin%2Fsnapshot.cgi%3F" %2B new Date().getTime() %2B "') 50%25 50%25 %2F contain no-repeat rgb(0%2C 0%2C 0)"%3B%7D loadSnapshot()%3B vidDiv.addEventListener("click"%2CloadSnapshot)%7D)()

    Dahua should really implement something like this when plugins fail to load. These bookmarklets are pretty simple but might need some modification for your specific use case. You could also convert this to a userscript to make it run automatically.

    How do I use the bookmarlet after I've created it?
    Simply load the camera's page then click the bookmarklet. The snapshot one adds a cache busting timestamp to the url and reloads the snapshot when you click the image.

    Code:
    //Snapshot version without % encoding (won't work without encoding) for easier reading
    var vidDiv = document.getElementById("video");
    function loadSnapshot(){
        vidDiv.style.background = "url('cgi-bin/snapshot.cgi?" + new Date().getTime() + "') 50% 50 / contain no-repeat rgb(0, 0, 0)";
    }
    loadSnapshot();
    vidDiv.addEventListener("click",loadSnapshot);
    
    
    // % encoded version of the mjpeg one in case your browser can't handle the non-encoded version
    javascript:(function()%7Bjavascript%3A(document.getElementById(%22video%22).style.background%20%3D%20%22url('cgi-bin%2Fmjpg%2Fvideo.cgi%3Fchannel%3D1%26subtype%3D2')%2050%25%2050%25%20%2F%20contain%20no-repeat%20rgb(0%2C%200%2C%200)%22)()%7D)()
    
    hikvision
     
    Last edited: Sep 23, 2018
  2. Engee

    Engee Young grasshopper

    Joined:
    Feb 22, 2018
    Messages:
    61
    Likes Received:
    7
    ive tried to use chrome on my mac, and the easy viewer exrension installed. looks the same as your nacl plugin.
     
    Francisco73 likes this.
  3. Francisco73

    Francisco73 Getting the hang of it

    Joined:
    Jul 7, 2018
    Messages:
    196
    Likes Received:
    22
    Location:
    Nomad
    On linux, your best option that doesn't require a VM or WINE is to use Google Chrome and the NACL Web Plug-in chrome app

    I have tried to use Chrome and Slimjet. Cannot find NACL or IE tab plugin. Easy View app can be installed but does not work. Have Mint 64 bit latest version.
     
    mat200 likes this.
  4. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    I haven't actually tried to use the NACL web plugin in linux. I suggested to someone in another thread and I believe they got it to work.
     
    Francisco73 likes this.
  5. Francisco73

    Francisco73 Getting the hang of it

    Joined:
    Jul 7, 2018
    Messages:
    196
    Likes Received:
    22
    Location:
    Nomad
    I have some questions about the "messy plug ins". Does each camera require a plug in of its own or one plug in is enough for each camera model? Some days ago I tried to install plug ins in IE for four Dahua 4431s and one Dahua Starlight. Was not asked to install five plug ins but maybe three of them. Anyway the install attempt was unsuccessful since the plug ins were rejected for security reasons. The 4431 of course has hacked firmware. Does a safe plug in for this model exist or is it totally unknown territory? Thanks.
     
  6. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    Different cameras and nvrs can require different plugins. If you can update cameras such that the "WEB Version" displayed on the info page of the cameras/nvrs is the same you can generally reduce this mess.
     
  7. adamg

    adamg Young grasshopper

    Joined:
    Sep 19, 2017
    Messages:
    70
    Likes Received:
    16
    The most fun is, even if using something plugin-friendly like Win7 and IE11, it seems that:
    a) every Dahua camera and every firmware version on that camera uses a different version of the plugin;
    b) some Dahua camera-versions conflict with other Dahua camera-versions, so if you want to view one, then the other, you have to install each camera's plugin every time you view it, and you can't view them at the same time
     
    Francisco73 likes this.
  8. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    Yep the plugins suck. If you can keep all your cameras on firmware the has the same "WEB Version" as shown on the info page you can generally make things work alright. I dug into the Mac OS X plugin a while ago and found a bunch of typos that were causing plugin detection issues.

    I haven't taken the time to mess with it, but I've thought about playing around in js to see if I could expand plugin version compatibility.
     
    Francisco73 likes this.
  9. Francisco73

    Francisco73 Getting the hang of it

    Joined:
    Jul 7, 2018
    Messages:
    196
    Likes Received:
    22
    Location:
    Nomad
    Thank you for your reply. I have not spent much time on this and even less with a Windows PC since I do not have one. I have several old PCs with Linux and they are not "fit" for Wine, Virtual Box or Windows. The best advice so far has been to arrange a modern Windows machine and install PSS or Blue Iris.

    I think that upgrading firmware in my case is difficult and may brick my hacked cameras and/or the NVR.

    For what it is worth: some things that the NVR does not have like adjusting camera settings can be achieved with latest 64 bit Linux Mint based Firefox. Chrome, Slimjet and Opera with Mint and my two attempts with borrowed IE did not get me that far. IE with Wine crashed and Virtual Box did not install due to a dependency problem.

    The more I mess with this the less the new Starlights co-operate.

    What is "js"?
     
  10. Francisco73

    Francisco73 Getting the hang of it

    Joined:
    Jul 7, 2018
    Messages:
    196
    Likes Received:
    22
    Location:
    Nomad
    Can these problems be avoided by using PSS or BI? Any idea?
     
  11. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    javascript, i was just pondering if some of the plugin incompatibility issues between plugin versions could be smoothed out client side using javascript (inevitably breaking some functions).
     
  12. Francisco73

    Francisco73 Getting the hang of it

    Joined:
    Jul 7, 2018
    Messages:
    196
    Likes Received:
    22
    Location:
    Nomad
    Everything is possible with time, money and reasonable IQ. Have you any experience of stuff that works with Linux like Kerberos and Xeon? I have understood that Zoneminder can be challenging.
     
  13. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    There are better linux options than zoneminder. I know my way around linux, but haven't used a linux desktop regularly in a while.

    A Xeon CPU generally isn't the first choice for video recording. Hardware graphics acceleration generally isn't available, but not all software supports that. Generally a Xeon to record security cams will just waste electricity compared to other options. If you do set up a pc to record your cameras, don't build, buy a cheap refurbished 6th, or 7th gen i5 or i7.

    This is a good list of lots of different VMS: Free VMS Software Directory
     
    fenderman likes this.
  14. Francisco73

    Francisco73 Getting the hang of it

    Joined:
    Jul 7, 2018
    Messages:
    196
    Likes Received:
    22
    Location:
    Nomad
    Thanks. I found yesterday a list of 6 Linux based options but in my usual way did not save the link. There was one for older PCs with only 1 gb ram. If I had a way to power one camera without the NVR I would try. I also found that you have in another thread posted links to learn about IP basics. Do you have that information easily available? If not I can search for it again and yes I should finally start to keep better records of what I find.
     
  15. 105437

    105437 Getting the hang of it

    Joined:
    Jun 8, 2015
    Messages:
    565
    Likes Received:
    72
    I'm trying to use the ESR version of Firefox on my Mac to login to my Dahua cameras and adjust things. How do I get the webplugin working so I can see lice previews while logged into the camera? Thanks!
     
  16. TonyR

    TonyR Known around here

    Joined:
    Jul 15, 2014
    Messages:
    2,262
    Likes Received:
    1,844
    Location:
    Alabama
    I suggest you instead try the 32 bit version of Palemoon, here.
     
  17. 105437

    105437 Getting the hang of it

    Joined:
    Jun 8, 2015
    Messages:
    565
    Likes Received:
    72
    Looking for something to run on my Mac. Looks like Pale Moon is PC or Linux. Thanks for the reply.
     
  18. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    Your best options are (as explained at the start of the thread):
    • Record your cameras using a pc running vms software that has a webserver that uses hls or webrtc and will display on any modern device
    • Use Firefox 52 ESR and the dahua plugin (this may be difficult in Mojave).
      • Code:
        about:plugins
        is the place to start your troubleshooting
    • Use the Chrome app
     
    105437 likes this.
  19. 105437

    105437 Getting the hang of it

    Joined:
    Jun 8, 2015
    Messages:
    565
    Likes Received:
    72
    Thanks @tangent. I can view the cams via the webserver on BI. What I'd like to do is be able to log into the camera UI from the Mac and see the image previews etc.
     
  20. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    Well for that purpose, I'd recommend you use Blue Iris instead when you want to view the cameras. You can set up a more restricted user in blue iris for camera viewing if you want.
    When you want to view the camera web pages directly to adjust image settings, use the bookmarklets I posted above or open another browser window with the BI web server.
     
    105437 likes this.
  21. tangent

    tangent Known around here

    Joined:
    May 12, 2016
    Messages:
    3,045
    Likes Received:
    1,751
    105437 likes this.
  22. 105437

    105437 Getting the hang of it

    Joined:
    Jun 8, 2015
    Messages:
    565
    Likes Received:
    72
  23. TonyR

    TonyR Known around here

    Joined:
    Jul 15, 2014
    Messages:
    2,262
    Likes Received:
    1,844
    Location:
    Alabama
    Yep, I flew right over "Mac"....sorry!:facepalm:
     
  24. 105437

    105437 Getting the hang of it

    Joined:
    Jun 8, 2015
    Messages:
    565
    Likes Received:
    72
    No worries, thanks @TonyR!