This article explains how to process files with Video Recognition Gateway (VIRGO) video feeds.  While it's possible to process files in the Video Feeds window in the SAFR Desktop Client, it can be useful to process files in the background using VIRGO (available thru the Video Feeds window) for the following reasons:

  • Processing a file in a loop for demo purposes
  • Processing many files in parallel (future articles will demonstrate how to load many feeds quickly)

This article will explain how to create a video feed from the Camera Analyzer in the SAFR Desktop Client and then push those settings to the Video Feeds window.  Following that it will explain how to change the input from camera to file.


1. Create Video Feed by following this process: Creating and updating feeds from Camera Analyzer


2. Changing Feed from Camera to File Source

Open Video Feeds Window and expand the feed you have added under the "feeds" list as shown below:


Edit the Feed to change feed to a file type as follows:


a. Mouse over the feed name and Click the "+" to add an attribute.


If needed pre-type to filter for the attribute in question.  In this case all the attributes you need are right there at the top under "input.".



After editing, you should see the following settings among others:


Where:

  • input.video-clock.enabled impacts the playback speed.  If "True", playback is in real time (good for demos or simulating for testing).  If "False", playback is as fast as SAFR can process (good for processing historical videos for forensic analysis).
  • input.loop causes the file to loop.  If set to "False", video will stop at end and you will have to disable / enable the feed using the "enabled" property to restart it.
  • input.type=file tells SAFR to look for a file input
  • input.stream.url should be set to the path to the file.  Path is platform specific.  Use "\" for Windows and "/" for Linux.   DON'T forget to add the file extension. (Sometimes it's not visible in Windows so can be easy to miss.)

Processing Video Files on Linux

When running SAFR on Linux, there are some important differences as described below.

  • Prefix the file path with "file://".  For example, if a file is in /home/userx/videos/myfile.mp4, then the input.stream.url should be "file:///home/userx/videos/myfile.mp4".   Notice that the leading "/" is included in the path.
  • File paths on Windows need not have backslash.  You may create files always with forward slashes (e.g. D://Videos/stock/subway.mp4".
  • The file:// is optional under windows.  You may include it always.   So on windows, you can also use "file://D:/Videos/stock/subway.mpg".
  • SAFR for Linux runs VIRGO under a docker container.  Thus, VIRGO does not have access to the operating system file paths unless mapped to the docker container.  
    • By default SAFR creates a mount point under /mnt/safr.  You can move your video files to this location to process them.  
    • VIRGO does not follow symlink under /mnt/safr.  If you wish to leave files in their location and process with VIRGO, create a new mount point as described below.

Mounting a Folder for VIRGO

To make additional folders in the host operating system available to VIRGO, follow the steps below.

  1. Add the new mount point to docker-compose file:
    vi /opt/RealNetworks/SAFR/virgo/app/docker-compose.yml
  2. By default the file looks like this:
    version: "3.6"
    services:
      virgo:
        image: safr_virgo:3.15.0-C11
        container_name: safr_virgo
        restart: on-failure
        pid: "host"
        volumes:
          - /opt/RealNetworks/SAFR/virgo/config/:/etc/virgo
          - /mnt/safr:/mnt/virgo-workspace
          - /etc/machine-id:/etc/machine-id
          - /etc/timezone:/etc/timezone
          - /etc/localtime:/etc/localtime
        extra_hosts:
          - "host.docker.internal:172.17.0.1"
    The IP Address may vary on your system.

  3. Add a line under volumes with format of:
    ACTUAL_PATH_ON_HOST_DRIVE:VIRTUAL_PATH_IN_DOCKER_CONTAINER"
    E.g.: - /home/userx/videos:/videos
    Where:
    • The hypen (-) must be included
    • /home/userx/videos is where your video files exist on the SAFR Server (this can be a network mounted drive)
    • /videos is the path you put in the input.stream.url
  4. Start and Stop the docker service using following two commands:
    docker-compose -f /opt/RealNetworks/SAFR/virgo/app/docker-compose.yml down
    docker-compose -f /opt/RealNetworks/SAFR/virgo/app/docker-compose.yml up -d


  5. Add the virtual path and filename relative to the mounted location into the video Feed as follows:



Video Tutorials

Process Video Files In Background - Part 1 - Push Config From GUI


Process Video Files in Background - Part 2 - Change Type to File and Update from GUI