Contents ======== * `Contents <#contents>`__ * `GStreamer Video Analytics <#gstreamer-video-analytics>`__ GStreamer Video Analytics ------------------------- The VideoIngestion module supports the usage of the Gstreamer Video Analytics (GVA) plugins with the GStreamer ingestor. `GVA `_ is a collection of the GStreamer elements and it enables the CNN model-based video analytics capabilities such as object detection, classification, and recognition in the GStreamer framework. Refer to `CustomUdfs-GVASafetyGearIngestion `_ for more information on the GVA-based CustomUdf container added for the SafetyGear sample. The GVA use case configurations with different cameras are as follows: * Video file-Gstreamer ingestor with GVA elements .. code-block:: javascript { "type": "gstreamer", "pipeline": "multifilesrc loop=TRUE stop-index=0 location=./test_videos/ ! h264parse ! decodebin ! videoconvert ! video/x-raw,format=BGR ! gvadetect model=models/ ! appsink" } .. note:: To use GVA with a video file using the ``multifilesrc`` element, copy the video file to ``[WORKDIR]/IEdgeInsights/VideoIngestion/test_videos`` and provide the location of the video file in the GStreamer pipeline. * Generic plugin-Gstreamer ingestor with GVA elements .. code-block:: javascript { "type": "gstreamer", "pipeline": "gencamsrc serial= pixel-format= ! vaapipostproc format=bgrx ! gvadetect model=models/ ! videoconvert ! video/x-raw,format=BGR ! appsink" } * RTSP camera-Gstreamer ingestor with GVA elements .. code-block:: javascript { "type": "gstreamer", "pipeline": "rtspsrc location=\"rtsp://:@:/\" latency=100 ! rtph264depay ! h264parse ! vaapih264dec ! vaapipostproc format=bgrx ! gvadetect model=models/ ! videoconvert ! video/x-raw,format=BGR ! appsink" } * USB camera-Gstreamer ingestor with GVA elements .. code-block:: javascript { "type": "gstreamer", "pipeline": "v4l2src ! decodebin ! videoconvert ! video/x-raw,format=BGR ! gvadetect model=models/ ! appsink" } * RTSP simulated-Gstreamer ingestor with GVA elements .. code-block:: javascript { "type": "gstreamer", "pipeline": "rtspsrc location=\"rtsp://:/\" latency=100 ! rtph264depay ! h264parse ! vaapih264dec ! vaapipostproc format=bgrx ! gvadetect model=models/ ! videoconvert ! video/x-raw,format=BGR ! appsink" } * For generic full frame inference, use the ``gvainference`` element. For more information, refer to `gvainference `_. The following is an example pipeline to run the PCB classification using the ``gvainference`` element. When you run the following pipeline, you may not see the PCB defects and bounding boxes because there is no provision to provide a reference image and config ROI (which the PCB classifier expects) with the gvaelements. .. code-block:: javascript { "type": "gstreamer", "pipeline": "rtspsrc location=\"rtsp://:/\" latency=100 ! rtph264depay ! h264parse ! vaapih264dec ! gvainference device=CPU model=common/video/udfs/python/pcb/ref/model_2.xml ! vaapipostproc format=bgrx height=600 width=600 ! videoconvert ! video/x-raw,format=BGR ! appsink", } .. note:: * The GVA elements can only be used with the ``gstreamer`` ingestor. * The ``gvadetect`` element cannot be used to run the PCB classification(\ ``[WORK_DIR]/IEdgeInsights/common/video/udfs/python/pcb/ref``\ ) pipeline. * Using the device property of the ``gvadetect`` and ``gvaclassify`` elements you can set CPU, GPU, or HDDL device to use with the GVA elements. * By default, the device property is set to CPU. * VideoIngestion does not support inferencing with ``MYRIAD (NCS2)`` and ``HDDL`` devices. * Start the HDDL daemon on the host machine by following the steps mentioned in the [Using video accelerators] section in the `../../README.md `_. The following is an example pipeline to run a sample detection model using the GVA plugins on an HDDL device(ensure that the detection model IR files are copied to the models path): .. code-block:: javascript { "type": "gstreamer", "pipeline": "rtspsrc location=\"rtsp://:/\" latency=100 ! rtph264depay ! h264parse ! vaapih264dec ! vaapipostproc format=bgrx ! gvadetect device=GPU model=models/ ! videoconvert ! video/x-raw,format=BGR ! appsink" }