Exporting Data and Events¶
CVEDIA-RT implements a simple yet powerful system for exporting data from the running instances.
Most of the solutions are configured with a panel to easly choose and configure the data to exports.
To access this panel:
Start one of the available instances
Exporting Optionsin the Config panel
If the Config panel is not open, you can open it from the main menu, under Instance -> Config:
In the Exporting Options section, you can add one or more exporting settings, and enable/disable them as needed.
The first step is to choose what 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.
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.
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.
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.
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:
In this example, the file name will be built using the frame id.
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:
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.
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
When exporting CSV data, it's recommended chosing one of a tabular format from the list in
Data to export.
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.
You can configure multiple MQTT export settings in a single instance to export different type of data by using different topic names.
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.
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.
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
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'
The RTSP format exposes the following settings:
Pipeline: The GStreamer pipipeline. It must include the element appsrc name=cvedia-rt as source.
( 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.
To run export mutliple RTSP streams, you must use a different port for each stream. Chaging only the topic wouldn't be enough.