hikvisione programmatically switch the mode between day and night.

NezarOd

n3wb
Feb 25, 2024
7
0
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!
 
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
 
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?
 
  • Like
Reactions: johnfitz
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.
 
Sorry, cant help you further, as i moved away from SDK while ago :/
Hopefully someone else will jump in to help you out.

Cheers.
 
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
 
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>
 
  • Like
Reactions: johnfitz
what library are you using to display the video stream on the form? VLC?
Thank you. You are helping me a lot!
 
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.