Contents¶
USB (V4l2) Camera¶
Note
If you want to enable resizing with a USB camera, use the
videoscale
element and specify theheight
andwidth
of the parameters in the Gstreamer pipeline.
**An example pipeline to enable resizing with a USB camera:**
`"pipeline":"v4l2src ! videoscale ! video/x-raw,format=YUY2,height=600,width=600 ! videoconvert ! video/x-raw,format=BGR ! appsink"`
If multiple USB cameras are connected, specify the camera using the
device
property in the configuration file.An example pipeline to use the device property:
"pipeline": "v4l2src device=/dev/video0 ! video/x-raw,format=YUY2 ! videoconvert ! video/x-raw,format=BGR ! appsink"
Note: Typically, a device node gets created when a USB device is connected to the system. When multiple USB cameras are connected, one needs to identify which device node is mapped to the camera and use that with the
device
property. Device nodes for the cameras usually gets created in a sequence of video0, video1, video2 etc.
Set Securiry Context to Enable USB Camera in Helm Environment¶
The following are the steps to update the Security Context of VideoIngestion Helm Charts to allow K8s environment to access or detect USB cameras:
Open
EII_HOME_DIR/IEdgeInsights/VideoIngestion/helm/templates/video-ingestion.yaml
fileUpdate the following security context snippet:
securityContext: privileged: true
in the yaml file as:
... ... ... 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.