Dahua IP camera view in Dashticz

Dashticz, alternative dashboard based on HTML, CSS, jQuery

Moderators: leecollings, htilburgs, robgeerts

Post Reply
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Dahua IP camera view in Dashticz

Post by NilsNijenhuis »

Hello,

i bought a Dahua IP camera and am trying to get a view in dashticz.
I have found the camera in Domoticz.

but if i use the next code in dashticz it only gives me the picture view which refreshes once per seconde?
(and this picture refresh sometimes does not run smoothly)

and not the movie stream? what is the video stream in domoticz? can't find that anywhere?!

Code: Select all

blocks['cam1'] = {
 type: 'camera',
 imageUrl: 'http://192.168.2.11:8084/camsnapshot.jpg?idx=1',
 videoUrl: 'http://192.168.2.11:8084/camsnapshot.jpg?idx=1', 
 refresh: 1,
 width: 12,
 height: 300
}
i also found the http adres of the camera, is it possible tot use that snapshot en video URL in Dashticz?
i tested both URL's in my browser and they work! But they don't work in Dashticz???

Code: Select all

blocks['cam1'] = {
      type: 'camera',
      imageUrl: 'http://192.168.2.200/cgi-bin/snapshot.cgi?1&user=[USERNAME]&pwd=[PASSWORD]',
      videoUrl: 'http://192.168.2.200/cgi-bin/mjpg/video.cgi?channel=1&subtype=1&user=[USERNAME]&pwd=[PASSWORD]',
      refresh: 1,
      width: 12, 	 	
      height: 300
Attachments
domotics camera.JPG
domotics camera.JPG (48.12 KiB) Viewed 3389 times
Nefsolive
Posts: 69
Joined: Monday 04 September 2017 17:13
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by Nefsolive »

In the code you show, do not close with "};" and so, try like this ...

Code: Select all

blocks['cam1'] = {
      type: 'camera',
      cam1: [
      {
      imageUrl: 'http://192.168.2.200/cgi-bin/mjpg/video.cgi?channel=1&subtype=1&user=[USERNAME]&pwd=[PASSWORD]',
      videoUrl: 'http://192.168.2.200/cgi-bin/mjpg/video.cgi?channel=1&subtype=1&user=[USERNAME]&pwd=[PASSWORD]',
      },
      ],
      refresh: 1,
      width: 12, 	 	
      height: 300,
}; 
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Dahua IP camera view in Dashticz

Post by Chris12 »

I have 3 dahua camera's working fine with the following code:
Spoiler: show

Code: Select all

blocks['tuin_cam'] = {
   type: 'camera',
   imageUrl: 'http://192.168.1.11:8084/camsnapshot.jpg?idx=2',
   videoUrl: 'http://dashticz:[email protected]:8080/cgi-bin/mjpg/video.cgi?subtype=2',
   refresh: 30, //seconds
   width: 4,
   height: 150
}
I created a (live)view only user in all the dahua camera config itself, and enabled the substream video as well.
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by NilsNijenhuis »

Chris12 wrote: Monday 22 February 2021 19:14 I have 3 dahua camera's working fine with the following code:
Spoiler: show

Code: Select all

blocks['tuin_cam'] = {
   type: 'camera',
   imageUrl: 'http://192.168.1.11:8084/camsnapshot.jpg?idx=2',
   videoUrl: 'http://dashticz:[email protected]:8080/cgi-bin/mjpg/video.cgi?subtype=2',
   refresh: 30, //seconds
   width: 4,
   height: 150
}
I created a (live)view only user in all the dahua camera config itself, and enabled the substream video as well.
Do you use the snapshot from domoticz and the video stream from the dahua camera?
is there a reason why not to use the snapshot URL of the dashticz camera?

why do you use the :8080 port?
If i use your url i get an error : 'Deze site is niet bereikbaar" (http://usename:[email protected]:8 ... ?subtype=2)

if i use the next url in my browser i get the video substream (low resolution)
http://username:[email protected]/ ... &subtype=1

but if i use that code in dashticz i get an broke picture image on the front page and when i click on the image to open the video stream???

Code: Select all

blocks['cam1'] = {
      type: 'camera',
      imageUrl: 'http://admin:[email protected]/cgi-bin/snapshot.cgi?1',
      videoUrl: 'http://admin:[email protected]/cgi-bin/mjpg/video.cgi?channel=1&subtype=1',
      refresh: 1,
      width: 12, 	 	
      height: 150
}
Attachments
ipcamera.JPG
ipcamera.JPG (127.54 KiB) Viewed 3348 times
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Dahua IP camera view in Dashticz

Post by Chris12 »

@NilsNijenhuis,

The port number should match the port number configured in your camera.
The snapshot is from my NAS because of the number of connections to my camera's I have limited.
The substream can be configured in a higher resolution as well, maybe when lowering the mainsteam resolution and/or video codec. Also the substream number can be different, depending on your camera type.

Maybe try a different browser when the camera feed is always shown with the broken image, or make sure the number of allowed connections to your camara is sufficient.

Maybe this site is of any help as well:
https://www.ispyconnect.com/man.aspx?n=dahua
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by NilsNijenhuis »

* In my case port number 80 is the http port, do you use the HTTP port for the stream in dashticz?

* Is it also possible to use the snapshot url from the dahua camera in dashticz?

* Do you use the main stream for playback in dashticz? my substream is only a 704x506 stream and higher is not possible.

The code above that i used (first post) gives problems in dashticz, for example : switshing on the lights give a delay of more than 5 a 10 seconds before they turn on or off after i touch the scene in dashticz... so there must be something wrong in mij config part of the IP camera. :?
(after //excluding the camera part in the config its fast again...)
Attachments
poorten.JPG
poorten.JPG (33.42 KiB) Viewed 3321 times
camera instellingen.JPG
camera instellingen.JPG (65.66 KiB) Viewed 3321 times
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Dahua IP camera view in Dashticz

Post by Chris12 »

Hi,

The streams are all from the substream of the camera itself, in my case it has enough detail for showing on the wallmounted tablet.
The setting in the camera for the substream are MJPEG 720P (1280*720), and 704*576(D1)

The port I use is port 8080, that's HTTP.

Maybe the camera type and/or software version makes some different for the quality of the substream, and configuration.
I have camera type: IPC-HDBW4431R-AS and IPC-HDBW4631R-ZS and IPC-HDW4631C-A
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by NilsNijenhuis »

* Is it also possible to use the snapshot url from the dahua camera in dashticz?
how do i get the snapshot URL of the camera (IPC-HDBW2831R-ZAS-S2), can't vind it on the website https://www.ispyconnect.com/man.aspx?n=dahua

i can only find the RTSP stream on that website :?
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Dahua IP camera view in Dashticz

Post by Chris12 »

Hi, I guess you have to trail and error the jpg options shown there for other camera's.
The list is not complete for every camera model, so maybe you find a working one for your camera model.

Is the snapshot working in domoticz? then use that same url as confgured there.
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by NilsNijenhuis »

Can you send a print screen of your dahua camera settings in Domoticz?

2 weeks ago i had snapshot working in my Ds213, but because of the slow processor i upgraded it last weekend to a Ds220+ and lost the camera settings of the link for the snapshot. been trying a lot of different settings but can't get it working again :?
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Dahua IP camera view in Dashticz

Post by Chris12 »

In domoticz I have the following settings for all camera's:
-enabled: checked
-protocol: HTTP
-port: 8080
-ImageURL: cgi-bin/snapshot.cgi

"cgi-bin/snapshot.cgi?1" should also work (without the "")
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by NilsNijenhuis »

THANKS for the snapshot URL in Domoticz

i now use the next snapshot URL and i get a picture

Code: Select all

cgi-bin/snapshot.cgi?1 
i need to use

Code: Select all

forcerefresh=1
to force the picture stream not to freeze, only

Code: Select all

refresh: 1
doesn't work...

but the next problem is the video stream that doesn't work, the below link works in chrome but not in fully kiosk browser that i use on the wall mounted tablet...

Code: Select all

http://dashticz:[email protected]/cgi-bin/mjpg/video.cgi?channel=1&subtype=1
Do you use fully kiosk browser and how do you enter the usename en password in the url?
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Dahua IP camera view in Dashticz

Post by Chris12 »

It seems that the videoURL is not working properly anymore since the latest version(s?) on my side as well.

When I open the video feed by clicking on the snapshot (set to refresh every 30secs), the video Carousel pop-upopens showing me briefly all 3 camera feeds (1sec, and not the streaming video, after that a broken image icon is shown) in a row everytime. This might be a bug, or has something to do with the kioskbrowser.

@lokonli, has there been some code change which might caused that the videofeed is not properly working anymore when using the fully kiosbrowser?
It is still working with FF (latest beta), but noticed there that after 1 scroll of all the camera's the image is briefly shown broken and then shown for 2 seconds, then the next camera is shown without any issues. The next videofeeds are after that all working fine, and no broken image icons shown anymore.
Also noticed is when opening the video carousel, the first time it takes like 20-30secs before the scrolling videofeeds of all camera's is working, scrolling every 2/3 secs (is this a configurable setting?). is this some sort of a buffering?
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
Lokonli
Posts: 2290
Joined: Monday 29 August 2016 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by Lokonli »

Chris12 wrote: Thursday 04 March 2021 7:36 It seems that the videoURL is not working properly anymore since the latest version(s?) on my side as well.

When I open the video feed by clicking on the snapshot (set to refresh every 30secs), the video Carousel pop-upopens showing me briefly all 3 camera feeds (1sec, and not the streaming video, after that a broken image icon is shown) in a row everytime. This might be a bug, or has something to do with the kioskbrowser.

@lokonli, has there been some code change which might caused that the videofeed is not properly working anymore when using the fully kiosbrowser?
It is still working with FF (latest beta), but noticed there that after 1 scroll of all the camera's the image is briefly shown broken and then shown for 2 seconds, then the next camera is shown without any issues. The next videofeeds are after that all working fine, and no broken image icons shown anymore.
Also noticed is when opening the video carousel, the first time it takes like 20-30secs before the scrolling videofeeds of all camera's is working, scrolling every 2/3 secs (is this a configurable setting?). is this some sort of a buffering?
The last change was on January 25th (beta 3.7.3)

Could you test with v3.7.2-beta?

You can switch to this version with:

Code: Select all

git fetch
git checkout v3.7.2-beta
and after testing back to latest beta with:

Code: Select all

git checkout beta
Please check that git doesn't report any error.

(if you switch to master, or earlier beta versions, you will loose custom.css and custom.js, so backup those files first!)

I noticed that Chrome (and fully kiosk) became more strict in handling cross-origin network request. It could be related to that.

I did not create the camera module, so debugging will take more time, but I will try to do some tests this weekend.
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Dahua IP camera view in Dashticz

Post by Chris12 »

@Lokonli, I swicthed back to 3.7.2 (as I have install dashticz on my NAS, I can easily make that folder active again).
Checked the config part for the camera's which is the same.

Same behavior seen, even worse.. some camera doesn't even show an image.

So switched back tot 3.7.4 (not updated yet to 3.7.5), and in FF everything works as expected (so no waiting after first camera feed, no broken images) in Fully Kiosk browser it's still the same issue. The review at the bottom of the carousel shows the video pictures fine both in FF as in FK.
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
NilsNijenhuis
Posts: 81
Joined: Friday 10 July 2020 22:56
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Dahua IP camera view in Dashticz

Post by NilsNijenhuis »

@loki i really hope you can find the problem in de camera module.

I tested the snapshot URL and the Video URL in the fully kiosk browser (inc the username and password in the url) and they work fine.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest