Skip to content

Instantly share code, notes, and snippets.

@piyush01123
piyush01123 / cam_app.py
Last active January 21, 2021 21:08
Live stream camera feed
import cv2
import flask
app = flask.Flask("CamApp")
def gen():
cap = cv2.VideoCapture(0)
while True:
_, frame = cap.read()
yield (b'--frame\r\n'