CREATE LIVE STREAMING VIDEO CHAT APP WITHOUT VOICE USING CV2 MODULE OF PYTHON

* A network socket is a software structure within a network node of a computer network that serves as an endpoint for sending and receiving data across the network.

  • The structure and properties of a socket are defined by an application programming interface (API) for the networking architecture.

|| IMPLEMENTATION OF SOCKETS

In Standard Internet Protocols like TCP and UDP :

|| CLIENT-SERVER MODEL

  • Server creates socket on startup
  • May serve several clients concurrently
  • A client should know the server IP and port

PRE-REQUITIES :

|| PYTHON SERVER MODULE

  1. Socket creation

2. Socket bind

3. Socket listen

4. Socket accept

5. Socket client

6. Close client

| VIDEO DATA TRANSMISSION : At Server Side ::

  • With Open CV get video frames of webcam
  • With PICKLE serialize frame to byte data
  • Pack each frame data using STRUCT module
  • Send data to client and display frame

FINAL SERVER CODE :

OUTPUT :

|| PYTHON CLIENT MODULE

  1. Socket creation

2. Socket connect

3. Socket receive

4. Socket send

5. Close socket

| VIDEO DATA TRANSMISSION : At Client Side ::

  • Receive packets and append them to data
  • Unpack the data using STRUCT module
  • Load the frame using PICKLE
  • Display the frame at client side

FINAL CLIENT CODE :

OUTPUT :

  • Note: since I done in same pc I get same image

DONE !!!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store