hikvisione programmatically switch the mode between day and night.

NezarOd

n3wb
Joined
Feb 25, 2024
Messages
7
Reaction score
0
Location
UA
Good afternoon.
Help with C# code
You need to programmatically switch the mode between day and night.
According to the documentation, the byDayNightFilterType parameter is responsible for this

I try to do this - but the mode does not change ((
NET_DVR_DAYNIGHT dayNightConfig = new NET_DVR_DAYNIGHT();
dayNightConfig.byDayNightFilterType = 1; / Set night mode

Maybe something else needs to be added.
I'm not good at programming ((
Thank you!
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
I admire how you chose SDK over simple ISAPI request. If you camera have a web interface, just switch mode and catch/copy the requests.
 

NezarOd

n3wb
Joined
Feb 25, 2024
Messages
7
Reaction score
0
Location
UA
I not only need to switch modes, but also view the image from the camera in my application. Why do I need requests if I still use SDK
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
Because SDK will stop getting supports in future as i was made aware. They are shifting everything toward http communication.

With SDK you can pass ISAPI params as well, if you really don't want direct ISAPI solution.

Are you working on web application or desktop application?
 

NezarOd

n3wb
Joined
Feb 25, 2024
Messages
7
Reaction score
0
Location
UA
this is a desktop application for controlling the machine while viewing images from the camera
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
I still believe you should switch to using ISAPI considering its a lot easier as well. But as you wish :)

Here is sdk example for changing mode day/night/auto


Good luck.
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
Sorry, cant help you further, as i moved away from SDK while ago :/
Hopefully someone else will jump in to help you out.

Cheers.
 

NezarOd

n3wb
Joined
Feb 25, 2024
Messages
7
Reaction score
0
Location
UA
Tell me then how this can be done via ISAPI. or where you can see examples of working with it. I did not find such information (. Thanks
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
http://ip:port/ISAPI/Image/channels/1/ircutFilter
PUT request(Digest authorization) with payload for each mode bellow.


For DAY:


<?xml version:"1.0" encoding="UTF-8"?><IrcutFilter><IrcutFilterType>day</IrcutFilterType><nightToDayFilterLevel>4</nightToDayFilterLevel><nightToDayFilterTime>5</nightToDayFilterTime></IrcutFilter>

For NIGHT:


<?xml version:"1.0" encoding="UTF-8"?><IrcutFilter><IrcutFilterType>night</IrcutFilterType><nightToDayFilterLevel>4</nightToDayFilterLevel><nightToDayFilterTime>5</nightToDayFilterTime></IrcutFilter>

For AUTO:


<?xml version:"1.0" encoding="UTF-8"?><IrcutFilter><IrcutFilterType>auto</IrcutFilterType><nightToDayFilterLevel>4</nightToDayFilterLevel><nightToDayFilterTime>5</nightToDayFilterTime></IrcutFilter>
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
I dont use it in my project but i do have door open, but it is the same, just replace the payload

1709131874419.png

And then call the method whenever you want.
 

NezarOd

n3wb
Joined
Feb 25, 2024
Messages
7
Reaction score
0
Location
UA
what library are you using to display the video stream on the form? VLC?
Thank you. You are helping me a lot!
 

trempa92

Pulling my weight
Joined
Mar 26, 2020
Messages
736
Reaction score
230
Location
Croatia,Zagreb
what library are you using to display the video stream on the form? VLC?
Thank you. You are helping me a lot!
I dont need stream, so im not using anything. My app is webapi. Only thing i use is snapshots. But if i would use any it would most likely be PlayCtrl.dll from websdk.
 
Top