Skip to main content

BriefCam Administrator Guide

Exporting BriefCam’s RESEARCH Data

Last Updated: 4 minute read

BriefCam includes a batch script that generates the data since the last execution from BI DB tables into CSV files. The script can be scheduled (externally to BriefCam) to run on a schedule, for example every hour. The data will be generated as a CSV file to same location where you run the script.

The CSV files are not part of the maintenance process and are, therefore, not deleted.

Below is an example of the files that are exported.

RESEARCH_export_tables1.png

The CSV files that are exported are:

Table NameDescription

bc_bi_colors_lookup

Dictionary table for colors.

bc_bi_dlcclass_lookup

Dictionary table for detailed level classes (Man, Woman, Bicycle, Motorcycle, Car, Pickup Truck, Van, Truck, Bus, Train, Airplane, Boat, Lights On, Lights Off, Unknown, Child, Animals)

bc_bi_group_filters

Table that contains the relationship between the Source Group and correlated watchlist, meaning which Watchlists are correlated to each Source Group 

bc_bi_groups

Table with all the Source Groups that the user defined

bc_bi_groups_source

Table that contains the relationship between the Source Group and Sources, meaning which Sources does each Source Group contain

bc_bi_rules

Table with the custom dimensions’ (path/area/line crossing) names per each Source

bc_bi_source

Table with all the sources that the user defined from cameras or files

bc_bi_source_match

Main table that contains all objects’ transactions. For additional details, see the table below.

bc_bi_visual_layers

Table with all Visual Layer details (Activity Heat Map, Background Changes, Common Paths , Dwell Heat Map)

The data available in the bc_bi_source match table is:

ColumnDescription

objectid

Object’s ID

sourceid

The source (camera/video) that the object appears in

nodeid

Site ID 

starttime

Object’s start time in the frame

endtime

Object’s end time in the frame

main_color

Object’s main color

main_dl_class

Object’s class (detailed level such as man, car)

abssize

Object’s size

absspeed

Object’s speed

dwell

Object’s dwell time

motiondirection

Object’s direction (degrees)

timestamp

The timestamp that the record was written to the database

motionquality

Object’s quality

lprplatetext

License plate text

mask

Mask indication (NoMask=0, Mask=1, Unknown=99999)

nobag

Nobag indication (Bag=0, NoBag=1, Unknown=99999) – Currently not in use in the client

backpack

Backpack indication (NoBackPack=0, BackPack=1, Unknown=99999) – Currently not in use in the client

handheld

Handheld indication (No Handheld=0, Handheld=1, Unknown=99999) 

classa

Custom classifier A (Not class A =  0 , Class A = 1)

classb

Custom classifier B (Not class B =  0 , Class B = 1)

classc

Custom classifier C (Not class C =  0 , Class C = 1)

To export BriefCam’s RESEARCH data:
  1. On the machine where RESEARCH is installed, open the folder: C:\Program Files\BriefCam\RESEARCH\Tools\ExportBIData. In this folder you will find the files that you need to export BriefCam’s RESEARCH data.

    ExportBIData_files.png
  2. If the database is installed on a different machine than the server, copy this folder to the database machine (it can be pasted to the desktop).

  3. Create a BI user that will have access to read from the database (you only need to do these steps one time):

    1. Open the CreateReadOnlyBIUser file and copy the SQL written in the file.

      CreateReadOnlyBIUser_file.png
    2. From the C:\PostgreSQL\pgAdmin 4\bin folder, run the pgAdmin4.exe file.

    3. Connect to the briefcam server.

      ‎ 

      PgAdmin4_connect.png
    4. Right-click the briefcam server and select Tools > Query Tool.

      ‎

      PgAdmin4_Query_tool.png
    5. Paste the query and execute it by clicking on the lightning icon.

      ‎ 

      PgAdmin4_lightning_icon.png
    6. You should now be able to see a Query returned successfully message.

  1. If this is the first time that you will be running the script, open the lastLoadConfig file and double check that all of the values are set to zero (0).

  2. If this is not the first time that you run the script, the result will be incrementally generated tables—meaning that only records that were added since the last run will be added. If you want fully generated tables, open the lastLoadConfig file and reset all of the values to zero (0).

  3. Run the script that exports the data:

    1. From the ExportBIData folder, open cmd (command line) as administrator.

    2. Run the following lines one at a time (the path is as-is if you did not move these files. If you moved them, change the path accordingly):  

      cd C:\Program Files\BriefCam\RESEARCH\Tools\ExportBIData 

      exportBIData_2CSVfiles.bat 

  1. A log file will be created.

  2. The first time you run the script you will see that for each section there was a full load.

  3. If you are running it for a second time, the script will run on any changes that occurred since the last time the script was run. You will then see in each of the sections how many items were incrementally loaded. For example, in the below log, you can see that 14,189 items were loaded since the last run.

To schedule the script to run on a schedule:
  1. Open the Windows Task Scheduler.

  2. Select Create Basic Task and run through the wizard to create a scheduled task for the exportBIData_2CSVfiles.bat file.

Scheduler basic task.png