ONVIF Device Reference Design - Evaluating the Project using Docker

From RidgeRun Developer Wiki





Previous: Getting Started/Evaluating the Project Index Next: Getting Started/REST API





Introduction

RidgeRun provides an evaluation version within a Docker container which is limited to 5 min of execution of web page and ONVIF device support. This evaluation has to be implemented in a NVIDIA Jetson platform, and it includes all the dependencies in their evaluation version. These dependencies are libonvif and rtsp-sink.

Hardware setup

This section specifies the minimum hardware setup so the container can run as expected, which is:

  • The JetPack version running on the board has to match the one pulled with docker. For instance, if the board is running a 32.5.0 meta tegra version, then the tag used by Docker should be onvif-jetson:r32.5.0.
  • The board should has at least one MIPI camera.

Install docker

To install the docker package in a Jetson device, follow the instructions in the next link: Install Docker Engine on Ubuntu.

How to run

A link with the project image will be shared. Download it copy it in the Jetson platform. Load the ONVIF image:

$ docker load < onvif-server-ref-design-file.tar 

To double check it the ONVIF image where correctly loaded, run:

$ docker images

The command above will show the two ONVIF images, one with a tag labeled as r32.5.0, and another one labeled as r32.6.0.

REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE
onvif-reference-design-eval-jetson   r32.5.0             d5fe1644f5e8        2 weeks ago         2.79GB
onvif-reference-design-eval-jetson   r32.6.0             d5fe1644f5e8        2 weeks ago         2.79GB

To run the evaluation docker, use the following command (the tag can be changed by r32.5.0 or r32.6.0):

$ sudo docker run --name onvif --net=host --runtime nvidia --rm --ipc=host -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /tmp/argus_socket:/tmp/argus_socket --cap-add SYS_PTRACE --privileged -v /dev:/dev -v /proc:/writable_proc -e DISPLAY=$DISPLAY -it onvif-reference-design-eval-jetson:tag

This message will appear in the terminal, indicating that the evaluation version is running correctly.

*************************************
*** THIS IS AN EVALUATION VERSION ***
*************************************
                                     
        Thanks for evaluating        
       RidgeRun OnvifServer          
                                     
  This version allows you to use     
  the library for 300 seconds.
  Please contact                     
  <support@ridgerun.com> to purchase 
  the professional version of this   
  library.                           
                                     
*************************************
*** THIS IS AN EVALUATION VERSION ***
*************************************

Get the web URL

The web URL can be accessed by writing the following address in a browser https://Jetson-IP-address/:8092/. This browser has to run in the same network as the ONVIF server. One way to get the IP address of the board is to open a terminal window and run the following command:

$ ifconfig

The output of the command will look like this:

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        inet6 fe80::42:34ff:fe3f:51b0  prefixlen 64  scopeid 0x20<link>
        ether 02:42:34:3f:51:b0  txqueuelen 0  (Ethernet)
        RX packets 274  bytes 26371 (26.3 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 312  bytes 960054 (960.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.167  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::7588:c406:506d:2572  prefixlen 64  scopeid 0x20<link>
        ether 00:04:4b:cb:ea:a2  txqueuelen 1000  (Ethernet)
        RX packets 12417  bytes 7458841 (7.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3854  bytes 2239891 (2.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 41  

l4tbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.55.1  netmask 255.255.255.0  broadcast 192.168.55.255
        inet6 fe80::58cc:a9ff:fe25:e775  prefixlen 64  scopeid 0x20<link>
        inet6 fe80::1  prefixlen 128  scopeid 0x20<link>
        ether 5a:cc:a9:25:e7:75  txqueuelen 1000  (Ethernet)
        RX packets 1218  bytes 311630 (311.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1238  bytes 286030 (286.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 654  bytes 91112 (91.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 654  bytes 91112 (91.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

rndis0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::58cc:a9ff:fe25:e775  prefixlen 64  scopeid 0x20<link>
        ether 5a:cc:a9:25:e7:75  txqueuelen 1000  (Ethernet)
        RX packets 1102  bytes 278481 (278.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1306  bytes 368685 (368.6 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet6 fe80::58cc:a9ff:fe25:e777  prefixlen 64  scopeid 0x20<link>
        ether 5a:cc:a9:25:e7:77  txqueuelen 1000  (Ethernet)
        RX packets 130  bytes 34856 (34.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 97  bytes 19124 (19.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

The IP address in this case, is 192.168.100.167. The URL can also be found when the server starts running. This will display a message like the one below, indicating the URL, which in this case would be: https://192.168.100.167:8092/.

Onvif Server reference design application
 * Serving Flask app 'onvif_web_page.src.server' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on https://192.168.100.167:8092/ (Press CTRL+C to quit)

The webpage can be opened on whatever device, only with the condition that has to be connected to the same network as the ONVIF server. Below there is an image that shows how the web page looks like when the URL is written in the browser.


ONVIF login web page


It is important to remind that when the container is working, every ONVIF device can be connected to it.

To stop the docker:

sudo docker stop onvif

When the server stops working, it will send a message telling that the evaluation time has concluded. Also, functionalities such as changing or adding video sources or video encoders, streaming and showing the device information will stop working.



Previous: Getting Started/Evaluating the Project Index Next: Getting Started/REST API