.. role:: raw-html-m2r(raw) :format: html **Contents** * `Basler Camera <#basler-camera>`__ * `Set the Security Context in Helm Environment to Enable the Basler Camera <#updating-security-context-of-videoingestion-helm-charts-for-enabling-k8s-environment-to-accessdetect-basler-camera>`__ Basler Camera ------------- **Note:** * ``Pixel Formats`` .. list-table:: :header-rows: 1 * - Camera Model - Tested Pixel Formats * - Basler acA1920-40gc - mono8\ :raw-html-m2r:`
`\ ycbcr422_8\ :raw-html-m2r:`
`\ bayerrggb * - Basler acA1920-150uc - mono8\ :raw-html-m2r:`
`\ rgb8\ :raw-html-m2r:`
`\ bgr8\ :raw-html-m2r:`
`\ bayerbggr * In case one wants to use any of the bayer pixel-format, then the ``bayer2rgb`` element needs to be used to covert raw bayer data to RGB. Refer the following example pipeline: .. code-block:: javascript { "type": "gstreamer", "pipeline": "gencamsrc serial= pixel-format=bayerrggb ! bayer2rgb ! videoconvert ! video/x-raw,format=BGR ! appsink" } * In case one wants to use the ``mono8`` image format or wants to work with a monochrome camera then change the ``pixel-format`` to ``mono8`` in the pipeline. Since ``gstreamer`` ingestor expects a ``BGR`` image format, a single channel ``GRAY8`` format would be converted to a three channel BGR format. **An example pipeline for working with ``mono8`` image format or a monochrome basler camera is as follows:**   .. code-block:: javascript { "type": "gstreamer", "pipeline": "gencamsrc serial= pixel-format=mono8 ! videoconvert ! video/x-raw,format=BGR ! appsink" } * In case one wants to enable resizing with a basler camera, the ``vaapipostproc`` element can be used to specify the height and width parameter in the gstreamer pipeline. **An example pipeline to enable resizing the frame to ``600x600`` with a basler camera is as follows:** .. code-block:: javascript { "type": "gstreamer", "pipeline": "gencamsrc serial= pixel-format= ! vaapipostproc height=600 width=600 ! videoconvert ! video/x-raw,format=BGR ! appsink" } * In case one wants to divert the color space conversion to the ``GPU`` for basler camera, ``vaapipostproc`` can be used. This can be useful when the CPU% is maxed out due to the input ingestion stream. **An example pipeline for performing color space conversion from ``YUY2 to BGRx`` on GPU using ``vaapipostproc`` and a basler camera is as follows:** .. code-block:: javascript { "type": "gstreamer", "pipeline": "gencamsrc serial= pixel-format= ! vaapipostproc format=bgrx ! videoconvert ! video/x-raw,format=BGR ! appsink" } ``Basler camera hardware triggering`` * If the camera is configured for triggered image acquisition, one can trigger image capture at particular points in time. * With respect to hardware triggering, if the camera supports it, then an electrical signal can be applied to one of the camera's input lines, which can act as a trigger signal. * In order to configure the camera for hardware triggering, during our tests we set the following properties of the generic plugin: * ``trigger-selector=FrameStart``\ -The camera initializes the acquisition of only one image. * ``acquisition-mode=singleframe``\ -The camera will acquire exactly one image. * ``trigger-source=Line1``\ -The appropriate hardware trigger source needs to be selected. * ``trigger-activation=RisingEdge``\ -The appropriate trigger activation parameter needs to be selected. * ``hw-trigger-timeout=100``\ -The hardware trigger timeout value is in seconds in multiples of 5. For more information on the properties related to hardware triggering, refer Generic-Plugin-readme(\ ``[WORK_DIR]/IEdgeInsights/VideoIngestion/src-gst-gencamsrc/README``\ ) ``Validated test setup for triggering basler camera hardware`` * In our test setup, a Python script was used to control a ModBus I/O module to generate a digital output on the opto-insulated input line (Line1) of the Basler camera. * For testing the hardware trigger functionality, the Basler acA1920-40gc camera model has been used. .. **Note**\ : Other triggering capabilities with different camera models are not tested. Set the Security Context in Helm Environment to Enable the Basler Camera.  -------------------------------------------------------------------------- Updating the security context of video ingestion helm charts to allow the K8 environment to access or detect the Basler Camera. The following steps describe how to update helm charts to allow K8s environment to access or detect Basler Camera: * Open ``EII_HOME_DIR/IEdgeInsights/VideoIngestion/helm/templates/video-ingestion.yaml`` file * Update the following security context snippet: .. code-block:: yml securityContext: privileged: true in the yaml file as: .. code-block:: yaml ... ... ... imagePullPolicy: {{ $global.Values.imagePullPolicy }} securityContext: privileged: true volumeMounts: - name: dev mountPath: /dev ... * Re-run ``builder.py`` to apply these changes to your deployment helm charts.