Jump to content
AMP

Hikvision Preset Names?

Recommended Posts

Anyone know if it is possible to rename Hikvision presets on the web interface so that it's not just "Preset 1", "Preset 2", etc and give them meaningful names? It seems like a no-brainer feature, I'm not quite sure why it doesn't seem to be included.

 

I don't see an official way through the web GUI, and I've SSHed into the camera and looked all over the place in the code in /home/doc/ for where it might be grabbing the presets so I could possibly manually modify the names. I saw references to "presetname" in ptz.css, ptz_preview.css, ptzCfg.js, and preview.js

 

I see it is possible to change the names in the iVMS client, but it doesn't save it to the camera. It only stays with the client. If anyone has any ideas on if this is possible or tips of where else to look, it would be greatly appreciated.

 

In ptzCfg.js it looks like it is grabbing them from an xml file "PTZPresetlist" file or something from http://hostname/ISAPI/PTZCtrl/channels/1/presets

 

var szURL = m_lHttp + m_szHostName + ":" + m_lHttpPort + "/ISAPI/PTZCtrl/channels/1/presets";
$.ajax({
	type: "GET",
	url: szURL,
	success: function (xmlDoc, textStatus, xhr) {
		var oPresets = $(xmlDoc).find("PTZPreset");
		oPresets.each(function () {
			var iId = parseInt($(this).find("id").eq(0).text(), 10);
			var szName = $(this).find("presetName").eq(0).text();
			var objStringTest = window.parent.$("#dvStringLenTest");
			var oPresetDiv = $("#PresetArea").children("div").eq(iId - 1);
			objStringTest.html(szName);  //用这个来检测字符串的宽度
			oPresetDiv.children("span").eq(0).html(szName.replace(/\s/g, " ")).attr("title", objStringTest.width() <= 125 ? "" : szName);
			oPresetDiv.removeClass("presetunset");
		});

 

It looks like the file /davinci/ipc_db is where the settings of the camera are written to. I found DB Browser for SQLite http://sourceforge.net/projects/sqlitebrowser/ that lets me check out that database. Lots of good stuff in there, that's the mother lode of the settings of the camera.

Edited by Guest

Share this post


Link to post
Share on other sites

That would be great except then there would be the problem of the web interface recognising the presets and they would become useless on a standard controller.

Share this post


Link to post
Share on other sites

I'm not sure if that would be a problem if it was coded correctly. The underlying code refers to them by preset number or preset ID, it would just be the web interface that needs to spit out the preset name into the browser.

 

In preview.js I see,

var g_bSupportPresetName = false; //是否支持预置点名称设置

I tried setting that to true, and it didn't change anything.

 

Also

g_bSupportPresetName = $(xmlDoc).find("PresetNameCap").eq(0).find("presetNameSupport").eq(0).text() == "true";
		//雨刷状态能力

 

Also

function getPresets() {
var szURL = m_lHttp + m_szHostName + ":" + m_lHttpPort + "/ISAPI/PTZCtrl/channels/1/presets";
$.ajax({
	type: "GET",
	url: szURL,
	success: function (xmlDoc, textStatus, xhr) {
		var oPresets = $(xmlDoc).find("PTZPreset");
		oPresets.each(function () {
			var iId = parseInt($(this).find("id").eq(0).text(), 10);
			var szName = $(this).find("presetName").eq(0).text();
			var oCurPreset = $("#PresetArea").children("div").eq(iId - 1);
			oCurPreset.removeClass("presetunset");
               if (window.parent.g_szDeviceType == "IPCamera" || !g_bSupportPresetName) {  //IPC不支持名称显示
                   return;
               }

 

There's other references to preset name in that file. It looks like Hikvision coded with the intent for preset names, but for some reason it's disabled.

Share this post


Link to post
Share on other sites

One more thing, here's a snippet of http://hostname/ISAPI/PTZCtrl/channels/1/presets from my camera. You can see that each should have an preset ID and a preset name; however, each is set to the same thing by Hikvision from what I see.

 

<PTZPresetList xmlns="http://www.std-cgi.com/ver20/XMLSchema" version="2.0">
<PTZPreset>
<enabled>true</enabled>
<id>1</id>
<presetName>1</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>2</id>
<presetName>2</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>3</id>
<presetName>3</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>4</id>
<presetName>4</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>5</id>
<presetName>5</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>6</id>
<presetName>6</presetName>
</PTZPreset>
<PTZPreset>
<enabled>true</enabled>
<id>10</id>
<presetName>10</presetName>

Share this post


Link to post
Share on other sites

Did you ever find out if naming the presets was possible?

Seems silly to allow up to 256 presets with no ability to name them..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×