Configure RTSP Camera Input#
Instead of a simulation video, the Product Identification (PID) service can ingest a live RTSP camera stream for real-time product detection.
Prerequisites#
Obtain the RTSP URI from your camera software. You can test the URI with, for example, the VLC media player before configuring it here.
For more on the RTSP protocol, see RTSP — Wikipedia.
Steps#
Update the pipeline in
configs/pid/config.json. Replace the existingmultifilesrcpipeline string with anrtspsrcpipeline:"pipeline": "rtspsrc location=\"rtsp://<USERNAME>:<PASSWORD>@<RTSP_CAMERA_IP>:<PORT>/<FEED>\" latency=0 drop-on-latency=true protocols=udp ! application/x-rtp,media=video ! rtph264depay ! video/x-h264,stream-format=byte-stream ! decodebin3 ! gvadetect name=detection ! gvawatermark displ-cfg=\"font-scale=1.5,thickness=3,color-idx=2,font-type=plain\" ! gvafpscounter ! appsink name=destination"
Replace
<USERNAME>,<PASSWORD>,<RTSP_CAMERA_IP>,<PORT>, and<FEED>with your camera’s values.Note: To use different bounding box colors with
gvawatermark, refer to the GVA Watermark element documentation.Set the camera IP in
.env:RTSP_CAMERA_IP=<RTSP_CAMERA_IP>
Redeploy the application:
make down make up
For further guidance on RTSP with DL Streamer Pipeline Server, see the DL Streamer RTSP guide.