Python 3 Tkinter Script to Access Live IP Camera RTSP Video Stream Using FFMPEG & OpenCV Library GUI Desktop App


An IP camera can be accessed in opencv by providing the streaming URL of the camera in the constructor of cv2.VideoCapture.

Usually, RTSP or HTTP protocol is used by the camera to stream video. An example of IP camera streaming URL is as follows:


It can be opened with OpenCV like this:

Most of the IP cameras have a username and password to access the video. In such case, the credentials have to be provided in the streaming URL as follows:





This works with my IP camera:

I found the Stream URL in the Camera’s Setup screen: IP Camera Setup Screen

Note that I added the Username (admin) and Password (123456) of the camera and ended it with an @ symbol before the IP address in the URL (admin:123456@)




Given an IP camera:

  • Find your camera IP address
  • Find the port where the IP address is accessed
  • Find the protocol (HTTP/RTSP etc.) specified by the camera provider

Then, if your camera is protected go ahead and find out:

  • your username
  • your password

Then use your data to run the following script:




Leave a Reply