Video Streaming using Django-Flask Communication over TCP

Abhiroop Bas
2 min readFeb 12, 2021
Django Flask Socket

Objective

  1. Create 2 servers, one in django and another in flask (eg: django on 9000 port and flask on 8000 port)
  2. 2. User should be able to select a video file at flask server which is streamed to django server over websocket channels.
  3. 3. User should be able to open multiple channels to stream multiple videos simultaneously (like different chat windows)

Solution

Created two servers for Django and Flask respectively. Created the Flask server in AWS ec2 server and the setup looked like follows. the link for the same is as:13.235.79.157:8080/

flask

The Django server was created on repl.it platform and the link for the server is given as: https://TannMannFoundation.abhiroopbasak.repl.co. The template came out to be as follows.

django

The video stream selected at one server could be seen at the other end as an output. Real life applications of such a program would act as a way of sharing videos and streaming on a collaborative platform. The interface looks as follows

django
flask

The codes of the same will be available at: https://github.com/abhiroopbasak/flask-django_with_socket

A screen record illustration is available at: https://drive.google.com/file/d/1phs0mOAMpYgUiZDi9DNY8hKS5MSRxe_1/view?usp=sharing

--

--