Skip to content

How to Setup RTSP IP Camera video stream

Claude Pageau edited this page Apr 19, 2020 · 2 revisions

Instructions

Speed camera can use an RTSP video stream from an IP camera using the config.py WEBCAM_SRC setting. When using an RTSP webcam the video stream image size is automatically calculated from the stream so you do NOT have adjust the WEBCAM_WIDTH or WEBCAM_HEIGHT settings since they will be ignored if RTSP camera source is used.

Depending on the model of Raspberry PI and the Network bandwidth you should start with a stream resolution of 320x240 if possible and increase resolution as required until speed camera response is affected.

To set the video source to an rtsp IP camera edit the config.py file using nano

 WEBCAM = True

 WEBCAM_SRC = "rtsp://192.168.1.101/RtspTranslator.12/camera"

Above is just an example. Adjust the video stream rtsp:// setting to the IP address and connection string for your IP camera per documentation.

Examples from Tony Reinke [email protected]

I have a Raspberry Pi 4 with 4gb of ram and I was able to push it to 1280x720 with consistent video. If someone asks about authentication, the pattern is

WEBCAM_SRC = "rtsp://username:password@ipaddress"  

In my case of using HIKVision cameras

WEBCAM_SRC = "rtsp://admin:[email protected]:554/Streaming/Channels/101/"

Sub stream for going down to 640x480, 640x360, or 320x240 at

WEBCAM_SRC = "rtsp://admin:[email protected]:554/Streaming/Channels/102/"