Video Chat App via Python OpenCV

Video is nothing but a series of images only. Multiple modules for web developers and app developers are available to easily create video chat app, but all are based on much simpler concepts of images.

Daksh Jain
2 min readJun 9, 2021

Video is a series of images. And an image is an array of numbers. So using OpenCV module in Python I have created a Video Chat App working on my localhost only as of now.

I have used 2 cameras to show the setup perfectly.

The basic concept that works here is socket programming. A server and a client code are created who connect to each other and whenever one of them disconnects the code shuts down, by proper exception handling.
PS. Here the symbolic name “client” and “server” do not hold any meaning as such.

stream_rcvr.py
stream_sender.py

The “so-called server program” starts first and waits for any connection, then the other person can connect to them.
The stream starts to show up and as soon as one person closes it, they both get a message about the stream being exited.

Demo
Demo Video

--

--

Daksh Jain

Automation Tech Enthusiast || Terraform Researcher || DevOps || MLOps ||