Stream the results to a web page/web browser.Īdditionally, the code we’ll be covering will be able to support multiple clients (i.e., more than one person/web browser/tab accessing the stream at once), something the vast majority of examples you will find online cannot handle.Process the frames and apply an arbitrary algorithm (here we’ll be using background subtraction/motion detection, but you could apply image classification, object detection, etc.).Access frames from RPi camera module or USB webcam.We’ll proceed to implement motion detection by means of a background subtractor.įrom there, we will combine Flask with OpenCV, enabling us to: We’ll learn the fundamentals of motion detection so that we can apply it to our project. In this tutorial we will begin by discussing Flask, a micro web framework for the Python programming language. Looking for the source code to this post? Jump Right To The Downloads Section OpenCV – Stream video to web browser/HTML page The second section discusses using ImageZMQ to stream live video over a network from multiple camera sources to a single central server. The first section provides suggestions for using Django as an alternative to the Flask web framework.
To learn how to use OpenCV and Flask to stream video to a web browser HTML page, just keep reading! While I continue to do paperwork with the police, insurance, etc, you can begin to arm yourself with Raspberry Pi cameras to catch bad guys wherever you live and work. There’s nothing like a little video evidence to catch thieves.
I can’t share too many details as it’s an active criminal investigation, but here’s what I can tell you:
In this tutorial, you will learn how to use OpenCV to stream video from a webcam to a web browser/HTML page using Flask and Python.