1 Title: Managing and using ONVIF IP cameras with Linux
2 Tags: english, debian, multimedia, standard, surveillance
5 <p>Recently I have been looking at how to control and collect data
6 from a handful IP cameras using Linux. I both wanted to change their
7 settings and to make their imagery available via a free software
8 service under my control. Here is a summary of the tools I found.</p>
10 <p>First I had to identify the cameras and their protocols. As far as
11 I could tell, they were using some SOAP looking protocol and their
12 internal web server seem to only work with Microsoft Internet Explorer
13 with some proprietary binary plugin, which in these days of course is
14 a security disaster and also made it impossible for me to use the
15 camera web interface. Luckily I discovered that the SOAP looking
16 protocol is actually following <a href="https://www.onvif.org/">the
17 ONVIF specification</a>, which seem to be supported by a lot of IP
18 cameras these days.</p>
20 <p>Once the protocol was identified, I was able to find what appear to
21 be the most popular way to configure ONVIF cameras, the free software
23 <a href="https://sourceforge.net/projects/onvifdm/">ONVIF Device
24 Manager</a>. Lacking any other options at the time, I tried
25 unsuccessfully to get it running using Wine, but was missing a dotnet
26 40 library and I found no way around it to run it on Linux.</p>
28 <p>The next tool I found to configure the cameras were a non-free Linux Qt
29 client <a href="https://www.lingodigit.com/onvif_nvcdemo.html">ONVIF
30 Device Tool</a>. I did not like its terms of use, so did not spend
33 <p>To collect the video and make it available in a web interface, I
34 found the Zoneminder tool in Debian. A recent version was able to
35 automatically detect and configure ONVIF devices, so I could use it to
36 set up motion detection in and collection of the camera output. I had
37 initial problems getting the ONVIF autodetection to work, as both
38 Firefox and Chromium <a href="https://bugs.debian.org/1001188">refused
39 the inter-tab communication</a> being used by the Zoneminder web
40 pages, but managed to get konqueror to work. Apparently the "Enhanced
41 Tracking Protection" in Firefox cause the problem. I ended up
42 upgrading to the Bookworm edition of Zoneminder in the process to try
43 to fix the issue, and believe the problem might be solved now.</p>
45 <p>In the process I came across the nice Linux GUI tool
46 <a href="https://gitlab.com/caspermeijn/onvifviewer/">ONVIF Viewer</a>
47 allowing me to preview the camera output and validate the login
48 passwords required. Sadly its author has grown tired of maintaining
49 the software, so it might not see any future updates. Which is sad,
50 as the viewer is sightly unstable and the picture tend to lock up.
51 Note, this lockup might be due to limitations in the cameras and not
52 the viewer implementation. I suspect the camera is only able to
53 provide pictures to one client at the time, and the Zoneminder feed
54 might interfere with the GUI viewer. I have
55 <a href="https://bugs.debian.org/1000820">asked for the tool to be
56 included in Debian</a>.</p>
58 <p>Finally, I found what appear to be very nice Linux free software
59 replacement for the Windows tool, named
60 <a href="https://github.com/sr99622/libonvif/">libonvif</a>. It
61 provide a C library to talk to ONVIF devices as well as a command line
62 and GUI tool using the library. Using the GUI tool I was able to change
63 the admin passwords and update other settings of the cameras. I have
64 <a href="https://bugs.debian.org/1021980">asked for the package to be
65 included in Debian</a>.</p>
67 <p>As usual, if you use Bitcoin and want to show your support of my
68 activities, please send Bitcoin donations to my address
69 <b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>
71 <p><strong>Update 2022-10-20</strong>: Since my initial publication of
72 this text, I got several suggestions for more free software Linux
73 tools. There is <a href="https://github.com/quatanium/python-onvif">a
74 ONVIF python library</a> (already
75 <a href="https://bugs.debian.org/824240">requested into Debian</a>) and
76 <a href="https://github.com/FalkTannhaeuser/python-onvif-zeep">a python 3
77 fork</a> using a different SOAP dependency. There is also
78 <a href="https://www.home-assistant.io/integrations/onvif/">support for
79 ONVIF in Home Assistant</a>, and there is an alternative to Zoneminder
80 called <a href="https://www.shinobi.video/">Shinobi</a>. The latter
81 two are not included in Debian either. I have not tested any of these