Any one know how can i add NVR IP camera Dahua

I’m having the exact same issue with Home Assistant 0.44.2.

Here’s my config:

camera:
  - platform: generic
    name: Backyard
    still_image_url: http://xxx:[email protected]/cgi-bin/snapshot.cgi?loginuse=xxx&loginpas=xxx

I can copy paste that URL into my browser and load the image just fine. I have a Dahua IPC-HDW4431C-A.

what happens if you wget that url from a shell on your HA instance?
wget <url>

runraid nice to see this is not only me.

quadmasta - just wget http://xxx:[email protected]/cgi-bin/snapshot.cgi? via SSH?

Update to Hassbian, still same issue…

quadmasta on ssh work

pi@hassbian:~ $ wget http://admin:[email protected]/cgi-bin/snapshot.cgi?
–2017-05-13 11:20:50-- http://admin:password@192.168.31.13/cgi-bin/snapshot.cgi?
Connecting to 192.168.31.13:80… connected.
HTTP request sent, awaiting response… 401 Unauthorized
Connecting to 192.168.31.13:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 599271 (585K) [image/jpeg]
Saving to: ‘snapshot.cgi?’

snapshot.cgi? 100%[=====================>] 585.23K --.-KB/s in 0.06s

2017-05-13 11:20:51 (9.04 MB/s) - ‘snapshot.cgi?’ saved [599271/599271]

Any one :frowning: or just me.

Here’s my output of trying to wget, which worked fine and it was from within the container…

Notice it gave an initial 401.

docker exec -ti home-assistant /bin/bash
root@Tower:/tmp/f# wget http://username:[email protected]/cgi-bin/snapshot.cgi?loginuse=username&loginpas=password
[1] 4501
root@Tower:/tmp/f# --2017-05-15 22:40:14--  http://username:*password*@192.168.1.201/cgi-bin/snapshot.cgi?loginuse=username
Connecting to 192.168.1.201:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to 192.168.1.201:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 294777 (288K) [image/jpeg]
Saving to: ‘snapshot.cgi?loginuse=username’
snapshot.cgi?loginuse=username’                                   100%[=========================>] 287.87K  --.-KB/s   in 0.03s
2017-05-15 22:40:20 (9.58 MB/s) - ‘snapshot.cgi?loginuse=username’ saved [294777/294777]
[1]+  Done                    wget http://username:[email protected]/cgi-bin/snapshot.cgi?loginuse=username

as i read that can work only with NVR

I’m going to try to proxy it through nginx and let nginx handle the auth to see how that goes…

After a week, google and google and google that work for me!!!

Install l ffmpeg, how not one know it here :slight_smile:

Best Thanks for all try to help!

Could you write down the steps for future reference?

I have ffmpeg installed yet it still won’t load the image.

# ffmpeg -version
ffmpeg version 3.2.4-1~bpo8+1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.9.2 (Debian 4.9.2-10)
configuration: --prefix=/usr --extra-version='1~bpo8+1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --disable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil      55. 34.101 / 55. 34.101
libavcodec     57. 64.101 / 57. 64.101
libavformat    57. 56.101 / 57. 56.101
libavdevice    57.  1.100 / 57.  1.100
libavfilter     6. 65.100 /  6. 65.100
libavresample   3.  1.  0 /  3.  1.  0
libswscale      4.  2.100 /  4.  2.100
libswresample   2.  3.100 /  2.  3.100
libpostproc    54.  1.100 / 54.  1.100

What your config? add it here.

I run Dahui camera and I use the following

camera:
  - platform: ffmpeg
    input: rtsp://admin:admin@IPOFCAMERA:554/cam/realmonitor?channel=1&subtype=0
    name: Front
2 Likes

1.add ffmpeg to configuration.yaml file

ffmpeg:
  ffmpeg_bin: /usr/bin/avconv

This is my location with hassbian , you need to find what is your location .(/usr/bin/avconv) my be same

Then the command

camera:
  - platform: ffmpeg
    input: rtsp://admin:admin@IPOFCAMERA:554/cam/realmonitor?channel=1&subtype=0
    name: Front
1 Like

Just to add, your Dahui camera should support RTSP but you can check the port in Setup --Connection – RTSP Port under the camera web gui

so it work for you now?

It’s not working for me, but I believe I know why.

My dahua camera are using “digest authentication”, not “basic authentication”. I suspect the python library isn’t handling digest authentication hence the reason I’m seeing failures.

what your model?

IPC-HDW4431C-A 3.6mm -

Dahua IP Camera IPC-HDW4431C-A 3.6mm 4MP Full HD IR Mini Dome PoE Network Camera IP67 Built-in Mic https://www.amazon.com/gp/product/B01MDMMKXC

I got it to work. I needed to specify the authentication type as digest. Here’s my working config.

camera:
  - platform: generic
    name: Backyard
    authentication: digest
    username: my_username
    password: my_password
    still_image_url: http://192.168.1.201/cgi-bin/snapshot.cgi
1 Like