[vlc-devel] New Serivces Discovery Module for Onvif Cameras

Stephen Rhodes sr99622 at gmail.com
Tue Mar 5 17:54:00 CET 2019


Thank you for the kind response, I appreciate you taking the time to read
through my note.

In regards to the use of Nettle in the module, the Onvif specification
requires a SHA1 hash for authentication.  Obviously, linking an entire
library to use one function seems nonsensical, so several approaches were
taken to isolate the function and establish independence.  These work
reasonably well on Linux and macosx, however, Windows was problematic for
some reason unknown.  Using Nettle was the only path I could find that
worked on all platforms.

Regarding libxml2, I was surprised by the aversion to using this library,
as it is pretty well known.  Going through the code I saw references to
memory leaks and re-entrancy issues, which honestly, I have not encountered
myself.  The vlc_xml module could certainly be used for generic xml
functionality, however, the Onvif spec is anything but.

If you might indulge me briefly, the Onvif spec is a SOAP construct of the
worst type of corporate buzzword programming.  The basic idea is to write a
script describing the protocol and then generate source code using a SOAP
compiler.  This ends up generating horrifically complex xml code that
plumbs the depths of arcane and obscure xml syntax.  The end result, not
surprisingly, is gigantic bloatware of marginal functionality.

To get around this problem, the xml code was generated by hand essentially
by reverse engineering the protocol produced by the SOAP code.  This is an
extremely tedious task and one I would not be in a position to replicate at
this time.

Having said all that, the extension of VLC with this functionality produces
a very useful tool.  In addition to the Onvif Discovery module, I have a
camera controls dialog as well that can manipulate camera parameters such
as resolution, frame rate, PTZ, etc., pretty much the same functionality as
Onvif Device Manager, if you are familiar with that program.  I have been
using VLC in this configuration for some time and have been quite pleased
with the result.   If you are interested, I am happy to send along the code
for that as well.


Best regards,

Stephen Rhodes

On Mon, Mar 4, 2019 at 9:52 AM Jean-Baptiste Kempf <jb at videolan.org> wrote:

> Hello,
>
> On Sun, 3 Mar 2019, at 13:41, Stephen Rhodes wrote:
>
> I have developed a services_discovery module for VLC that will find ip
> cameras on the local network that are onvif compatible using udp broadcast.
>
>
> Before going to a review, thanks a lot, this is very useful and requested
> by users!
>
> modification to the Makefile.am is required as well.  It has dependency on
> libxml2 and nettle.
>
>
> You should use vlc_xml.h header, instead of libxml.
>
> What do you use nettle for?
>
> Best,
>
>
> diff --git a/modules/services_discovery/Makefile.am
> b/modules/services_discovery/Makefile.am
> index efd9cf6..0d6f928 100644
> --- a/modules/services_discovery/Makefile.am
> +++ b/modules/services_discovery/Makefile.am
> @@ -13,6 +13,14 @@ libsap_plugin_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_sap)
>  libsap_plugin_la_LIBADD = $(LIBS_sap) $(SOCKET_LIBS)
>  sd_LTLIBRARIES += libsap_plugin.la
>
> +libonvifdisc_plugin_la_SOURCES = services_discovery/onvifdisc.c
> services_discovery/onvif.c services_discovery/onvif.h
> +libonvifdisc_plugin_la_CFLAGS = $(LIBXML2_CFLAGS) $(NETTLE_CFLAGS)
> +libonvifdisc_plugin_la_LIBADD = $(LIBXML2_LIBS) $(NETTLE_LIBS)
> +sd_LTLIBRARIES += libonvifdisc_plugin.la
> +if HAVE_WIN32
> +libonvifdisc_plugin_la_LIBADD += -liphlpapi
> +endif
> +
>  libavahi_plugin_la_SOURCES = services_discovery/avahi.c
>  libavahi_plugin_la_CFLAGS = $(AM_CFLAGS) $(AVAHI_CFLAGS)
>  libavahi_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(sddir)'
>
> I'm hoping this module can be added to the official VLC distribution.  It
> has been well tested against a variety of cameras including
>
> HIKVISION, DAHUA, AXIS, SUNBA, AMCREST, SPECO, TRENDNET, REOLINK, FOSCAM,
> UTALENT, VIVOTEK, HIKAM
>
> Thank you for your consideration,
>
> Stephen Rhodes
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
> *Attachments:*
>
>    - onvifdisc.c
>    - onvif.c
>    - onvif.h
>
>
> --
> Jean-Baptiste Kempf -  President
> +33 672 704 734
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190305/33b1ca90/attachment.html>


More information about the vlc-devel mailing list