Stream video from one computer to another using OpenCV and UDP sockets in Python.
- Set the
host
variable inserver.py
to the IP address of the computer running the client program. - Run
> python3 udp_client.py
- Run
> python3 udp_server.py
563E
Once the server starts, a window will pop up to show the video stream.
OpenCV is used to grab a frame from a webcam. The frame is encoded as a jpeg to reduce its size. The encoded frame is sent to the Raspberry Pi over UDP sockets. The Client program on the Raspberry Pi receives the frame, decides it and shows it in an OpenCV window. The process is repeated to create a video stream.
Credits to GitHub user chenxiaoqino as this project was inspired by their CPP version. https://github.com/chenxiaoqino/udp-image-streaming/