Configuration via ssh / SQLite / ipc_db

BenL

n3wb
Joined
Nov 25, 2016
Messages
3
Reaction score
1
I have a DS-2CD3132F-IWS, fw version V5.2.5 build 141201. It has a couple of bugs, one of which is not being able to change the video mirroring. The configuration > Display Settings > Video Adjustment pane shows the Mirror setting, however the 'Save' button is missing and changing the Mirror setting does nothing.

After a bit of poking around, I discovered that the camera saves all (?) of its configuration to a sqlite database in /davinci/ipc_db. Copying this file off to a machine with an sqlite client allows you to modify any config setting after copying the file back and rebooting the camera.

In particular, the mirroring function is controlled by the mirror field of the front_other_config table; 0 is normal, 1 = mirrored, 2 and 3 are other variations on flipped/mirrored.

e.g. (from a linux host, bikecam is the camera with ssh enabled)
Code:
% ssh admin@bikecam 'cat /davinci/ipc_db' > /tmp/ipc_db

% # dump the db, look over the content
% sqlite3 /tmp/ipc_db .dump | less

% sqlite3 /tmp/ipc_db                                        
SQLite version 3.8.10.2 2015-05-20 18:17:19
Enter ".help" for usage hints.
sqlite> .mode line
sqlite> select * from front_other_config;
                     idx = 1
            local_output = 1
               powerline = 0
             mirror_ctrl = 0
                  mirror = 0
              scene_mode = 0
...

sqlite> update front_other_config set mirror=2;   -- flip upside down
sqlite> ^D

% # copy back and reboot
% ssh admin@bikecam 'cat > /davinci/ipc_db && /sbin/reboot' < /tmp/ipc_db
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,964
Reaction score
6,794
Location
Scotland
however the 'Save' button is missing and changing the Mirror setting does nothing.
I'm going to take a guess that you are using Linux/Firefox and not IE11 with the webcomponents plugin enabled - which, strangely, is a pre-requisite not just for Live View / Playback but also for many configuration choices - though I haven't tested this for that specific configuration item.
 

BenL

n3wb
Joined
Nov 25, 2016
Messages
3
Reaction score
1
Ah, yes; (well, Linux and Mac, neither of which work...). I found this approach easier than spinning up a Windows VM just to configure the one thing I needed :)
 

alastairstevenson

Staff member
Joined
Oct 28, 2014
Messages
15,964
Reaction score
6,794
Location
Scotland
Whatever works! Interestingly different approach ...
It is a bit weird that an ActiveX control aimed at rendering video over HTTP is required to do configuration changes.
Presumably they just found it convenient to embed some of the command&control code in it.
 

BenL

n3wb
Joined
Nov 25, 2016
Messages
3
Reaction score
1
Yeah, the software definitely smells of something that has been hacked together / whatever's easiest to get the next feature out... (particularly evident if you take a look at the ipc_db database schema!). But, the important bits work properly, the image quality is quite good, and it was cheap, so I'm not going to complain too much.
 

Enabler

Getting the hang of it
Joined
Oct 11, 2015
Messages
265
Reaction score
41
Location
Bolton
ONVIF would be a good choice to configure the camera remotely without manually changing ipc_db or needing a Windows VM

I assume there's a decent ONVIF app for linux and for mac.
 
Top