Code Monkey home page Code Monkey logo

remote-opencv-streaming-live-video's Introduction

Remote streaming live video with Flask

License

Description

This an implementation on how to get a remote streaming live video connection between 2 different processes using websockets. The video image is captured through OpenCV on one machine and video is served in another machine. This approach serves best the scenario where the Webserver is located in a different network than the machine that is producing the video streaming.

The streaming process can be summed into the following steps:

  1. Capturing video image
  2. For each frame, serialize the image
  3. Flush the data to the Webserver listening socket
  4. Deserialize the data into a jpeg image
  5. Serve the result in the web page

The web framework used for the webserver is Flask. For example purposes, we will be using laptop's webcam image straight away.

Install

This project runs with Python. Also install the following Python dependencies (pip makes it dead simple):

  • opencv-python
  • flask

Usage

  1. Start the server.py and go to "http://<address>:<port>/video_feed"
  2. Start the client.py
  3. See the result in the browser

Credits

The approach on how to serve the video on a webpage is taken from this blog.

License

Code and documentation released under the MIT License

remote-opencv-streaming-live-video's People

Contributors

codectl avatar cjackie avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.