Skip to content

Exporting Data and Events

CVEDIA-RT implements a simple yet powerful system for exporting data from the running instances.

Export settings

Most of the solutions are configured with a panel to easly choose and configure the data to exports.

To access this panel:

  1. Start one of the available instances

    Start instance

  2. Access the Exporting Options in the Config panel

    Exporting Options

Tip

If the Config panel is not open, you can open it from the main menu, under Instance -> Config:

Menu Instance Config

In the Exporting Options section, you can add one or more exporting settings, and enable/disable them as needed.

Exporting tooltips

The first step is to choose what data to export

Data to export

Depending on the choice, a list of different formats will be listed below. There are two types of data that can be exported: binary (for example the output image) and metadata (detections, events, etc...).

For binary data, the supported formats are mp4, jpg, png, rtsp, and rtmp.

For metadata, the supported formats are json files, json over mqtt, csv, and txt.

Export format

Once a format is chosen, a few additional options will be displayed that allow to control how and where to export the data.

Upon clicking the OK button, the new exporting settings will be added to the instance.

Warning

Due to a temporary limitation, after adding, modifing, enabling or disabling the outputs settings, it's necessary to save the instance using the File -> Save Instance menu. The changes will take effect only after the restart of the instance.

Save instance

JSON

The JSON format exposes the following settings:

Minify: It allows to compress the entire JSON object in a single line. When disabled, the JSON text will be formatted for an easier readability.

Append Only: When enabled, CVEDIA-RT will export the data of multiple frames or events in a single file. This should be used in conbination with the Minify options to create a JSON log, where each row is an entry.

Path: The path and file name where to export the data. The path is relative the the binary of CVEDIA RT. On Windows it corresponds to the files subfolder. You can also specify an absolute path.

Note

On Windows the path must use the forward slash as folder separator: /

The path can also contain variables or special tokens to define a dynamic folder or file name: output/zone_stats_{obj.frame_id}.json

In this example, the file name will be built using the frame id.

The obj keyword represents the object that is being exported, and it allows to access any internal value. The metadata produced by CVEDIA-RT contains at least these values: frame_id, frame_time, system_timestamp, system_date.

For more information please check Dynamic Strings.

Each solution sends one or more data streams to the output sink. These data streams are used to draw visual references in the Output and Data panels, but can be used to export data in various formats and protocols.

CSV

The CSV format exposes the following settings:

Minify: See JSON settings

Separator: It allows setting the character to use to separate the columns.

Minify: See JSON settings. This is useful if you are not exporting tabular data (see the notes below)

Append Only: See JSON settings

Path: See JSON settings

Tip

When exporting CSV data, it's recommended chosing one of a tabular format from the list in Data to export.

MQTT

The MQTT format exposes the following settings:

IP: The IP where the MQTT server is running.

Port: The port that the MQTT server is using.

Topic: A name that will be used to filter the data on the server.

Tip

You can configure multiple MQTT export settings in a single instance to export different type of data by using different topic names.

Info

You can run an MQTT server using Eclipse Mosquitto MQTT Broker or one of the Python scripts available in the tools folder inside the CVEDIA-RT folder.

MP4

The MP4 format exposes the following settings:

Resolution: The resolution of the exported video. It can be customized or kept as the input source one.

FPS: The number of frames per seconds of the exported video. It can be customized or kept as the input source one.

Path: See JSON settings. A dynamic path is not supported here.

JPG and PNG

Path: See JSON settings. In this case a dynamic path is required.

RTMP

URI: It defines the GStreamer pipeline. It must include the element appsrc name=cvedia-rt as source.

For more information please check Advanced IO with GStreamer

Example

gstreamer:///appsrc name=cvedia-rt ! videoconvert ! x264enc speed-preset=1 ! video/x-h264,profile=baseline ! flvmux latency=0 start-time-selection=1 streamable=true ! rtmpsink location='rtmp://127.0.0.1:1935/live/cam0 live=true'

RTSP

The RTSP format exposes the following settings:

Pipeline: The GStreamer pipipeline. It must include the element appsrc name=cvedia-rt as source.

Example

( appsrc name=cvedia-rt ! videoconvert ! videoscale ! x264enc ! video/x-h264,profile=high ! rtph264pay name=pay0 pt=96 )

FPS: The number of frames per seconds of the exported video.

IP: The IP that the RTSP server should use.

Port: The port that the RTSP server should listen to for connections.

Topic: The topic name.

Warning

To run export mutliple RTSP streams, you must use a different port for each stream. Chaging only the topic wouldn't be enough.